Advertisement · 728 × 90

Posts by Aisha Brown

Arbitrary depth write (SV_Depth) might be fine in any case as long as you're aware of the potential performance impact

2 months ago 1 0 0 0

Yes, as long as you can ensure fragments are writing depth as being further away from the camera and never closer. It should be a viable approach.

2 months ago 1 0 1 0

You can mitigate some of the impact by using SV_DepthGreaterEqual (hlsl system semantic) where the fragment shader will write a depth value greater or equal, which allows the early depth testing to still occur, but restricts the the valid depth values you can write

2 months ago 4 0 1 0

You can, but you should be careful about doing so, as it will disable some hardware optimizations like early z testing (testing that gets run before the fragment shader is dispatched). So it will have a performance impact.

2 months ago 3 0 2 0

be aware, if you are targetting cross platform and not just directx/hlsl then some shader compilers may act counterintuitively with NaN/Inf. Specifically, in Metal with fastmath enabled the shader compiler can treat NaN or INF as undefined behaviour. It may delete whole chunks of code

10 months ago 16 0 1 0