Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 16874

DirectX: ShadowMap becomes empty if 'discard' is used in shadow pass

$
0
0

Following the tutorial in msdn:

https://docs.microsoft.com/en-us/windows/uwp/gaming/render-the-shadow-map-to-the-depth-buffer

The above link is Step 2. You can go to Step 1 if you want from the links to the left in from the above link.

Anyways, it says the following: “The output of this shader is thrown away; it can call discard on every pixel.”

But when I do discard, when I check the graphics debugger and check the shadow map resource, this happens:
 

But if I use 

return input.pos.z / input.pos.w

in the pixel shader in the shadow render pass …


Viewing all articles
Browse latest Browse all 16874

Trending Articles