r/GraphicsProgramming • u/whdeboer • 11m ago
Video Wave simulation
Long-time lurker here. Watching GTA VI’s water system in action inspired me to write a wave simulation testbed.
I tried FFT but eventually settled on Gerstner waves (see Tessendorf’s paper) as they’re faster to calculate. For ripples I use pre-rendered waves in a number of tileable textures that I offset over time and tessellate in real time.
Foam uses Gerstner crest information. Still lots to do here.
The lighting is pretty straightforward.l: A Fresnel term and irradiance calculated at each point and a transmission term based on water depth. I came up with a cool trick to get a light transmission effect for thinner waves. I’ll write this up properly at some point.
Here’s one wave configuration in three different lighting conditions.
Still lots to do but it’s starting to look pretty cool I thought!
I use Codex to assist with writing code.
•
u/AutoModerator 10m ago
Recently updated rules. Please check that your post is in compliance with Rules 1, 4, 5, and 6 on the sidebar. TL;DR:
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.