310 likes | 415 Views
Effective GPU-based synthesis and editing of realistic heightfields. Thesis Presentation Giliam J.P. de Carpentier July 11, 2008. giliam@decarpentier.nl. Computer Graphics and CAD/CAM Group Faculty of Electrical Engineering, Mathematics and Computer Science
E N D
Effective GPU-based synthesis and editing of realistic heightfields Thesis Presentation Giliam J.P. de Carpentier July 11, 2008 giliam@decarpentier.nl Computer Graphics and CAD/CAM Group Faculty of Electrical Engineering, Mathematics and Computer Science Delft University of Technology W!Games Amsterdam info@wgames.biz Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Outline • Introduction • Analysis • Approach • Procedural brushes • Editing on the GPU • Terrain rendering • Demo • Conclusions Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Analysis Both hardware capabilities and gamer’s expectations are constantly growing: • Higher fidelity graphics • More immersive environments and experiences Production requires either: • Larger teams and budgets • More effective tools and more automatization Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Analysis Game content creation: • Indoor environments: • Buildings • Artifacts • Outdoor environments: • Terrain • Vegetation • Actors • … Game content creation: • Indoor environments: • Buildings • Artifacts • Outdoor environments: • Terrain (Heightfields) • Vegetation • Actors • … Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Analysis Heightfield terrain: • 2D specification • 3D geometry • Simple but fast & compact • Importable/exportable as image Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Analysis Three creation categories: • Local brushing • Procedural synthesis • Erosion simulation Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Analysis Three creation categories: • Local brushing • Procedural synthesis • Erosion simulation Applications: • Game editors(e.g. UnrealEd, Sandbox) Pros: • User controllable • Interactive Cons: • Lack of realism Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Analysis Three creation categories: • Local brushing • Procedural synthesis • Erosion simulation Applications: • Terrain generators(e.g. Terragen, World Machine) Pros: • Complex results • Easy to set up Cons: • Lack of local control • Slow Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Analysis Three creation categories: • Local brushing • Procedural synthesis • Erosion simulation Applications: • Terrain generators(e.g. Terragen, World Machine) Pros: • Realistic • Apply to any terrain Cons: • Lack of local control • Very slow Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Analysis Central question: “What are the main bottlenecks in terrain design for current computer gaming applications and how can these bottlenecks be alleviated?” More specifically: • How to improve designers’ workflow? • Which tools and techniques could be provided? • How to reconcile speed and complexity? • How to accomplish this on modern PCs? Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Analysis We need: • Control • Feedback • Realism • Efficiency Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Analysis We’ve got: Control Feedback Realism Efficiency - How do you place or move a realistic mountain in a virtual world? Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Approach Recommended improvements: • Procedural brushes: • Feedback and control of brushes • Realism of procedural techniques • Other suggestions: • Layers and blending • Multi undo Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Approach • Current brushes are simple and procedural techniques are slow for a reason... • Exploit parallelism in current PCs • Multi-core CPUs • Graphics card GPUs Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Approach Implemented testbed for the evaluation of techniques: • Stand-alone editor application • Import/export • Terrain edit system • Procedural brushes • Terrain render system Implemented testbed for the evaluation of techniques: • Stand-alone editor application • Import/export • Terrain edit system • Procedural brushes • Terrain render system Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Procedural brushes Procedural brushes: • Executes procedural algorithm • Limits effect to ‘brushed’ area Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Procedural brushes Procedural algorithms: • Many different algorithms • Deterministic function • Not based on physical models • Designed to visually approximate features • Typically some sort of noisy signal Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Procedural brushes Low Mid Low Mid High + Sum High + + Sum Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Procedural brushes Weights of individual noise signals influence roughness Less “High” More “High” Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Procedural brushes Improving procedural realism: • Output transform • Input transform • Quilez noise • Erosive noise • Directional noise Improving procedural realism: • Output transform • Input transform • Quilez noise • Erosive noise • Directional noise Improving procedural realism: • Output transform • Input transform • Quilez noise • Erosive noise • Directional noise Improving procedural realism: • Output transform • Input transform • Quilez noise • Erosive noise • Directional noise Improving procedural realism: • Output transform • Input transform • Quilez noise • Erosive noise • Directional noise Improving procedural realism: • Output transform • Input transform • Quilez noise • Erosive noise • Directional noise Dynamic octave weights Transform( Proc( x ) ) Proc( Perturb( x ) ) Proc( x ) Proc( x ) Gradient-based input transform Stretched perpendicular to brush direction Stretched at 45˚ rel. to brush direction Stretched along brush direction Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Brushing: Convert mouse stroke to positions on heightfield Create spline from stroke path Create instance locations from spline Apply individual instances Procedural brushes Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Procedural brushes + X Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Editing on the GPU • GPU hardware, standards and interfaces designed for 3D rendering • All other algorithms must be mapped to rendering operations Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Editing on the GPU Mapping heightfield concepts: • Height as color • Heightfields as textures • Split into multiple ‘pages’ • Editing and synthesis algorithms as different pixel shaders Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Editing on the GPU Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Editing on the GPU GPU optimizations: • Don’t update identical sections of RTT output texture • Combine calculations for multiple brush instances in pixel shader • Only apply to affected pages • Divide in affected/unaffected sections • Apply complex procedural pixel shader only to affected sections • Apply ‘copy’ pixel shader tounaffected sections • Neighbor lookups: Split sections into different border cases • Prevent dynamic conditional branching: Use differently compiled pixel shaders Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Terrain rendering Geometry: • Density of triangulation should dependent on distance • Retriangulate on camera move • Need balance between updates and triangle overhead • Solution: Triangulate per ‘tile’ Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Terrain rendering Texturing: • Give each triangle colored detail • Terrain editor concerned with modeling, not withtexturing • Automate texturing with procedural techniques • Dependent on height,slope and randomness Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Demo Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Conclusions • Iterative design requires control, feedback and realism • Developed procedural brushes offer this • Exploring GPU parallelism achieves required fast processing • Proposed novel procedural techniques further improve realism Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier
Future work • Integrate the stand-alone editor with specific game editor • Develop more common and novel brushes and tools • Develop man-made terrain feature tools Effective GPU-based synthesis and editing of realistic heightfields Giliam J.P. de Carpentier