Advertisement

Parallax mapping...

Started by June 28, 2004 05:27 AM
11 comments, last by RipTorn 20 years, 5 months ago
I'm not really satisfied with parallax mapping... Are there other techniques I should look at ? I heard about displacement mapping, but it seems there are not lots of gfx cards that support this... I did hack a solution based on multiple layers and alpha testing so you can have a idea of the result I'd like to obtain. I'm sure it's possible to get better rendering with lower polygon count by using parallax mapping and aligning quads with the camera...
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
Displacementmapping is a "completly different technology". There for example the quad you draw is tesslated in many small triangles and these are then translated by a vertex shader which has texture access (right now GeForce series 6 only). This is ture displacement mapping.
If you want real geometry detail you have to use displacement mapping. But if you are searching for a technique that gives you some detail quailty I'd recommend you to use parallax mapping. Parallax mapping is in my opinion the technique with the best quality-performance ratio.

BTW: Your screenshot looks very cool. Why aren't you satisfied with that?
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
Advertisement
Quote: Original post by Corrail
BTW: Your screenshot looks very cool. Why aren't you satisfied with that?


Because it's not realtime. It's done using 256 layers.
But I think I can get something decent with 16 layers and parallax mapping...
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
Well, you can implement displacement-mapping on the GeforceFX-series! It runs pretty fast on my GeforceFX 5900XT!

Best regards
Roquqkie
Quote: Original post by rodzilla
Quote: Original post by Corrail
BTW: Your screenshot looks very cool. Why aren't you satisfied with that?


Because it's not realtime. It's done using 256 layers.
But I think I can get something decent with 16 layers and parallax mapping...


How do you do parallax mapping? Which extensions do you use?
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
@Corrail: I use ARB_vertex_program and ARB_fragment_program for parallax mapping. You can get the programs in my "tiny stupid demo", they are in the "programs" directory.
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
Advertisement
there you get the paper, including ARB_vp and ARB_fp sample code

I'm not sure parallax mapping and texture layers/slices are compatible.

Parallax mapping is a cheap way of approximating parallax. The approximation is very good on low-frequency bumps (for instance the eye of this statue) and looks generally bad on high-frequency bumps (for instance the teeth of the statue).

To get an even better parallax effect with a single layer, you either have to perform multiple texture lookups in order to compute a better parallax approximation, or thanks to recursive programs you could have a good chance of finding the 'best' parralax approximation on most pixels. But both methods are not "cheap", especially the latter which requires more processing power, and requires better hardware (currently exposed through OpenGL only on GeForceFX hardware in NV_fp extensions).
One thing to note when you are working with parallax mapping is choosing/creating heightmap textures. Be very carefull with that. Bad texture will totaly ruin your effect. Avoid all "sharp" edges and other high frequency effects. If you use JPEG or DDS, compression can sometimes introduce those errors. And always use full texture color range (use colors for 0 to 255) and then scale offsets in VP. It looks much better then if you use a small sub-range and fixed scaling.

How did you come up with height-texture for that example. Did you draw it or "derived" it from diffuse texture?
You should never let your fears become the boundaries of your dreams.
I've done Parallax Mapping myself using GLSL. But my implementation was based on the paper which vincoof posted. This is a quite simple way to improve image quality but be aware of some issues (see Darkwings post).
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
Quote: Original post by Roquqkie
Well, you can implement displacement-mapping on the GeforceFX-series! It runs pretty fast on my GeforceFX 5900XT!

Best regards
Roquqkie


No you can't. It requires a texture access in the vertex shader, which is currently only available on the NV40 series graphics chipsets.
If at first you don't succeed, redefine success.

This topic is closed to new replies.

Advertisement