Download presentation
Presentation is loading. Please wait.
1
WILLIAM MOSS ADVANCED RENDERING COURSE PROJECT DECEMBER 4 TH, 2008 Real-time rendering of water and bubbles
2
Desired Effects Water Local reflections Refraction External Lighting Fresnel Effect Bubbles Refraction External Lighting (specular highlight)
3
Water Effects
4
Local Reflection Model water surface as a mirror Reflect the scene over the rest water height Clip Render to a texture
5
Refraction Model water surface as a plane Clip everything below water surface Scale along vertical direction by 1 / 1.33 Render to a texture
6
Texture to Surface Find screen position of undisplaced water surface position Offset by the normal scaled by surface displacement Lookup in the texture tex2D(textureMap, screenPos.xy – displacement * normal.xz);
7
External Lighting Simple Phong model for specular highlights Assume light is coming from infinitely far away (as in the sun)
8
Fresnel Effect Probability a photon is reflected or transmitted Dependent on the incident angle Formula is expensive, implemented as a 1D texture lookup
9
Bubble Effects
10
Refraction Model bubble as one sided hemisphere Refract the ray from the eye Calculate the intersection with the ground plane Lookup in a texture
11
External Lighting Simple Phong model for specular highlights Assume light is coming from infinitely far away (as in the sun)
12
Results Runs at ~30-40fps on my laptop Shaders written in NVidia Cg
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.