per pixel displacement mapping
Be aware that one of the big problems with per pixel displacement mapping is that it throws early Z out the window. You might want to do occlusion culling for anything that's using it, because all of the pixels will be computed regardless of depth test.
You only lose early Z rejection if you actually modify the z value in the pixel shader. However most implementations of per-pixel displacement mapping do NOT do this (for the very reason you mentioned). So you don't get proper z buffering but you do get parallax, self-occlusion etc. If you are using shadowmapping and deferred shading you can write out the modified viewspace position (based on the height) and have your shadows react to the bumps almost for free :)
That's a good point about deferred rendering and shadow maps. If anyone has a demo that does this, I would really like to see it.
Ok, per-pixel displacement now works, tho still now view independant. For some reason I dont get it rotate correctly like the demo does. I tried to use the inverse/transpose modelview matrix to transform the eye position like the code of the demo does. But with no success yet.
Quote:Original post by jeroenb
Ok, per-pixel displacement now works, tho still now view independant. For some reason I dont get it rotate correctly like the demo does. I tried to use the inverse/transpose modelview matrix to transform the eye position like the code of the demo does. But with no success yet.
and have you tried it without any transformation matrix? I didn't have a deep look at the source in the demo app. but in the book they don't use any transformations...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement