7
votes
"DirectX will only draw polygons with an [X,Y] from [-1,-1] to [1,1] and with a Z from 0 to 1.", What does this mean and how to work around it?
The range [-1 ; 1] x [-1 ; 1] x [0 ; 1] mentioned in the tutorial refers to the canonical view volume. It is the final coordinate space vertex data gets mapped to ...
5
votes
Getting data from the backbuffer D3D11 using Map
Your code doesn't use your created texture with D3D11_CPU_ACCESS_READ.
It creates a texture:
...
4
votes
Accepted
Why do these DirectXMath functions seem like they return column-major matrics?
You posted a column-major version of the translation matrix for (1,1,-1):
1.0 0.0 0.0 1.0
0.0 1.0 0.0 1.0
0.0 0.0 1.0 -1.0
0.0 0.0 0.0 1.0
...
4
votes
Accepted
In game development, what aspects to consider when choosing a 32-bit architecture over a 64-bit architecture?
The most obvious thing to consider is that using a 32-bit architecture for your executable allows you to address about ~4gb of RAM on Windows while using a 64-bit architecture allows the program to ...
3
votes
How can you make custom direct3D11 calls in Unreal Engine 4?
I figured out a way to render to texture.
Create a new c++ component that has a UTextureRenderTarget* property
Create a render target in unreal. I followed the ...
3
votes
Accepted
error X4016: SV_InstanceID semantic cannot be used with 10Level9 targets
TL;DR: Edit your shader compilation to use Shader Model 5.1 or later.
With the DirectX 12 API, there is no supported device to date that supports anything less than Direct3D Feature Level 11.0. ...
3
votes
Accepted
What actions should I perform in DirectX 11 to correctly process Alt+Tab?
ALT+TAB is generally handled through WM_ACTIVATEAPP and "FSE" games switch out/in of fullscreen mode based on this message.
With DXGI you can manually implement ...
3
votes
What actions should I perform in DirectX 11 to correctly process Alt+Tab?
Here is what I've found works. All of this information is probably scattered around the DXGI documentation on various disconnected pages; it's been a while since I've reviewed it.
For windowed modes (...
3
votes
Accepted
God rays shader - Trouble with sun position
In GLSL (like HLSL), a vec4 (float4 in HLSL) has three different ways to access its four values. You can use (rgba), or (xyzw), or (stpq). They're all identical to each other; Asking for ...
3
votes
Sampled texture from bitmap font produces blue glow
So in true programmer fashion, I solved the issue after being frustrated with it forever. BITMAPINFO stores in ARGB format, not RGBA like I was expected. The solution is just changing the alpha ...
3
votes
Accepted
Constant Buffer Alignment issues
Review the HLSL cbuffer packing rules here: https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-packing-rules
HLSL packing rules are similar to performing a #pragma pack 4 ...
3
votes
Accepted
Borderless windowed (fake fullscreen) mode doesn't cover the entire screen
It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
This was, of course, all my own fault.
I had some code for centering ...
3
votes
Accepted
How to sample a TextureCube texture
This doesn't work the way you're expecting because texture slots and sampler slots are decoupled in D3D10/SM4+. So unlike legacy code, you can have a texture at slot x, a sampler state at slot y (and ...
3
votes
DirectX11 creating input layout throws error on input signature not matching shader (instancing)
The problem was I was not calculating the number of elements in the CreateInputLayout call. It was fixed at 2 elements.
Incorrect
...
2
votes
Problem Rendering a Wireframe Cube and Grid with DirectX 11
D3D11_INPUT_ELEMENT_DESC inputElementDesc[] =
{
{"POSITION",0,DXGI_FORMAT_R32G32_FLOAT,0,0,D3D11_INPUT_PER_VERTEX_DATA,0}
};
You need to change the format to ...
2
votes
Accepted
Direct3D 11 : Vsync to 60 fps not matter the monitor refresh rate
Vsync, like Sleep, is a terrible way of controlling frame rate, because (and also like Sleep) controlling frame rate is not it's primary purpose but a fortuitous side effect of it's primary purpose. ...
2
votes
Accepted
How can I use a different upscaling method in dx11?
Typically you just draw 2D images as textures (a.k.a. "sprites") as is done with SpriteBatch in DirectX Tool Kit. You can specify the sampler state to use ...
2
votes
Accepted
DDS load texture and cubemaps
I found my error. The vertex shader outputs the homogeneous clip coordinates with SV_POSITION semantic before the model space position with POSITION semantic. The Pixel shader reads the input position ...
2
votes
Accepted
Access a ID3D11Texture2D in another thread
Methods on the DirectX 11 Device are thread-safe, but methods on the DirectX 11 DeviceContext are not.
In other words, the application must manage the thread-safety when sharing the immediate context ...
2
votes
Accepted
Implementing a Deferred Renderer (Basic Understanding)
In short, there's nothing super special about a deferred renderer when it comes to drawing the initial scene. You just submit your triangles via VBs/IBs, state, and the ...
2
votes
Terrain collision with sphere and OBB
Terrain is a difficult collision detection example, as it is complex, so you reduce the complexity of the problem. One possible solution, for static terrain meshes:
Make your terrain out of small ...
2
votes
Accepted
DirectX 11 Compute Shader error DXGI_ERROR_DEVICE_HUNG
This is called a Timeout Detection and Recovery (TDR) error which by default happens whenever the GPU stops responding for 2 seconds or longer--technically when a single driver packet takes longer ...
2
votes
Why is my texture displaying incorrect colours using dx11?
It seems the packing order of the uint_32 value was incorrect. I thought the packing should be RGBA left to right, rather than ABGR.
Switching the packing order ...
2
votes
FormatMessage not working for HRESULTs returned by Direct3D 11
TL;DR: The short answer is that you should be using FormatMessage, but you should also be using Windows 8 or later. With Windows 7, the OS was never updated to ...
2
votes
d3d11 renderqueue multi pass rendering design best practice
I want to post an answer. I decided to go for a flexible solution to achieve the following features:
Rendering to different layers (world, overlay text, gui, etc.)
Multipass rendering (render same ...
2
votes
Instancing with Directx11
Instancing is basically a technology that allows you to draw many instances using only GPU. You basically tell the GPU "draw this many instances of this buffer" and it does this by adding an ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
directx11 × 777c++ × 211
directx × 211
hlsl × 136
shaders × 90
textures × 64
sharpdx × 54
rendering × 38
c# × 31
3d × 25
graphics × 22
slimdx × 21
directx9 × 19
depth-buffer × 19
fragment-shader × 18
matrix × 17
windows × 17
shadow-mapping × 16
vertex-buffer × 15
opengl × 14
2d × 14
directx10 × 14
optimization × 13
lighting × 12
compute-shader × 12