ivanmunguia / vdrift-ogre

Automatically exported from code.google.com/p/vdrift-ogre
0 stars 0 forks source link

Water shader, underwater #99

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For a better material for water we need:
1. water refraction (screen effect)
2. foam or alpha near shore (also needs depth)
3. depth fog (if we have the depth rendered)
4. underwater effect (fog (and distortion), for the part of viewport that is 
underwater)
5. water caustics on terrain, below water
6. true reflection from 2D screen (not that badly needed but would be good 
addition to the only sky (but 3D) reflection.
7. there is a small bug with a black line at sky in current reflection.

Of course all those need to have params and settings in GUI.
These materials need to have few versions (low,medium,high,ultra). The current 
one is probably medium.
And even shader code generation in cpp code.

Original issue reported on code.google.com by Cry...@gmail.com on 1 Nov 2011 at 9:59

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
8. water/mud is always the same - it doesn't use scene or light's ambient 
value, thus separate materials are needed for different lighted scenes which is 
bad.

Original comment by Cry...@gmail.com on 16 Dec 2011 at 7:07

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Done 2. Alpha near shore (transition from water to terrain) using editor saved 
1k x 1k texture, also has water depth for deeper areas. No foam though, maybe 
not needed.

Original comment by Cry...@gmail.com on 12 Feb 2012 at 9:03

GoogleCodeExporter commented 9 years ago
done: refraction and reflection

Original comment by scrawl...@gmail.com on 14 Feb 2012 at 12:13

GoogleCodeExporter commented 9 years ago
So done 1 and 6 by scrawl.

Still to do: (I think in most wanted first order)

4. underwater effect
(fog and distortion), for the part of viewport that is underwater
Need to compute camera near clip with the fluid car is in and get the 2d points 
on screen to draw probably 2 tris screen effect

8. use global ambient, diffuse, specular, from light (should be easy, but will 
probably break look on some tracks).

2. ? foam near shore
5. ? water caustics on terrain, below water (probably difficult and not that 
needed, had to add code to terrain shader)
7. small bug with a black line at 3d sky reflection

Original comment by Cry...@gmail.com on 14 Feb 2012 at 8:00

GoogleCodeExporter commented 9 years ago
Done (kind of) are:
2. alpha near shore
3. depth fog
without using prerendered depth (only in MRT), its done with texture rendered 
in editor having near terrain depth, and fog depth.

New:
9. Water waves.
Needs a lot more vertices. And reading textures (height) in vertex shader for 
waves animation.
Also normal computation to get proper normals after deforming water mesh (or 
maybe just sum of normal textures).

10. Foam texture, used randomly on water, or on 9 waves high part, and/or near 
shore.

Original comment by Cry...@gmail.com on 18 Mar 2012 at 7:40

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
7. is actually a problem with geometry, fix by using first vertices column as 
last ? Quite visible on R1-Mars start.

Original comment by Cry...@gmail.com on 8 Aug 2013 at 1:07

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
old, continued in issue 267

Original comment by Cry...@gmail.com on 8 Sep 2013 at 10:18