Alpha-Tested Draw to Depth Buffer Warning

Started by
1 comment, last by lwm 10 years, 5 months ago

Hi everybody,

I just implemented simple alpha-testing for the vegetation in my current project.

When I render the shadow map, I obviously need a pixel shader to discard the appropriate pixels, but I really only care about the depth buffer, so I just return zero from the shader. So now DirectX warns me that I use a pixel shader without any bound render targets. As the warning message says, that's not a problem since the data will simply be discarded.

Is there a way to handle this more elegantly? Or, more to the point, is there a way to keep DX from spamming the output window with warning messages that I know aren't a problem?

current project: Roa

Advertisement

Your pixel shader doesn't actually have to return anything. Just make it return void, and it will make the warning go away.

Also to answer your second question, you can filter warning/error messages using ID3D11InfoQueue.

Oh wow, can't believe I didn't try that. Thank you!

current project: Roa

This topic is closed to new replies.

Advertisement