Real-time rendering of water and bubbles

12
WILLIAM MOSS ADVANCED RENDERING COURSE PROJECT DECEMBER 4 TH , 2008 Real-time rendering of water and bubbles

description

Real-time rendering of water and bubbles. William Moss Advanced Rendering Course Project December 4 th , 2008. Desired Effects. Water Local reflections Refraction External Lighting Fresnel Effect Bubbles Refraction External Lighting ( specular highlight). Water Effects. - PowerPoint PPT Presentation

Transcript of Real-time rendering of water and bubbles

Page 1: Real-time rendering of water and bubbles

WILLIAM MOSS

A DVA N C E D R EN D E R I N G C O U R S E P R O J E C TD EC E M B E R 4 T H , 2 0 0 8

Real-time rendering of water and bubbles

Page 2: Real-time rendering of water and bubbles

Desired Effects

Water Local reflections Refraction External Lighting Fresnel Effect

Bubbles Refraction External Lighting (specular highlight)

Page 3: Real-time rendering of water and bubbles

Water Effects

Page 4: Real-time rendering of water and bubbles

Local Reflection

Model water surface as a mirror Reflect the scene over the rest water height Clip Render to a texture

Page 5: Real-time rendering of water and bubbles

Refraction

Model water surface as a plane Clip everything below water surface Scale along vertical direction by 1/1.33

Render to a texture

Page 6: Real-time rendering of water and bubbles

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);

Page 7: Real-time rendering of water and bubbles

External Lighting

Simple Phong model for specular highlights Assume light is coming from infinitely far away (as in

the sun)

Page 8: Real-time rendering of water and bubbles

Fresnel Effect

Probability a photon is reflected or transmitted Dependent on the incident angle Formula is expensive, implemented as a 1D texture

lookup

Page 9: Real-time rendering of water and bubbles

Bubble Effects

Page 10: Real-time rendering of water and bubbles

Refraction

Model bubble as one sided hemisphere Refract the ray from the eye Calculate the intersection with the ground plane Lookup in a texture

Page 11: Real-time rendering of water and bubbles

External Lighting

Simple Phong model for specular highlights Assume light is coming from infinitely far away (as in

the sun)

Page 12: Real-time rendering of water and bubbles

Results

Runs at ~30-40fps on my laptopShaders written in NVidia Cg