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.
6 replies to this topic
Sponsor:
#2 Moderators - Reputation: 5444
Posted 02 January 2012 - 04:15 PM
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.
#4 Members - Reputation: 416
Posted 03 January 2012 - 09:14 AM
Check out this article. it includes code as well
http://upcommons.upc.edu/pfc/bitstream/2099.1/7717/1/Roi%20Mendez%20Fernandez.pdf
http://upcommons.upc.edu/pfc/bitstream/2099.1/7717/1/Roi%20Mendez%20Fernandez.pdf
Wisdom is knowing when to shut up, so try it.
--Game Development http://nolimitsdesigns.com: Reliable UDP library, Threading library, Math Library, UI Library. Take a look, its all free.
--Game Development http://nolimitsdesigns.com: Reliable UDP library, Threading library, Math Library, UI Library. Take a look, its all free.
#5 Moderators - Reputation: 5444
Posted 03 January 2012 - 01:19 PM
Significantly less? If so, whats a good way to deal with it?
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.
#6 Members - Reputation: 746
Posted 03 January 2012 - 05:49 PM
Significantly less? If so, whats a good way to deal with it?
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.
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?






