Planetary engine, part III ( water )

Published October 18, 2006
Advertisement
I continued to work on the atmospheric shaders / sunsets, as well as water / ocean rendering.

Nothing special to say about the atmospheric shaders. Lots of tweaking and testing.

More interesting is the water topic. It's some early work, but i got ride most of the Z-Fighting by adjusting the Z-Near clipping plane distance to as far as possible. I still have to study how it's going to interact with close objects ( like a flying spaceship ), since to render close objects like ships the Z-Near has to be pretty close ( a few meters only ). I'm not worrying too much, as i believe it's just a matter of selecting appropriately which frustum to use ( i have a serie of frustums, increasing in Z distance: frustum #0 is for close objects and ships, frustum #1 for the close planet, frustum #2 for distant planets, etc.. ). The main problems start when frustum #0 and #1 overlap, ie. you've got a flying spaceship, but behind a mountain for example.

The rendering of water is extremely basic so far, i've only created a simple shader that generates a per-pixel water normal by blending together 4 normal maps coming from perlin noise fBm. This normal is then used to do all sort of "magic" calculations: specular effect with the half-angle vector to the sun, sun color, water color depending on waves, and of course waves animations by applying translations to each of the noise textures. The water surface is still flat though, it's a pure shader effect.

Later on i shall implement true reflections / refractions, shadows from clouds, underwater "fogging", etc..

Mandatory screenshots ( click for 1024x768 ):












0 likes 2 comments

Comments

jollyjeffers
You might say that the rendering effect is only basic, but in the style we've all come to expect - looks very good already [grin]

Although the 1st shot shows some tiling (?) artifacts for the water displacement...

Keep up the good work!
Jack
October 18, 2006 11:26 AM
Cypher19
Looks awesome! My hat is off to you for not going with the tried-and-not-very-true method of a slightly pertubed flat plane. If I was to change/suggest one thing though, try and see if there's some way you can make the water look less repetitive and more noisy. Aside from that there's very little that I'd change.
October 18, 2006 07:24 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement