SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
Building Worlds

Filipe Varela	


filipe.varela@co.sapo.pt
Overview
•
•
•
•
•

Topographic Datasets	

Geometry partitioning	

Tesselating meshes	

Level of Detail (LOD)	

Data structures for
geometry

•
•

Projections	


•
•
•

Lighting	


Efficient Out of Core
fetches	


Shaders	

Procedural detail
Basics - drawing path
Topography

Normals

Bathymetry

Shaders

Textures
Topography

Shuttle Radar
Topography Mission
(SRTM)
Blue Marble	

Next Generation
(BMNG)
SRTM
Resolution: 90m/pixel	

Coverage: 60ºS to 60ºN Lat, 360º Long	

Samples: 144000x432000, 16 bit	

~115 GiB	

Much higher resolutions available for limited areas
Others
Mars: MOLA + Viking	

Moon: LOLA + Clementine	

Mercury: Messenger + Mariner	

Venus: Magellan + Venera	

A couple more...
Back to Basics
432000x144000 samples (not counting poles)	

16bit/sample topography+bathy	

24bit/sample textures (+ 173GB)	

24bit/sample normals (+ 173GB)	

Add specular byte to topo+bathy	

Totals 3x173 GB = 519 GB @ 90m/sample
Preparing the Data

What exactly do you need to achieve?	

How much effort are you willing to put in?
Terrain Rendering 101
•
•

Data is but height samples - Mesh tesselation	

Too much data to draw everything every frame Level of Detail
Common Methods
•
•
•
•

Realtime Optimally Adapting Meshes	

Geomipmapping	

Chunked Level of Detail (LOD)	

Geometry Clipmaps
Chunked LOD
Tesselating Meshes
Several options - I picked triangle strips
LOD - Level of Detail
Split each chunk into 4 when LOD increases	

Chunk side vertex count must be 2^n
LOD - Level of Detail
Connect patches by copying:	

left of right to right of left	

new count is (2^n)+1
LOD - Tricks
Optimize patch side vertex count for
performance	

You want few GPU ops with a lot of data	

You don’t want the GPU to ‘swap’ from
VRAM to RAM
Meet the Quadtree
Quadtree Basics
•
•

vertex buffer object	


•
•
•
•

index [1-4]	


exactly 4 children per node (1-NE, 2-NW, 3-SE, 4SW)	

last drawn timestamp	

vertex buffers for geometry, textures, normals	

Search: O(n), n = LOD level (follow pointers)
Cylindrical #FAIL
Linear sample density	

Non linear perimeter
6 Gnomonic Projections

Wolfram is your friend	

http://mathworld.wolfram.com/GnomonicProjection.html
Cube to Sphere
Normalize each vertex	

Add altitude

v = normalize(v) * (planet radius + altitude)
So Far
• Dealt with LOD, splitting	

• Found a suitable projection system	

• Triangulated the terrain meshes	

• Each patch of terrain - Vertex Buffer Object
Redundancy
• Several representations of the same data	

• Increased dataset size, up to 2x	

• No way around for textures	

• EP + 1 for everything else
EP + 1
EP + 1 Storage
• Reprocess the entire dataset	

• Write all samples as chunks	

• Arrange by LOD levels	

• Don’t write duplicate samples	

• Reading a chunk is now fseek+fread
Eye Candy 1 - Lighting

• Normals are crucial	

• Light intensity directly proportional to LoN
Calculating Normals
• Use a single chunk of vertexes	

• Rotate and scale accordingly	

• Attach heightmap as texture	

• Morph (planet radius + texture height)	

• Sample neighboring heights for normal
Normal Map
Heights stored in 16bit: Red+Green channels

Non spherical coordinate system
Planetary Normals
Get rotation from unit vector to the vertex position

Apply same rotation to normal vector
Water Specular	


•
•

Extract watermask from BMNG	

Single bit, store in blue component of heightmap (24 bit total)
Eye Candy 2 - Atmosphere
• Two types of scattering, Mie & Rayleigh	

• Small molecules, O2, O3, etc - Rayleigh	

• Aerosols - Mie (gray when it rains, pollution
haze, etc)
Atmospheric Shader
Phase function - Amount of scattering for camera angle

Outscattering - Optical depth of ray from entry point to camera

Inscattering - Amount of light added by scattering on planet surface
into camera
Atmospheric Shader
Atmospheric Shader
Atmospheric Shader
Fractal Noise
Adding in missing detail
Fractal Noise
Adding in missing detail

Height = dataset height + noise heightmap
Fun!
• Add gravity, each object is a node, it’s easy	

• Export from SketchUp to .obj, auto
triangulate + auto normals	


• Write a script to convert .obj into a vertex
buffer object	


• Drop in a dead simple shader
Just for Fun
Final Results
Thanks!

Mais conteúdo relacionado

Mais procurados

636908main paul presentation
636908main paul presentation636908main paul presentation
636908main paul presentation
Clifford Stone
 

Mais procurados (20)

GoogleSky Status at Google
GoogleSky Status at GoogleGoogleSky Status at Google
GoogleSky Status at Google
 
MIRU2016 invited talk - Recovering Transparent Shape from Time-of-Flight Dist...
MIRU2016 invited talk - Recovering Transparent Shape from Time-of-Flight Dist...MIRU2016 invited talk - Recovering Transparent Shape from Time-of-Flight Dist...
MIRU2016 invited talk - Recovering Transparent Shape from Time-of-Flight Dist...
 
429Talk
429Talk429Talk
429Talk
 
Physically Based and Unified Volumetric Rendering in Frostbite
Physically Based and Unified Volumetric Rendering in FrostbitePhysically Based and Unified Volumetric Rendering in Frostbite
Physically Based and Unified Volumetric Rendering in Frostbite
 
An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...
An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...
An introduction to Realistic Ocean Rendering through FFT - Fabio Suriano - Co...
 
Lighting the City of Glass
Lighting the City of GlassLighting the City of Glass
Lighting the City of Glass
 
A new Post-Processing Pipeline
A new Post-Processing PipelineA new Post-Processing Pipeline
A new Post-Processing Pipeline
 
Open source adobe lightroom like
Open source adobe lightroom likeOpen source adobe lightroom like
Open source adobe lightroom like
 
Shiny Pixels and Beyond: Real-Time Raytracing at SEED
Shiny Pixels and Beyond: Real-Time Raytracing at SEEDShiny Pixels and Beyond: Real-Time Raytracing at SEED
Shiny Pixels and Beyond: Real-Time Raytracing at SEED
 
Paris Master Class 2011 - 02 Screen Space Material System
Paris Master Class 2011 - 02 Screen Space Material SystemParis Master Class 2011 - 02 Screen Space Material System
Paris Master Class 2011 - 02 Screen Space Material System
 
Wave-Based Non-Line-of-Sight Imaging Using Fast f–k Migration | SIGGRAPH 2019
Wave-Based Non-Line-of-Sight Imaging Using Fast f–k Migration | SIGGRAPH 2019Wave-Based Non-Line-of-Sight Imaging Using Fast f–k Migration | SIGGRAPH 2019
Wave-Based Non-Line-of-Sight Imaging Using Fast f–k Migration | SIGGRAPH 2019
 
DD18 - SEED - Raytracing in Hybrid Real-Time Rendering
DD18 - SEED - Raytracing in Hybrid Real-Time RenderingDD18 - SEED - Raytracing in Hybrid Real-Time Rendering
DD18 - SEED - Raytracing in Hybrid Real-Time Rendering
 
An Overview of Gravitational Lensing
An Overview of Gravitational LensingAn Overview of Gravitational Lensing
An Overview of Gravitational Lensing
 
Signal proccessing(wavelet) on radio telescopic images
Signal proccessing(wavelet) on radio telescopic imagesSignal proccessing(wavelet) on radio telescopic images
Signal proccessing(wavelet) on radio telescopic images
 
636908main paul presentation
636908main paul presentation636908main paul presentation
636908main paul presentation
 
Fourier Domain Optical Coherence Tomography (FD-OCT)
Fourier Domain Optical Coherence Tomography (FD-OCT)Fourier Domain Optical Coherence Tomography (FD-OCT)
Fourier Domain Optical Coherence Tomography (FD-OCT)
 
Non-essentiality of Correlation between Image and Depth Map in Free Viewpoin...
Non-essentiality of Correlation between Image and Depth Map in Free Viewpoin...Non-essentiality of Correlation between Image and Depth Map in Free Viewpoin...
Non-essentiality of Correlation between Image and Depth Map in Free Viewpoin...
 
Rs
RsRs
Rs
 
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal FilteringStable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
 
Speech enhancement for distant talking speech recognition
Speech enhancement for distant talking speech recognitionSpeech enhancement for distant talking speech recognition
Speech enhancement for distant talking speech recognition
 

Semelhante a Building Worlds - Codebits

Fast Sparse 2-D DFT Computation using Sparse-Graph Alias Codes
Fast Sparse 2-D DFT Computation using Sparse-Graph Alias CodesFast Sparse 2-D DFT Computation using Sparse-Graph Alias Codes
Fast Sparse 2-D DFT Computation using Sparse-Graph Alias Codes
Frank Ong
 
ground penetration rader
ground  penetration raderground  penetration rader
ground penetration rader
Amir Khan
 
Magellan-Spark as a Geospatial Analytics Engine by Ram Sriharsha
Magellan-Spark as a Geospatial Analytics Engine by Ram SriharshaMagellan-Spark as a Geospatial Analytics Engine by Ram Sriharsha
Magellan-Spark as a Geospatial Analytics Engine by Ram Sriharsha
Spark Summit
 

Semelhante a Building Worlds - Codebits (20)

Terrain in Battlefield 3: A Modern, Complete and Scalable System
Terrain in Battlefield 3: A Modern, Complete and Scalable SystemTerrain in Battlefield 3: A Modern, Complete and Scalable System
Terrain in Battlefield 3: A Modern, Complete and Scalable System
 
Felwyrld Tech
Felwyrld TechFelwyrld Tech
Felwyrld Tech
 
e-SOTER Regional pilot platform as EU contribution to a Global Soil Observing...
e-SOTER Regional pilot platform as EU contribution to a Global Soil Observing...e-SOTER Regional pilot platform as EU contribution to a Global Soil Observing...
e-SOTER Regional pilot platform as EU contribution to a Global Soil Observing...
 
LiDAR_Project
LiDAR_ProjectLiDAR_Project
LiDAR_Project
 
The Matsu Project - Open Source Software for Processing Satellite Imagery Data
The Matsu Project - Open Source Software for Processing Satellite Imagery DataThe Matsu Project - Open Source Software for Processing Satellite Imagery Data
The Matsu Project - Open Source Software for Processing Satellite Imagery Data
 
Color and 3D Semantic Reconstruction of Indoor Scenes from RGB-D stream
Color and 3D Semantic Reconstruction of Indoor Scenes from RGB-D streamColor and 3D Semantic Reconstruction of Indoor Scenes from RGB-D stream
Color and 3D Semantic Reconstruction of Indoor Scenes from RGB-D stream
 
Fast Sparse 2-D DFT Computation using Sparse-Graph Alias Codes
Fast Sparse 2-D DFT Computation using Sparse-Graph Alias CodesFast Sparse 2-D DFT Computation using Sparse-Graph Alias Codes
Fast Sparse 2-D DFT Computation using Sparse-Graph Alias Codes
 
ODSC India 2018: Topological space creation & Clustering at BigData scale
ODSC India 2018: Topological space creation & Clustering at BigData scaleODSC India 2018: Topological space creation & Clustering at BigData scale
ODSC India 2018: Topological space creation & Clustering at BigData scale
 
Development of a soil carbon map for the United Republic of Tanzania
Development of a soil carbon map for the United Republic of TanzaniaDevelopment of a soil carbon map for the United Republic of Tanzania
Development of a soil carbon map for the United Republic of Tanzania
 
Sparksummitny2016
Sparksummitny2016Sparksummitny2016
Sparksummitny2016
 
ground penetration rader
ground  penetration raderground  penetration rader
ground penetration rader
 
Photogrammetry and Star Wars Battlefront
Photogrammetry and Star Wars BattlefrontPhotogrammetry and Star Wars Battlefront
Photogrammetry and Star Wars Battlefront
 
Seeing the unseen: Improving aerial prospection outside the visible spectrum
Seeing the unseen: Improving aerial prospection outside the visible spectrumSeeing the unseen: Improving aerial prospection outside the visible spectrum
Seeing the unseen: Improving aerial prospection outside the visible spectrum
 
Seeing the Unseen- Improving aerial archaeological prospection
Seeing the Unseen- Improving aerial archaeological prospectionSeeing the Unseen- Improving aerial archaeological prospection
Seeing the Unseen- Improving aerial archaeological prospection
 
Paris Master Class 2011 - 07 Dynamic Global Illumination
Paris Master Class 2011 - 07 Dynamic Global IlluminationParis Master Class 2011 - 07 Dynamic Global Illumination
Paris Master Class 2011 - 07 Dynamic Global Illumination
 
Fassold-MMAsia2023-Tutorial-GeometricDL-Part1.pptx
Fassold-MMAsia2023-Tutorial-GeometricDL-Part1.pptxFassold-MMAsia2023-Tutorial-GeometricDL-Part1.pptx
Fassold-MMAsia2023-Tutorial-GeometricDL-Part1.pptx
 
Real-time lightmap baking
Real-time lightmap bakingReal-time lightmap baking
Real-time lightmap baking
 
DSD-INT 2018 Realtime classification of lidar pointclouds - Pronk
DSD-INT 2018 Realtime classification of lidar pointclouds - PronkDSD-INT 2018 Realtime classification of lidar pointclouds - Pronk
DSD-INT 2018 Realtime classification of lidar pointclouds - Pronk
 
Magellan-Spark as a Geospatial Analytics Engine by Ram Sriharsha
Magellan-Spark as a Geospatial Analytics Engine by Ram SriharshaMagellan-Spark as a Geospatial Analytics Engine by Ram Sriharsha
Magellan-Spark as a Geospatial Analytics Engine by Ram Sriharsha
 
Convolutional Neural Networks on Graphs with Fast Localized Spectral Filtering
Convolutional Neural Networks on Graphs with Fast Localized Spectral FilteringConvolutional Neural Networks on Graphs with Fast Localized Spectral Filtering
Convolutional Neural Networks on Graphs with Fast Localized Spectral Filtering
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

Building Worlds - Codebits