• Advertisement
Sign in to follow this  

Relief Mapping + Deffered Shading

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

I know it's not hard to implement basic relief mapping in a deffered shading renderer, but I'm interested in implementing relief mapping with correct silhouettes, intersections, and shadowing to and from other surfaces. I have heard about "depth correction", but I'm not really sure how it works or whether or not it would work with deffered shading.

Share this post


Link to post
Share on other sites
Advertisement
Pixel shaders can explicitly output a depth value, which means you can output an adjusted depth value based on your relief mapping calculations. It works fine with deferred rendering, since with deferred rendering you typically sample the depth buffer to reconstruct pixel positions during your lighting pass. Then to get silhouettes you can use clip() or discard. The downside is that both outputting depth and discard can mess with early z-cull optimizations, which can make your G-Buffer pass less efficient.

Share this post


Link to post
Share on other sites
Check out this article. it includes code as well

http://upcommons.upc.edu/pfc/bitstream/2099.1/7717/1/Roi%20Mendez%20Fernandez.pdf

Share this post


Link to post
Share on other sites
[quote name='Chris_F' timestamp='1325562841' post='4899171']
Significantly less? If so, whats a good way to deal with it?
[/quote]

It could be...it depends on your hardware, and what you're doing. Profiling is the only way to know for sure.

You can also improve the situation a bit if you use conservative depth output, which is available on DX11-class hardware.

Share this post


Link to post
Share on other sites
[quote name='MJP' timestamp='1325618378' post='4899355']
[quote name='Chris_F' timestamp='1325562841' post='4899171']
Significantly less? If so, whats a good way to deal with it?
[/quote]

It could be...it depends on your hardware, and what you're doing. Profiling is the only way to know for sure.

You can also improve the situation a bit if you use conservative depth output, which is available on DX11-class hardware.
[/quote]

I found your depth sprite example online. Conservative depth had a pretty considerable impact on performance. Also, I notice that OpenGL has had conservative depth since version 3, so is this a DX11 hardware feature, or a DX10 hardware feature?

Share this post


Link to post
Share on other sites
It was added for feature level 11, so I would assume it's only available on DX11 hardware. It's possible it's available on some DX10/10.1 hardware through OpenGL, I haven't checked myself.

Share this post


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

  • Advertisement