honzin
09-08-2005, 10:05 AM
I'm trying to create world (from heightmap) including water which is partially transparent and partially reflective. Level of transparency and reflectivity depends on distance (most transparent near the point of view and most(=fully) reflective far away).
I´ve solved the problem but I paint too many triangles and I am looking for some more elegant solution :)
My solution:
-First step: I paint world (only above water level) and clip parts below water level
-Second step: I paint the same part of world but mirrored - this is reflection
-Third step: I paint bottom part of the world ( below water level) clipped on water level but I have to draw it transparent (more distatnce - more transparency - mirrored(=reflected) part of world is more visible) and I also have to paint these polygons sorted form front to back with enabled depth test
-Last step: I paint water (transparent)
This works but it needs many triangles to be drawn and some of them blended and sorted (from nearest to most distant)
So question is how to do it better and faster :D
I´ve solved the problem but I paint too many triangles and I am looking for some more elegant solution :)
My solution:
-First step: I paint world (only above water level) and clip parts below water level
-Second step: I paint the same part of world but mirrored - this is reflection
-Third step: I paint bottom part of the world ( below water level) clipped on water level but I have to draw it transparent (more distatnce - more transparency - mirrored(=reflected) part of world is more visible) and I also have to paint these polygons sorted form front to back with enabled depth test
-Last step: I paint water (transparent)
This works but it needs many triangles to be drawn and some of them blended and sorted (from nearest to most distant)
So question is how to do it better and faster :D