SlideShare a Scribd company logo
1 of 36
Interactive Refractions and Caustics  Using Image-Space Techniques Shader Study  (http://cafe.naver.com/shader.cafe) Codevania  (http://codevania.blogspot.com)
Reflection… Refraction… Caustic…
 
Goal is…
Table of Contents ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Approximate, Image-Space Refraction ,[object Object],[object Object],-_-!? ^-^♬
Approximate, Image-Space Refraction ,[object Object],[object Object],[object Object],[object Object]
Approximate, Image-Space Refraction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Approximate, Image-Space Refraction ,[object Object],[object Object],[object Object],[object Object]
Refraction Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Approximate Distance d 1 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Approximating Surface Normal N 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Graphical Overview of Rendering Image-Space Refraction ,[object Object]
Graphical Overview of Rendering Image-Space Refraction ,[object Object]
Graphical Overview of Rendering Image-Space Refraction ,[object Object]
Graphical Overview of Rendering Image-Space Refraction ,[object Object]
Graphical Overview of Rendering Image-Space Refraction ,[object Object],[object Object]
Fixing Problem Cases ,[object Object],[object Object],[object Object],[object Object],[object Object]
Fixing Problem Cases ,[object Object]
Fixing Problem Cases ,[object Object]
Fixing Problem Cases ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Putting it Together
Approximate, Image-Space Caustics ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Caustics Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Caustics Algorithm ,[object Object],[object Object],[object Object]
Rendering From the Light ,[object Object],[object Object],[object Object],Depth Map Final Photon Locations Standard Rendering From Light’s View Incident Photon Direction
Rendering Caustic Map Use photon data in vertex shader, render points at photon locations Light Space Eye Space
Applying the Caustic Map ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Putting it Together ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Examples and Discussion
Conclusion ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Code snippets RenderCaustics { // create the buffers needed for refraction from light (for caustics) createRefractionBuffers // create all the necessary buffers (normal, bg geom, depth, etc) from a particular POV // draw the normals for the back side createBackSideMaps // Draw just the background geometry createOtherObjectEyeTexture // draw the caustics positions & directions info to the framebuffer DrawSceneCausticsToBuffer // Draw refractive geometry from a particular POV // store positions of final hitpoints into a secondary buffer set the eye's lookat  Draw the environment map Draw the refractor Draw the non refractive objects in the scene PerformLightSpaceGather // find caustic contribution using an image-space gather using a image from the light's POV   draw photons splats using point sprites } // Now we've got our caustic map. However, simply projecting this onto the // scene means any surface will get a caustic, whether shadowed (from the refractor) or not! // By copying the depth buffer from the background image we used above, // we can sort this out to only cast caustics onto the "frontmost" surface behind the refractor
Code snippets DrawCausticsSceneWithLightSpaceGatheredPhotons { if ( needToRerenderCaustics )   RenderCaustics // create the buffers needed for refraction from the "eye's" point of view CreateRefractionBuffersForLightSpacePhotonGather  // create all the necessary buffers (normal, bg geom, depth, etc) from a particular POV // Draw just the background geometry (MacBeth, Dragon, etc)   DrawShadowedBackgroundWithLightSpaceCaustics DrawEnvironmentMap compute the shadow map matrix index into 'light-space caustic map' displayBackGroundGeometry   // draw the normals for the back side   createBackSideMaps // draw the scene, with caustics on the background geometry, refracted thru the refractor FinalDrawWithAlreadyComputedLightSpaceGather // takes the background geometry textures // (which includes one with accumulated photon contributions)   set the eye's lookat   //Draw the (background) non refractive objects in the scene   displayLargeTextureWithDepth   // Go ahead and actually draw the refractive object   glCallList }
Graphical Overview (1) Eye-space background image without refractor (2) Eye-space background surface depth map (3) Light-space background surface depth map (4) Eye-space view of refractor's backfacing surface normals (5) Eye-space view of refractor's backfacing surface depth (6) Four frame caustic map (one frame's intensity per channel) (7) Current frame's photon buffer (i.e., the photon positions) (8) Surface normal at final photon positions (light-space) (9) Light-space depth map (a.k.a. the shadow map)
References ,[object Object],[object Object],[object Object],[object Object],[object Object]
Appendix ,[object Object]

More Related Content

What's hot

Advanced Lighting Techniques Dan Baker (Meltdown 2005)
Advanced Lighting Techniques   Dan Baker (Meltdown 2005)Advanced Lighting Techniques   Dan Baker (Meltdown 2005)
Advanced Lighting Techniques Dan Baker (Meltdown 2005)mobius.cn
 
Hidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-bufferHidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-bufferRaj Sikarwar
 
Lighting and shading
Lighting and shadingLighting and shading
Lighting and shadingeshveeen
 
Volumetric Lighting for Many Lights in Lords of the Fallen
Volumetric Lighting for Many Lights in Lords of the FallenVolumetric Lighting for Many Lights in Lords of the Fallen
Volumetric Lighting for Many Lights in Lords of the FallenBenjamin Glatzel
 
CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9fungfung Chen
 
Advanced Lighting for Interactive Applications
Advanced Lighting for Interactive ApplicationsAdvanced Lighting for Interactive Applications
Advanced Lighting for Interactive Applicationsstefan_b
 
Build Your Own 3D Scanner: Conclusion
Build Your Own 3D Scanner: ConclusionBuild Your Own 3D Scanner: Conclusion
Build Your Own 3D Scanner: ConclusionDouglas Lanman
 
Shadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL HardwareShadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL HardwareMark Kilgard
 
Calibrating Lighting and Materials in Far Cry 3
Calibrating Lighting and Materials in Far Cry 3Calibrating Lighting and Materials in Far Cry 3
Calibrating Lighting and Materials in Far Cry 3stevemcauley
 
Structure and Motion - 3D Reconstruction of Cameras and Structure
Structure and Motion - 3D Reconstruction of Cameras and StructureStructure and Motion - 3D Reconstruction of Cameras and Structure
Structure and Motion - 3D Reconstruction of Cameras and StructureGiovanni Murru
 
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-PlanesBuild Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-PlanesDouglas Lanman
 
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero DawnThe Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero DawnGuerrilla
 
APPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWS
APPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWSAPPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWS
APPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWSijcga
 
study Active Refocusing Of Images And Videos
study Active Refocusing Of Images And Videosstudy Active Refocusing Of Images And Videos
study Active Refocusing Of Images And VideosChiamin Hsu
 
Real-time Shadowing Techniques: Shadow Volumes
Real-time Shadowing Techniques: Shadow VolumesReal-time Shadowing Techniques: Shadow Volumes
Real-time Shadowing Techniques: Shadow VolumesMark Kilgard
 
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)Mark Kilgard
 
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 SEEDElectronic Arts / DICE
 

What's hot (20)

Advanced Lighting Techniques Dan Baker (Meltdown 2005)
Advanced Lighting Techniques   Dan Baker (Meltdown 2005)Advanced Lighting Techniques   Dan Baker (Meltdown 2005)
Advanced Lighting Techniques Dan Baker (Meltdown 2005)
 
Hidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-bufferHidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-buffer
 
Lighting and shading
Lighting and shadingLighting and shading
Lighting and shading
 
Volumetric Lighting for Many Lights in Lords of the Fallen
Volumetric Lighting for Many Lights in Lords of the FallenVolumetric Lighting for Many Lights in Lords of the Fallen
Volumetric Lighting for Many Lights in Lords of the Fallen
 
CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9
 
Advanced Lighting for Interactive Applications
Advanced Lighting for Interactive ApplicationsAdvanced Lighting for Interactive Applications
Advanced Lighting for Interactive Applications
 
Build Your Own 3D Scanner: Conclusion
Build Your Own 3D Scanner: ConclusionBuild Your Own 3D Scanner: Conclusion
Build Your Own 3D Scanner: Conclusion
 
Shadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL HardwareShadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL Hardware
 
Lighting and shading
Lighting and shadingLighting and shading
Lighting and shading
 
Calibrating Lighting and Materials in Far Cry 3
Calibrating Lighting and Materials in Far Cry 3Calibrating Lighting and Materials in Far Cry 3
Calibrating Lighting and Materials in Far Cry 3
 
Structure and Motion - 3D Reconstruction of Cameras and Structure
Structure and Motion - 3D Reconstruction of Cameras and StructureStructure and Motion - 3D Reconstruction of Cameras and Structure
Structure and Motion - 3D Reconstruction of Cameras and Structure
 
CS 354 Lighting
CS 354 LightingCS 354 Lighting
CS 354 Lighting
 
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-PlanesBuild Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
 
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero DawnThe Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
 
APPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWS
APPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWSAPPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWS
APPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWS
 
study Active Refocusing Of Images And Videos
study Active Refocusing Of Images And Videosstudy Active Refocusing Of Images And Videos
study Active Refocusing Of Images And Videos
 
Real-time Shadowing Techniques: Shadow Volumes
Real-time Shadowing Techniques: Shadow VolumesReal-time Shadowing Techniques: Shadow Volumes
Real-time Shadowing Techniques: Shadow Volumes
 
01 ray-optics-mm
01 ray-optics-mm01 ray-optics-mm
01 ray-optics-mm
 
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
A Practical and Robust Bump-mapping Technique for Today’s GPUs (slides)
 
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
 

Viewers also liked

ARCHITECTURE HISTORY OF MALAYSIA HOUSES
ARCHITECTURE HISTORY OF MALAYSIA HOUSES ARCHITECTURE HISTORY OF MALAYSIA HOUSES
ARCHITECTURE HISTORY OF MALAYSIA HOUSES Ali Alakhram
 
Unique Space Planning concepts for Lifestyle Apartment
Unique Space Planning concepts for Lifestyle Apartment Unique Space Planning concepts for Lifestyle Apartment
Unique Space Planning concepts for Lifestyle Apartment Shashi Rekha
 
Top 10 Persuasive techniques
Top 10 Persuasive techniquesTop 10 Persuasive techniques
Top 10 Persuasive techniques16ardmanc
 
Architectural case study of Apartments
Architectural case study of ApartmentsArchitectural case study of Apartments
Architectural case study of ApartmentsTanzil Faraz
 

Viewers also liked (6)

RUMAH KUTAI
RUMAH KUTAIRUMAH KUTAI
RUMAH KUTAI
 
ARCHITECTURE HISTORY OF MALAYSIA HOUSES
ARCHITECTURE HISTORY OF MALAYSIA HOUSES ARCHITECTURE HISTORY OF MALAYSIA HOUSES
ARCHITECTURE HISTORY OF MALAYSIA HOUSES
 
Unique Space Planning concepts for Lifestyle Apartment
Unique Space Planning concepts for Lifestyle Apartment Unique Space Planning concepts for Lifestyle Apartment
Unique Space Planning concepts for Lifestyle Apartment
 
Interior space
Interior spaceInterior space
Interior space
 
Top 10 Persuasive techniques
Top 10 Persuasive techniquesTop 10 Persuasive techniques
Top 10 Persuasive techniques
 
Architectural case study of Apartments
Architectural case study of ApartmentsArchitectural case study of Apartments
Architectural case study of Apartments
 

Similar to Interactive Refractions And Caustics Using Image Space Techniques

Shadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive ApplicationsShadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive Applicationsstefan_b
 
Computer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and MotionComputer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and MotionDamian T. Gordon
 
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 IlluminationWolfgang Engel
 
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdfPapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdfAdam Hill
 
Soft Shadow Maps for Linear Lights
Soft Shadow Maps for Linear LightsSoft Shadow Maps for Linear Lights
Soft Shadow Maps for Linear Lightsstefan_b
 
Single Sample Soft Shadows Using Depth Maps
Single Sample Soft Shadows Using Depth MapsSingle Sample Soft Shadows Using Depth Maps
Single Sample Soft Shadows Using Depth Mapsstefan_b
 
Globalillumination
GlobalilluminationGlobalillumination
Globalilluminationmeheng1001
 
Ray casting algorithm by mhm
Ray casting algorithm by mhmRay casting algorithm by mhm
Ray casting algorithm by mhmMd Mosharof Hosen
 
GRPHICS07 - Textures
GRPHICS07 - TexturesGRPHICS07 - Textures
GRPHICS07 - TexturesMichael Heron
 
7 illumination and-shading computer graphics
7 illumination and-shading computer graphics7 illumination and-shading computer graphics
7 illumination and-shading computer graphicscairo university
 
Computer Vision panoramas
Computer Vision  panoramasComputer Vision  panoramas
Computer Vision panoramasWael Badawy
 
Adjoint Radiosity Borel Earsel09 2 11 09 White
Adjoint Radiosity Borel Earsel09 2 11 09 WhiteAdjoint Radiosity Borel Earsel09 2 11 09 White
Adjoint Radiosity Borel Earsel09 2 11 09 WhiteChristoph Borel
 
Adjoint Radiosity Borel Earsel09 2 11 09 White
Adjoint Radiosity Borel Earsel09 2 11 09 WhiteAdjoint Radiosity Borel Earsel09 2 11 09 White
Adjoint Radiosity Borel Earsel09 2 11 09 Whiteguest0030172
 
Green Custard Friday Talk 17: Ray Tracing
Green Custard Friday Talk 17: Ray TracingGreen Custard Friday Talk 17: Ray Tracing
Green Custard Friday Talk 17: Ray TracingGreen Custard
 
SIGGRAPH 2014 Course on Computational Cameras and Displays (part 4)
SIGGRAPH 2014 Course on Computational Cameras and Displays (part 4)SIGGRAPH 2014 Course on Computational Cameras and Displays (part 4)
SIGGRAPH 2014 Course on Computational Cameras and Displays (part 4)Matthew O'Toole
 
Understanding neural radiance fields
Understanding neural radiance fieldsUnderstanding neural radiance fields
Understanding neural radiance fieldsVarun Bhaseen
 
visual realism in geometric modeling
visual realism in geometric modelingvisual realism in geometric modeling
visual realism in geometric modelingsabiha khathun
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologyTiago Sousa
 

Similar to Interactive Refractions And Caustics Using Image Space Techniques (20)

Shadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive ApplicationsShadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive Applications
 
Ray Tracing.pdf
Ray Tracing.pdfRay Tracing.pdf
Ray Tracing.pdf
 
Computer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and MotionComputer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and Motion
 
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
 
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdfPapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
 
Soft Shadow Maps for Linear Lights
Soft Shadow Maps for Linear LightsSoft Shadow Maps for Linear Lights
Soft Shadow Maps for Linear Lights
 
Svr Raskar
Svr RaskarSvr Raskar
Svr Raskar
 
Single Sample Soft Shadows Using Depth Maps
Single Sample Soft Shadows Using Depth MapsSingle Sample Soft Shadows Using Depth Maps
Single Sample Soft Shadows Using Depth Maps
 
Globalillumination
GlobalilluminationGlobalillumination
Globalillumination
 
Ray casting algorithm by mhm
Ray casting algorithm by mhmRay casting algorithm by mhm
Ray casting algorithm by mhm
 
GRPHICS07 - Textures
GRPHICS07 - TexturesGRPHICS07 - Textures
GRPHICS07 - Textures
 
7 illumination and-shading computer graphics
7 illumination and-shading computer graphics7 illumination and-shading computer graphics
7 illumination and-shading computer graphics
 
Computer Vision panoramas
Computer Vision  panoramasComputer Vision  panoramas
Computer Vision panoramas
 
Adjoint Radiosity Borel Earsel09 2 11 09 White
Adjoint Radiosity Borel Earsel09 2 11 09 WhiteAdjoint Radiosity Borel Earsel09 2 11 09 White
Adjoint Radiosity Borel Earsel09 2 11 09 White
 
Adjoint Radiosity Borel Earsel09 2 11 09 White
Adjoint Radiosity Borel Earsel09 2 11 09 WhiteAdjoint Radiosity Borel Earsel09 2 11 09 White
Adjoint Radiosity Borel Earsel09 2 11 09 White
 
Green Custard Friday Talk 17: Ray Tracing
Green Custard Friday Talk 17: Ray TracingGreen Custard Friday Talk 17: Ray Tracing
Green Custard Friday Talk 17: Ray Tracing
 
SIGGRAPH 2014 Course on Computational Cameras and Displays (part 4)
SIGGRAPH 2014 Course on Computational Cameras and Displays (part 4)SIGGRAPH 2014 Course on Computational Cameras and Displays (part 4)
SIGGRAPH 2014 Course on Computational Cameras and Displays (part 4)
 
Understanding neural radiance fields
Understanding neural radiance fieldsUnderstanding neural radiance fields
Understanding neural radiance fields
 
visual realism in geometric modeling
visual realism in geometric modelingvisual realism in geometric modeling
visual realism in geometric modeling
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics Technology
 

More from codevania

14 virtual memory
14 virtual memory14 virtual memory
14 virtual memorycodevania
 
Gstar gossip
Gstar gossipGstar gossip
Gstar gossipcodevania
 
Deferred rendering transparency
Deferred rendering transparencyDeferred rendering transparency
Deferred rendering transparencycodevania
 
테스트 자동화의 원칙
테스트 자동화의 원칙테스트 자동화의 원칙
테스트 자동화의 원칙codevania
 
3장 자동적으로 움직이는 게임 에이전트 생성법
3장 자동적으로 움직이는 게임 에이전트 생성법3장 자동적으로 움직이는 게임 에이전트 생성법
3장 자동적으로 움직이는 게임 에이전트 생성법codevania
 
Spin locks 추가 자료
Spin locks 추가 자료Spin locks 추가 자료
Spin locks 추가 자료codevania
 
Texture bombing
Texture bombingTexture bombing
Texture bombingcodevania
 
Memory corruption stack
Memory corruption stackMemory corruption stack
Memory corruption stackcodevania
 
Mathematical Structures for CS [Chapter3]456
Mathematical Structures for CS [Chapter3]456Mathematical Structures for CS [Chapter3]456
Mathematical Structures for CS [Chapter3]456codevania
 
Optimizing The Content Pipeline
Optimizing The Content PipelineOptimizing The Content Pipeline
Optimizing The Content Pipelinecodevania
 
시간 있으면 설계나 합시다
시간 있으면 설계나 합시다시간 있으면 설계나 합시다
시간 있으면 설계나 합시다codevania
 
Memory Corruption Heap
Memory Corruption HeapMemory Corruption Heap
Memory Corruption Heapcodevania
 
Generic Refraction Simulation
Generic Refraction SimulationGeneric Refraction Simulation
Generic Refraction Simulationcodevania
 

More from codevania (16)

14 virtual memory
14 virtual memory14 virtual memory
14 virtual memory
 
Taocp 2_4
Taocp  2_4Taocp  2_4
Taocp 2_4
 
Taocp 2_3_1
Taocp  2_3_1Taocp  2_3_1
Taocp 2_3_1
 
Taocp 1 2-2
Taocp 1 2-2Taocp 1 2-2
Taocp 1 2-2
 
Gstar gossip
Gstar gossipGstar gossip
Gstar gossip
 
Deferred rendering transparency
Deferred rendering transparencyDeferred rendering transparency
Deferred rendering transparency
 
테스트 자동화의 원칙
테스트 자동화의 원칙테스트 자동화의 원칙
테스트 자동화의 원칙
 
3장 자동적으로 움직이는 게임 에이전트 생성법
3장 자동적으로 움직이는 게임 에이전트 생성법3장 자동적으로 움직이는 게임 에이전트 생성법
3장 자동적으로 움직이는 게임 에이전트 생성법
 
Spin locks 추가 자료
Spin locks 추가 자료Spin locks 추가 자료
Spin locks 추가 자료
 
Texture bombing
Texture bombingTexture bombing
Texture bombing
 
Memory corruption stack
Memory corruption stackMemory corruption stack
Memory corruption stack
 
Mathematical Structures for CS [Chapter3]456
Mathematical Structures for CS [Chapter3]456Mathematical Structures for CS [Chapter3]456
Mathematical Structures for CS [Chapter3]456
 
Optimizing The Content Pipeline
Optimizing The Content PipelineOptimizing The Content Pipeline
Optimizing The Content Pipeline
 
시간 있으면 설계나 합시다
시간 있으면 설계나 합시다시간 있으면 설계나 합시다
시간 있으면 설계나 합시다
 
Memory Corruption Heap
Memory Corruption HeapMemory Corruption Heap
Memory Corruption Heap
 
Generic Refraction Simulation
Generic Refraction SimulationGeneric Refraction Simulation
Generic Refraction Simulation
 

Recently uploaded

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

Interactive Refractions And Caustics Using Image Space Techniques

  • 1. Interactive Refractions and Caustics Using Image-Space Techniques Shader Study (http://cafe.naver.com/shader.cafe) Codevania (http://codevania.blogspot.com)
  • 3.  
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. Rendering Caustic Map Use photon data in vertex shader, render points at photon locations Light Space Eye Space
  • 28.
  • 29.
  • 31.
  • 32. Code snippets RenderCaustics { // create the buffers needed for refraction from light (for caustics) createRefractionBuffers // create all the necessary buffers (normal, bg geom, depth, etc) from a particular POV // draw the normals for the back side createBackSideMaps // Draw just the background geometry createOtherObjectEyeTexture // draw the caustics positions & directions info to the framebuffer DrawSceneCausticsToBuffer // Draw refractive geometry from a particular POV // store positions of final hitpoints into a secondary buffer set the eye's lookat Draw the environment map Draw the refractor Draw the non refractive objects in the scene PerformLightSpaceGather // find caustic contribution using an image-space gather using a image from the light's POV draw photons splats using point sprites } // Now we've got our caustic map. However, simply projecting this onto the // scene means any surface will get a caustic, whether shadowed (from the refractor) or not! // By copying the depth buffer from the background image we used above, // we can sort this out to only cast caustics onto the "frontmost" surface behind the refractor
  • 33. Code snippets DrawCausticsSceneWithLightSpaceGatheredPhotons { if ( needToRerenderCaustics ) RenderCaustics // create the buffers needed for refraction from the "eye's" point of view CreateRefractionBuffersForLightSpacePhotonGather // create all the necessary buffers (normal, bg geom, depth, etc) from a particular POV // Draw just the background geometry (MacBeth, Dragon, etc) DrawShadowedBackgroundWithLightSpaceCaustics DrawEnvironmentMap compute the shadow map matrix index into 'light-space caustic map' displayBackGroundGeometry // draw the normals for the back side createBackSideMaps // draw the scene, with caustics on the background geometry, refracted thru the refractor FinalDrawWithAlreadyComputedLightSpaceGather // takes the background geometry textures // (which includes one with accumulated photon contributions) set the eye's lookat //Draw the (background) non refractive objects in the scene displayLargeTextureWithDepth // Go ahead and actually draw the refractive object glCallList }
  • 34. Graphical Overview (1) Eye-space background image without refractor (2) Eye-space background surface depth map (3) Light-space background surface depth map (4) Eye-space view of refractor's backfacing surface normals (5) Eye-space view of refractor's backfacing surface depth (6) Four frame caustic map (one frame's intensity per channel) (7) Current frame's photon buffer (i.e., the photon positions) (8) Surface normal at final photon positions (light-space) (9) Light-space depth map (a.k.a. the shadow map)
  • 35.
  • 36.