gpu water simulation - nvidia · render water surface use simulation results via vs3.0 vertex...
TRANSCRIPT
![Page 1: GPU Water Simulation - Nvidia · Render water surface Use simulation results via VS3.0 vertex texture fetch ... Performance analysis tools Content creation tools Hundreds of effects](https://reader030.vdocument.in/reader030/viewer/2022041009/5eb54d63dca92c2ec1426d79/html5/thumbnails/1.jpg)
GPU Water SimulationGPU Water SimulationJeremy Zelsnack
![Page 2: GPU Water Simulation - Nvidia · Render water surface Use simulation results via VS3.0 vertex texture fetch ... Performance analysis tools Content creation tools Hundreds of effects](https://reader030.vdocument.in/reader030/viewer/2022041009/5eb54d63dca92c2ec1426d79/html5/thumbnails/2.jpg)
Demo
![Page 3: GPU Water Simulation - Nvidia · Render water surface Use simulation results via VS3.0 vertex texture fetch ... Performance analysis tools Content creation tools Hundreds of effects](https://reader030.vdocument.in/reader030/viewer/2022041009/5eb54d63dca92c2ec1426d79/html5/thumbnails/3.jpg)
Algorithm Overview
Perform water simulation in pixel shaderRender to texture (D3DFMT_A16B16G16R16F)
Render refraction and reflection mapsRender water surface
Use simulation results via VS3.0 vertex texture fetchCompute perturbed texture coordinatesCombine refraction and reflection using Fresnel term
![Page 4: GPU Water Simulation - Nvidia · Render water surface Use simulation results via VS3.0 vertex texture fetch ... Performance analysis tools Content creation tools Hundreds of effects](https://reader030.vdocument.in/reader030/viewer/2022041009/5eb54d63dca92c2ec1426d79/html5/thumbnails/4.jpg)
Simulation
Solve 2D wave equationVerlet Integration
Good stabilityUses previous 2 resultsNo velocity stored
Influence simulationDampening maps
Control simulationRender alpha-blended geometry into simulation
)( 2
2
2
22
2
2
zy
xyc
ty
∂∂
+∂∂
=∂∂
0,04
,2
2
2
2
*4)( yyzy
xy
neighborsji −
≈
∂∂
+∂∂ ∑
−
![Page 5: GPU Water Simulation - Nvidia · Render water surface Use simulation results via VS3.0 vertex texture fetch ... Performance analysis tools Content creation tools Hundreds of effects](https://reader030.vdocument.in/reader030/viewer/2022041009/5eb54d63dca92c2ec1426d79/html5/thumbnails/5.jpg)
Vertex Texture Fetch (VS3.0)
Vertex shader reads simulation result with vertex texture fetch
Simulation Texture Height Map
![Page 6: GPU Water Simulation - Nvidia · Render water surface Use simulation results via VS3.0 vertex texture fetch ... Performance analysis tools Content creation tools Hundreds of effects](https://reader030.vdocument.in/reader030/viewer/2022041009/5eb54d63dca92c2ec1426d79/html5/thumbnails/6.jpg)
Refraction Map
Render scene from camera viewpoint
If camera is above waterRender underwater geometry
If camera is underwaterRender above water geometry
![Page 7: GPU Water Simulation - Nvidia · Render water surface Use simulation results via VS3.0 vertex texture fetch ... Performance analysis tools Content creation tools Hundreds of effects](https://reader030.vdocument.in/reader030/viewer/2022041009/5eb54d63dca92c2ec1426d79/html5/thumbnails/7.jpg)
Reflection Map
Render scene from reflected camera viewpoint
Reflect view transform about water plane
If camera is underwaterRender underwater geometry
If camera is above waterRender above water geometry
![Page 8: GPU Water Simulation - Nvidia · Render water surface Use simulation results via VS3.0 vertex texture fetch ... Performance analysis tools Content creation tools Hundreds of effects](https://reader030.vdocument.in/reader030/viewer/2022041009/5eb54d63dca92c2ec1426d79/html5/thumbnails/8.jpg)
Perturbed Texture Coordinates
Start at water positionMove along refraction or reflection vectorProject into screen space
![Page 9: GPU Water Simulation - Nvidia · Render water surface Use simulation results via VS3.0 vertex texture fetch ... Performance analysis tools Content creation tools Hundreds of effects](https://reader030.vdocument.in/reader030/viewer/2022041009/5eb54d63dca92c2ec1426d79/html5/thumbnails/9.jpg)
Fresnel Reflection Term
Determines amount of reflection / refractionRoughly pow((1 - dot(eye, normal)), p)
Fresnel term = 0 => all refractionFresnel term = 1 => all reflection
![Page 10: GPU Water Simulation - Nvidia · Render water surface Use simulation results via VS3.0 vertex texture fetch ... Performance analysis tools Content creation tools Hundreds of effects](https://reader030.vdocument.in/reader030/viewer/2022041009/5eb54d63dca92c2ec1426d79/html5/thumbnails/10.jpg)
Demo
![Page 12: GPU Water Simulation - Nvidia · Render water surface Use simulation results via VS3.0 vertex texture fetch ... Performance analysis tools Content creation tools Hundreds of effects](https://reader030.vdocument.in/reader030/viewer/2022041009/5eb54d63dca92c2ec1426d79/html5/thumbnails/12.jpg)
developer.nvidia.comdeveloper.nvidia.comThe Source for GPU Programming
Latest documentationSDKsCutting-edge tools
Performance analysis toolsContent creation tools
Hundreds of effectsVideo presentations and tutorialsLibraries and utilitiesNews and newsletter archives
EverQuest® content courtesy Sony Online Entertainment Inc.
![Page 13: GPU Water Simulation - Nvidia · Render water surface Use simulation results via VS3.0 vertex texture fetch ... Performance analysis tools Content creation tools Hundreds of effects](https://reader030.vdocument.in/reader030/viewer/2022041009/5eb54d63dca92c2ec1426d79/html5/thumbnails/13.jpg)
GPU Gems: Programming Techniques, GPU Gems: Programming Techniques, Tips, and Tricks for RealTips, and Tricks for Real--Time GraphicsTime Graphics
Practical real-time graphics techniques from experts at leading corporations and universities
Great value:Contributions from industry expertsFull color (300+ diagrams and screenshots)Hard cover816 pagesAvailable at GDC 2004
“GPU Gems is a cool toolbox of advanced graphics techniques. Novice programmers and graphics gurus alike will find the gems practical, intriguing, and useful.”Tim SweeneyLead programmer of Unreal at Epic Games
“This collection of articles is particularly impressive for its depth and breadth. The book includes product-oriented case studies, previously unpublished state-of-the-art research, comprehensive tutorials, and extensive code samples and demos throughout.”Eric HainesAuthor of Real-Time Rendering
For more, visit:For more, visit:http://developer.nvidia.com/http://developer.nvidia.com/GPUGemsGPUGems