9 votes

World, view, projection matrix?

The world matrix translates the coordinates of your vertices from model space to world space. This transformation includes the position of the object in the world as well as its orientation and ...
LukeG's user avatar
  • 1,537
8 votes
Accepted

How can I mark a pixel in the stencil buffer?

There are two ways to set the stencil buffer value in Direct3D 11, one of which is only available in Direct3D 11.3 (and Direct3D 12). I will split this answer into two parts accordingly. Direct3D 11 ...
ssell's user avatar
  • 196
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 ...
Jelle van Campen's user avatar
6 votes
Accepted

How can I speed up this HLSL shader?

I can't see anything fundamentally wrong with the shader, but here are a few things I find commonly done wrong with deferred shading that you might be doing. 1: Drawing full screen lights. The beauty ...
Nils Ole Timm's user avatar
5 votes
Accepted

If IDXGISwapChain::Present blocks, does that mean I'm GPU bound?

First, please use a real GPU profiling tool rather than inaccurate measurements. There is a good GPU and CPU profiler built into Visual Studio, so you don't have to hunt around to find decent tools. ...
Sean Middleditch's user avatar
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: ...
Chuck Walbourn's user avatar
4 votes
Accepted

What are other sources of screen tearing?

It appears the problem was due to Windows Aero being turned off on the target machine. According to the nvidia forum here, there is no way to enable vsync if windows aero is not enabled, so the only ...
default's user avatar
  • 737
4 votes

Does Direct3D 11 enable Z-clipping/discard by default?

A common mistake is to zero out MinDepth and MaxDepth of the D3D11_VIEWPORT, effectively ...
Lars Viklund's user avatar
  • 4,084
4 votes
Accepted

DX11 Handle Device removed

There are two places you can potentially get this scenario: When calling ResizeBuffers or Present and you get either ...
Chuck Walbourn's user avatar
4 votes
Accepted

Color Correction in DirectX

Color correction is commonly done through post processing shaders. Basically first you render the scene to a framebuffer, then draw a fullscreen quad that has a shader that takes that framebuffer and ...
Aaro's user avatar
  • 128
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 ...
Vaillancourt's user avatar
  • 16.3k
3 votes

Is it ok to mix shader types?

Yes you can mix shaders, I have around 25 shaders that run per frame from terrain shaders using the full pipeline to post processing. You are getting the crash because after you bind shaders to hull, ...
Justin William Stanley Bryant's user avatar
3 votes
Accepted

View Matrix to Texture Matrix

It's transforming the range from [-1 : 1] to [0 : 1] and inverting the y/u component for texture coords. The standard formula is: u = (x / 2) + 0.5 v = (y / -2) + 0.5. There's a negative 2 here ...
Syntac_'s user avatar
  • 1,001
3 votes

DirectX11, how do I manage and update multiple shader constant buffers?

There seems to be a lot of confusion around the topic of needing to re-bind constant buffers after updating them. As I'm learning about this myself I have seen a lot of topics and discussions with ...
octo's user avatar
  • 31
3 votes

Sampling in the Compute Shader not working

You are sampling from the same location on the texture for every output, therefore the output is a single colour. See the documentation for SampleLevel A fix would look something like this: ...
Muzza's user avatar
  • 176
3 votes
Accepted

How do multiple shaders in a DirectX Engine work?

Might be misunderstanding your question but from the screenshot, it looks like you have a common library of functions to use with your three different shaders: BasicEffect [VS, PS] Brdf [VS, PS] ...
Haywire Spark's user avatar
3 votes
Accepted

Passing Matrix to shader

Yes, there is no way to pass a float4x4 to an input description. By doing that you'd be passing a matrix for every vertex to your vertex shader. This is bad practice unless you need to bind a ...
Honeybunch's user avatar
  • 1,383
3 votes

Direct3D11 Reading from (Static) Index Buffer

You really don't want to read from buffers because you never know where it is in the pipeline and you will normally end up with +20ms of GPU-CPU synchronization. Even with a copy to a staging ...
Justin William Stanley Bryant's user avatar
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 ...
default's user avatar
  • 737
3 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 ...
Chuck Walbourn's user avatar
3 votes

Which DirectX Version to use for a low poly game?

You generally want to use the latest version that is compatible with your target platform. For most people that means DirectX11, since DirectX12 is not supported on versions of Windows (i.e. Windows 7)...
Jack Aidley's user avatar
  • 2,116
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. ...
Chuck Walbourn's user avatar
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 ...
Chuck Walbourn's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible