Jump to content
  • Advertisement
Sign in to follow this  
lwm

Alpha-Tested Draw to Depth Buffer Warning

This topic is 2070 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!