Jump to content
  • Advertisement
Sign in to follow this  
xycsoscyx

Output Depth Register

This topic is 4859 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

How do I write to the output depth register using HLSL? I know, when I declare my output vertex format, I use "float d : DEPTH0;", then in the shader I write to that, but it doesn't seem to do anything. It might be that it's not supported on my card (Raedon x600, I haven't checked yet), but I would assume the x600 can handle it? Do I need to enable and render state to use the output depth value from my pixel shader? Thanks

Share this post


Link to post
Share on other sites
Advertisement
the DEPTH semantic is for pixel shaders, not vertex shaders. Try moving your calculations over to the pixel shader. Have a look at this page to see which semantics are valid and where...

I'm pretty sure if you use the default rasterizer it'll do the normal depth computations based on whatever your output position is...

hth
Jack

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Well, when I say my "output vertex format", I mean the structure I have declared as the output from my pixel shader (yes, pixel shader). It contains my three output color registers (multiple render targets), and the depth value.

I actually just realized what I am trying to do won't work, anyways. It was to fake alpha testing, the problem being that the clip instruction still updates the depth buffer before it clips the color operation. This means that keyed out areas don't update the color, but still update their depth, so things behind them will get depth tested out.

I was intending to modify the depth information at this point so that things behind it won't get depth tested out, but I just realized that it also means that the depth of solid things behind it already will have their depth overwritten, so things will appear in front of THEM, then it should be depth tested out.

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!