Half Life 2 Water
Firsty, check out this: http://www.techreviewer.com/content/reviews/hl2/11_boat_big.jpg
Im trying to implement water using HLSL and would like it to be like that screenie. Can someone please explain to me in as much detail as possible how I achieve that affect? Such as, do I use a stencil buffer and render into a render targer which fed into a shader to do fake refraction etc..?
Any help is appreciated.
Thanks,
Meshy
Quote: Original post by MeshMan
Yes. Way over my head in every way :)
Unfortunately, you do have to realise that HL2's water effects are NOT simple [smile]
From what I've looked at, that style of water comes in 3 core parts:
1. Render whats "under" the water, this will form the refraction later on.
2. Render what's reflected by the water, fairly standard reflection stuff here
3. Blend them together per-pixel or per-vertex depending on the computed Fresnel Term
Obviously, there is more to it than that, but it might give you some direction. Parts 1 and 2 can be fairly straight-forward render-to-texture operations with some clever matrix trickery.
YannL had a few interesting things to say about water rendering:
Lecture On Water
Water reflection and refraction with normal map, without pixel shaders
Reflective surfaces (eg: water)
Water reflections
Bump mapped water
GDNet Article: Realistic Natural Effect Rendering: Water I
Given that, at least the basic components, are from some reasonably simple graphics theory I suggest you read up on the subject - the above links should get you rolling. Once you understand the theory, dig back into your samples and learn how to implement it via HLSL.
hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>
There is a very good article in ShaderX2 that explains how to produce what that looks very much like HL2's water. Actually, that article was out before HL2, so I wouldn't be surprised if the Valve coders referenced it. So, if you have a copy of the book, dig it out and take a look [smile]
It is fairly intensive though, and pretty performance-heavy.
It is fairly intensive though, and pretty performance-heavy.
Thanks for the replies guys.
Ive read most of them links that you posted Jeff throughout the entire of today. I'm just having technical difficulties in creating all the objects I need to work with like the reflection matrix, the redner target (which everytime i created seems to always use the image data of a cube map Ive created and wont clear when i call Device->Clear?!).
Water wasn't as simpleas I thought. All these advanced rendering things ive never ever touched on before (I blame the books!).
Ive read most of them links that you posted Jeff throughout the entire of today. I'm just having technical difficulties in creating all the objects I need to work with like the reflection matrix, the redner target (which everytime i created seems to always use the image data of a cube map Ive created and wont clear when i call Device->Clear?!).
Water wasn't as simpleas I thought. All these advanced rendering things ive never ever touched on before (I blame the books!).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement