DirectX 11 is the latest release of Microsoft's collection of APIs which contain features to aid in game development.

learn more… | top users | synonyms (2)

0
votes
1answer
18 views

Problem with ID3D11DeviceContext::CopyResource method - How to properly read a texture CPU-side?

I am trying to make a full copy from a render target texture to a staging one but it seems my data length ends up being only 4 in length instead of 921600 (1280 * 720). Here is my textures ...
0
votes
1answer
38 views

Why isn't my cbuffer updating?

I am really frustrated because my cbufer isn't updating. This is my VS: cbuffer MatrixBuffer: register(b0) { float4x4 worldViewProj; }; struct VertexIn { float4 Pos : POSITION; float4 Color: COLOR; ...
1
vote
0answers
16 views

Is it possible to have a SoA Vertex Buffer in DirectX 11?

Hi! I'm wondering if it is possible to structure a Vertex Buffer in a SoA approach like this { x1, x2, x3 . . . xn, y1, y2, y3 . . . yn, z1, z2, z3 . . . zn } instead of the traditional AoS ...
0
votes
0answers
26 views

Cannot see cube primitive [closed]

I'm struggling with DirectX 11. I'm trying to integrate DirectX 11 into MFC. At the moment I've got Direct11 to run from the OnInitialUpdate() function on line 126. However I cannot get the cube to ...
6
votes
0answers
270 views

Strange SSAO effect (wrong position/normal textures in view space?)

I try to create an SSAO effect in my game engine (DirectX 11, C++), based mainly on gamedev.net tutorial by José María Méndez. Unfortunately, it doesn't cover texture-creating problem (normals, ...
0
votes
1answer
82 views

How to pass a big (60+) amount of variables to an HLSL pixel shader?

I am in trouble at trying to pass a big amount of variables needed for my pixel shader computations. After trying and failing to link my struct to a cbuffer (data alignement mismatch) I tried passing ...
2
votes
2answers
275 views

C++ struct doesn't align correctly to a pixel shader cbuffer

To expand from my previous question, I must add I can't correctly map my C++ structs to a corresponding cbuffer inside the pixel shader. When outputing random colors defined in the struct C++ side, it ...
0
votes
1answer
19 views

Getting mouse movement value with DirectX Tool Kit

today I want to ask a question about how to get mouse movement value with DirectX Tool Kit. While I can certainly use Mouse::SetMode(MODE_RELATIVE), to do this, I want to be able to get the mouse ...
3
votes
2answers
409 views

Mapping a C++ struct to an HLSL cbuffer

Out of curiosity (and peace of the mind...) I wondered how DirectX decides which attribute from a struct corresponds to the right variable inside an HLSL cbuffer-register(x) (apart from the order/type ...
1
vote
1answer
31 views

How to correctly pass multiple light structures to shader stage?

I'm having some problems when passing multiple light structures to a shader stage. I'm using an array of point lights that is updated each frame. This is my code for creating the buffer ...
1
vote
0answers
49 views

How do you fix wobbling shadow edges?

I've implemented an omni-directional shadow map and I've noticed a rather unwanted behaviour on the shadows. It seems like when the angle between the occluded points and the light source is really ...
2
votes
0answers
31 views

How do I sample a cubic shadow map in DirectX 11?

I've implemented a cubic shadow map for dealing with omni-directional light sources in my scene. By defualt it produces hard shadows Obviously a shadow map with higher resolution (currently using ...
1
vote
2answers
31 views

DDS files with DirectX Tk, Some work, some don't

I am learning DirectX with the DirectX Tool Kit library and everything seems to be going smoothly but I have run in to a tiny little hiccup. I am currently trying to load DDS textures from file ...
0
votes
1answer
25 views

Viewport and debug session

I define and set viewport using this piece of code: D3D11_VIEWPORT viewport; viewport.Width = (FLOAT)pBspWindow->GetWidth(); viewport.Height = (FLOAT)pBspWindow->GetHeight(); viewport.TopLeftX ...
0
votes
0answers
63 views

Speed up the DirectX game - how else can I boost the fps with typical triangle drawing?

I am writing my own c++/DirectX engine. I've made the basic framework and here comes the time for optimizations. I don't want to focus on optimizing the resources themselves right now (meshes, ...
0
votes
0answers
33 views

Sphere texture mapping using Directx 11

I have a spherical panoramic image which I would like onto a sphere and centre it around the camera so I can look around the image, how should I best go about this? I will be using DirectX11. ...
1
vote
1answer
64 views

Map a normal image to a cubemap

How can I map a normal non T form image to a cube map? and if there is no manner with which to do this, is it possible to, via DX11, split the image, as the image may be generated on the fly? ...
0
votes
0answers
21 views

Update part of dynamic Vertex Buffer. SharpDX

I'm creating application to draw simple 2D charts in a fast way. Updating my VertexBuffer is implemented as below: Device.ImmediateContext.MapSubresource(_signalVertexBuffer, ...
0
votes
0answers
21 views

Directx11 Shadow Mapping Not Rendering

I'm reading luna directx11 book,i want to implement shadow mapping using it but i'v got a problem with it here is the image from my scene(at bottom right you can see shadow map,why is it in red color? ...
1
vote
1answer
56 views

DX11 Mixing 2D and 3D

So I am somewhat new to working with DirectX rendering, and I have done some 2d and 3d work. I am planning on working on a new application where I will be rendering a bunch of 3d scenery, and then ...
0
votes
1answer
48 views

Transformation problems with hardware instancing in DirectX 11

I'm getting some wonky geometry in my application when trying to use instancing. I'm not sure if I'm doing the mapping of my per instance data wrong. This is how my mapping looks like: XMMATRIX scale ...
0
votes
2answers
27 views

How to handle mesh update in its vertex buffer

suppose i have a mesh, it can undergo any kind of changes - bend, stretch, even been torn. How should i update vertex buffer in DirectX for this mesh. For now i recreate it every time, and i don't see ...
0
votes
0answers
62 views

Using a Unity RenderTexture in a native plugin (4.6.1)

I am trying to create a RenderTexture in unity, but I want to update it using a plugin. I am doing this on Windows 7 Pro 64bit and I wrote the plugin using VS2010 professional. Here is the code in ...
0
votes
1answer
22 views

DirectX 11 throws out my pixel shader when I multiply verts by MVP

Been following some tutorials online for DirectX 11. I was able to successfully get a triangle to render in screen space. But the moment I add a MVP matrix, my triangle disappears! Looking at it in ...
0
votes
1answer
53 views

Will DirectCompute run this HLSL code

I found a sample about how to run a HLSL code with DirectCompute. https://code.msdn.microsoft.com/windowsdesktop/DirectCompute-Basic-Win32-7d5a7408 This is the HLSL script I want to run ...
0
votes
0answers
49 views

Animations in games

I wonder how skeletal animations in games work. I am Writing my own Graphics Engine for "fun", and I have come across several problems with animations. Here is how I do it right now: 1: Load the ...
0
votes
0answers
45 views

DirectX 11, Render vertices as points in Unity

I'm attempting to asses what is the most efficient manner to render vertexes as points in Unity with DirectX 11. I'm attempting to create a point-cloud instancing shader, that creates vertices in ...
0
votes
0answers
38 views

Buffer resource as shader resource view

I am trying to build a shader that change the output color according to something that happen in my c++ code In my code I create a buffer with four element(each element containe four float - RGBA) ...
0
votes
0answers
23 views

Rotating a directional light about y axis (DirectX11)

I have 2 fixed objects in a scene and a directional light which I am rotating on each update but I am not sure if I am doing it correctly after looking at the results. Here is the code: rot += ...
0
votes
1answer
88 views

How to access raw texture data in DirectX 11?

I want to get access to a texture's pixel color data on the CPU. When trying to map the texture, I get E_INVALIDARG in return from ID3D11DeviceContext::Map. ID3D11ShaderResourceView* resourceView; ...
0
votes
1answer
56 views

VS Graphics Diagnostic Tools and IDXGIFactory::EnumAdapters()

I have the following constructor for my main application class where i enumerate all adapters, that looks something like this: CApplication::CApplication() { IDXGIFactory* factory; ...
0
votes
2answers
132 views

Native vs Desktop Resolution

I have code set up that finds the native resolution of a monitor and uses that to determine the resolution for (DirectX exclusive) fullscreen mode, using SetupAPI: HRESULT ...
0
votes
2answers
78 views

Disable/Remove Warning about a not bound Render Target View

So to render into my shadow map depthstencil buffer i only bind a DepthStencilView to the Output Merger. Like this m_pContext->OMSetRenderTargets(0,0, m_pShadowMapDV); ...
0
votes
0answers
20 views

In HLSL pixel shader, why am I getting [-256.0, 256.0] values in SV_POSITION input?

My question is basically in my DirectX11 pixel shader, why am I getting a range of values from -256.0 to 256.0 in the SV_POSITION input instead of the supposed values from 0.0 to ViewportWidth and 0.0 ...
0
votes
2answers
114 views

Directional light and finding relevant shadow casters

Right now when culling the models to render for the directional light shadow map pass I just do a view frustrum culling using the main camera. At some angles, the objects will be outside the view but ...
0
votes
1answer
58 views

Sample() returns (0, 0, 0) for normal map 90% of frames

I'm having some trouble reading the values from my Normal map in my lighting fragment shader. The relevant part of the shader code is as follows: Texture2D NormalGB : register(t0); Texture2D ...
0
votes
1answer
201 views

DirectX11 Equivalent of OpenGL code

I am currently porting parts of my engine over to D3D11 from OpenGL and was trying to figure out how I would accomplish the following blending functions in D3D11. glEnable(GL_BLEND); ...
-1
votes
1answer
110 views

How do i load, render and trasnform 2D images using Direct3D 11 API? [closed]

In my small game project using DirectX 11 API, I created a Direct3D device, and can draw 3D meshes, using web tutorials and a book. But I cannot figure out how to load, transform (rotate, scale, ...
1
vote
2answers
78 views

Directx displaying selectable text

I am new to direct x and following this tutorial : brayzarsoft (part 14) I was able to display text. However, using this method the text is rendered to a texture. When you look at games that have ...
0
votes
1answer
59 views

How do i draw depth complexity(overdraw) in directx 11?

I want to read the stencil value in the shader so I can set colors for different depths. What I understand. Make a loop after the scene is rendered but before is is presented. so a loop with the ...
2
votes
1answer
91 views

How do I draw a full screen quad in DirectX 11?

How do I draw a full screen quad that shows red on the screen?
0
votes
1answer
96 views

How to load in meshes efficiently into DirectX11

I wanted to know if there was a standard and efficient method to load meshes from a file into DirectX11. Currently, I'm loading .obj's by parsing them in and storing their information into a vertex ...
1
vote
0answers
126 views

Directx 11 full screen

I build simple directx 11 application in c++ that draw square to screen. Also check in the end of the program when I close the last peace of directx the number of free reference. This work great in ...
2
votes
1answer
83 views

Since D3DX utility library is deprecated, what can I do about this legacy code?

D3DX Structures utility library is deprecated for Windows 8 and its not supported for Windows Store apps. So my question is, Does anyone know what to replace this legacy code with.. ...
0
votes
0answers
56 views

How can I avoid transposing matrices and still use more efficient dp4's instead of a mul and 3 mad's?

I'm using the 'correct' matrix-vector multiplication form (M*v) as recommended here. All my matrices in shaders are prefixed with 'column_major'. This line of HLSL code: hPos = mul( ...
2
votes
0answers
322 views

PSSM and tightening the split frustrums

So I have implemented PSSM which currently does not care about the objects in the scene, meaning alot of resolution is wasted on empty space. This image shows the bottom two splits wasting alot of ...
0
votes
1answer
58 views

DirectX11 Shader issue

I am currently having issues with HLSL shaders. I am trying to implement point lights but I am getting unusual data when debugging the shader in Visual Studio. I have read on several sites that say ...
0
votes
1answer
35 views

HLSL Shader Optimilation with MAD(m,a,d)

I understand that the expression x = m*a+d is most efficiently written as x = mad(m,a,d) because at the assembly level only one instruction is needed rather than a multiply and add separately. My ...
1
vote
2answers
43 views

Update single variable in DirectX Shader

I am trying to update a single variable within a CBuffer but I am unsure of how to do this. I have a LightingBuffer which is passed to the GPU containing, ambient color, diffuse color etc and I want ...
0
votes
1answer
38 views

Simple switch to instanced draws causes consistent, but incorrect, results

I have dumbed the following code down to "stupid simple" for DirectX and still cannot get any cooperation: g_d3dContext->OMSetRenderTargets(1, ...