SlideShare une entreprise Scribd logo
1  sur  37
Ray Marching Explained
Mårten Rånge
www.shadertoy.com
https://www.shadertoy.com/view/ldyGWm
GLSL
+
Basic linear algebra
r
d
p
𝑑 = 𝑝 − 𝑟
Show us the code
Lighting
𝑛𝑜𝑟𝑚𝑎𝑙
𝑛𝑜𝑟𝑚𝑎𝑙
10 51520
𝑛: 𝑛𝑜𝑟𝑚𝑎𝑙𝑖𝑧𝑒(𝑑 𝑝 + 𝑒𝑥 − 𝑑 𝑝 − 𝑒𝑥 , 𝑑 𝑝 + 𝑒𝑦 − 𝑑 𝑝 − 𝑒𝑦 , 𝑑 𝑝 + 𝑒𝑧 − 𝑑 𝑝 − 𝑒𝑧 )
𝑒𝑧: (0, 0, 𝑒𝑝𝑠𝑖𝑙𝑜𝑛)
𝑒𝑦: (0, 𝑒𝑝𝑠𝑖𝑙𝑜𝑛, 0)
𝑒𝑥: (𝑒𝑝𝑠𝑖𝑙𝑜𝑛, 0, 0)
𝑝: 𝑝𝑜𝑖𝑛𝑡𝑂𝑛𝑆𝑢𝑟𝑓𝑎𝑐𝑒
𝑑: 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒𝑇𝑜𝑆𝑢𝑟𝑓𝑎𝑐𝑒
𝑑𝑖𝑓𝑓𝑢𝑠𝑒
a
𝑑𝑖𝑓𝑓𝑢𝑠𝑒: 𝑚𝑎𝑥(𝑑𝑜𝑡 𝑛𝑜𝑟𝑚𝑎𝑙, 𝑙𝑖𝑔ℎ𝑡𝐷𝑖𝑟𝑒𝑐𝑡𝑖𝑜𝑛 , 0)
𝑠𝑝𝑒𝑐𝑢𝑙𝑎𝑟
a
a
b
𝑠𝑝𝑒𝑐𝑢𝑙𝑎𝑟: 𝑚𝑎𝑥 𝑑𝑜𝑡 𝑟𝑒𝑓𝑙𝑒𝑐𝑡 𝑙𝑖𝑔ℎ𝑡𝐷𝑖𝑟𝑒𝑐𝑡𝑖𝑜𝑛, 𝑛𝑜𝑟𝑚𝑎𝑙 , 𝑒𝑦𝑒𝐷𝑖𝑟𝑒𝑐𝑡𝑖𝑜𝑛 , 0 𝑓𝑜𝑐𝑢𝑠
Show us the code
Creating complex
geometries
𝑢𝑛𝑖𝑜𝑛: 𝑚𝑖𝑛(𝑑1, 𝑑2)
𝑖𝑛𝑡𝑒𝑟𝑠𝑒𝑐𝑡𝑖𝑜𝑛: 𝑚𝑎𝑥(𝑑1, 𝑑2)
𝑠𝑢𝑏𝑡𝑟𝑎𝑐𝑡𝑖𝑜𝑛: 𝑚𝑎𝑥(𝑑1, −𝑑2)
𝑏𝑜𝑜𝑙𝑒𝑎𝑛 𝑜𝑝𝑒𝑟𝑎𝑡𝑜𝑟𝑠
𝑠𝑐𝑎𝑙𝑒: 𝑑(𝑝 ∗ 𝑠)/𝑠
𝑟𝑒𝑝𝑒𝑡𝑖𝑡𝑖𝑜𝑛: 𝑑(𝑚𝑜𝑑 𝑝, 𝑟 − 0.5𝑟)
𝑡𝑟𝑎𝑛𝑠𝑙𝑎𝑡𝑖𝑜𝑛: 𝑑(𝑝 − 𝑡)
𝑑𝑜𝑚𝑎𝑖𝑛 𝑜𝑝𝑒𝑟𝑎𝑡𝑜𝑟𝑠
Show us the code
Shadows
𝑠𝑜𝑓𝑡 𝑠ℎ𝑎𝑑𝑜𝑤𝑠
𝑎𝑚𝑏𝑖𝑒𝑛𝑡 𝑜𝑐𝑐𝑙𝑢𝑠𝑖𝑜𝑛
Show us the code
All together now
Cool shadertoy examples
• Graphics + Music
• https://www.shadertoy.com/view/4tc3zf
• 460 lines!
• https://www.shadertoy.com/view/4sjSW1
• https://www.shadertoy.com/view/XlBGz3
• Retro!
• Mandel bulb
• https://www.shadertoy.com/view/ltfSWn
• Advanced modeling
• https://www.shadertoy.com/view/ld3Gz2
• Terrains
• https://www.shadertoy.com/view/MdlGW7
• https://www.shadertoy.com/view/4ttSWf
• https://www.shadertoy.com/view/XslGRr
Links
• Raymarching explanined
• http://9bitscience.blogspot.com/2013/07/raymarching-distance-fields_14.html
• Links other useful resources as well
• Advanced operators
• http://mercury.sexy/hg_sdf/
• NNUG Demos
• https://www.shadertoy.com/view/4t3cDl
• https://www.shadertoy.com/view/Xl3cDl
• https://www.shadertoy.com/view/Xl3cDs
• https://www.shadertoy.com/view/MtcyWl
• https://www.shadertoy.com/view/ltccD2
Questions?

Contenu connexe

Similaire à Ray Marching Explained

Reed solomon Encoder and Decoder
Reed solomon Encoder and DecoderReed solomon Encoder and Decoder
Reed solomon Encoder and DecoderAmeer H Ali
 
Overlap Layout Consensus assembly
Overlap Layout Consensus assemblyOverlap Layout Consensus assembly
Overlap Layout Consensus assemblyZhuyi Xue
 
Sbe final exam jan17 - solved-converted
Sbe final exam jan17 - solved-convertedSbe final exam jan17 - solved-converted
Sbe final exam jan17 - solved-convertedcairo university
 
DISCRETE LOGARITHM PROBLEM
DISCRETE LOGARITHM PROBLEMDISCRETE LOGARITHM PROBLEM
DISCRETE LOGARITHM PROBLEMMANISH KUMAR
 
Introduction to PyTorch
Introduction to PyTorchIntroduction to PyTorch
Introduction to PyTorchJun Young Park
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve CryptographyJorgeVillamarin5
 
Solucion de ejercicios de Analisis estructural I
Solucion de ejercicios de Analisis estructural ISolucion de ejercicios de Analisis estructural I
Solucion de ejercicios de Analisis estructural IHardz Roa
 
Semana 11 numeros complejos ii álgebra-uni ccesa007
Semana 11   numeros complejos ii   álgebra-uni ccesa007Semana 11   numeros complejos ii   álgebra-uni ccesa007
Semana 11 numeros complejos ii álgebra-uni ccesa007Demetrio Ccesa Rayme
 

Similaire à Ray Marching Explained (11)

Reed solomon Encoder and Decoder
Reed solomon Encoder and DecoderReed solomon Encoder and Decoder
Reed solomon Encoder and Decoder
 
Overlap Layout Consensus assembly
Overlap Layout Consensus assemblyOverlap Layout Consensus assembly
Overlap Layout Consensus assembly
 
Linkedin_PowerPoint
Linkedin_PowerPointLinkedin_PowerPoint
Linkedin_PowerPoint
 
No more dumb hex!
No more dumb hex!No more dumb hex!
No more dumb hex!
 
Sbe final exam jan17 - solved-converted
Sbe final exam jan17 - solved-convertedSbe final exam jan17 - solved-converted
Sbe final exam jan17 - solved-converted
 
DISCRETE LOGARITHM PROBLEM
DISCRETE LOGARITHM PROBLEMDISCRETE LOGARITHM PROBLEM
DISCRETE LOGARITHM PROBLEM
 
Introduction to PyTorch
Introduction to PyTorchIntroduction to PyTorch
Introduction to PyTorch
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve Cryptography
 
Solucion de ejercicios de Analisis estructural I
Solucion de ejercicios de Analisis estructural ISolucion de ejercicios de Analisis estructural I
Solucion de ejercicios de Analisis estructural I
 
Reinforcement learning
Reinforcement learningReinforcement learning
Reinforcement learning
 
Semana 11 numeros complejos ii álgebra-uni ccesa007
Semana 11   numeros complejos ii   álgebra-uni ccesa007Semana 11   numeros complejos ii   álgebra-uni ccesa007
Semana 11 numeros complejos ii álgebra-uni ccesa007
 

Plus de Mårten Rånge

Know your FOSS obligations
Know your FOSS obligationsKnow your FOSS obligations
Know your FOSS obligationsMårten Rånge
 
Better performance through Superscalarity
Better performance through SuperscalarityBetter performance through Superscalarity
Better performance through SuperscalarityMårten Rånge
 
Monad - a functional design pattern
Monad - a functional design patternMonad - a functional design pattern
Monad - a functional design patternMårten Rånge
 
Pragmatic metaprogramming
Pragmatic metaprogrammingPragmatic metaprogramming
Pragmatic metaprogrammingMårten Rånge
 
Concurrency - responsiveness in .NET
Concurrency - responsiveness in .NETConcurrency - responsiveness in .NET
Concurrency - responsiveness in .NETMårten Rånge
 
Concurrency scalability
Concurrency scalabilityConcurrency scalability
Concurrency scalabilityMårten Rånge
 

Plus de Mårten Rånge (10)

Know your FOSS obligations
Know your FOSS obligationsKnow your FOSS obligations
Know your FOSS obligations
 
Better performance through Superscalarity
Better performance through SuperscalarityBetter performance through Superscalarity
Better performance through Superscalarity
 
Property Based Tesing
Property Based TesingProperty Based Tesing
Property Based Tesing
 
Monad - a functional design pattern
Monad - a functional design patternMonad - a functional design pattern
Monad - a functional design pattern
 
Formlets
FormletsFormlets
Formlets
 
Pragmatic metaprogramming
Pragmatic metaprogrammingPragmatic metaprogramming
Pragmatic metaprogramming
 
Concurrency - responsiveness in .NET
Concurrency - responsiveness in .NETConcurrency - responsiveness in .NET
Concurrency - responsiveness in .NET
 
Meta Programming
Meta ProgrammingMeta Programming
Meta Programming
 
Concurrency scalability
Concurrency scalabilityConcurrency scalability
Concurrency scalability
 
Concurrency
ConcurrencyConcurrency
Concurrency
 

Dernier

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 WorkerThousandEyes
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
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...apidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
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 TerraformAndrey Devyatkin
 
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 Processorsdebabhi2
 
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 FresherRemote DBA Services
 
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 WorkerThousandEyes
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Dernier (20)

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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
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
 
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
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Ray Marching Explained