SlideShare a Scribd company logo
Ray Tracing
1
Introduction
• OpenGL is based on a pipeline model in which primitives are
rendered one at time
• No shadows (except by tricks or multiple renderings)
• No multiple reflections
• Global approaches
• Rendering equation
• Ray tracing
• Radiosity
2
Ray Tracing
• Follow rays of light from a point source
• Can account for reflection and transmission
3
Computation
• Should be able to handle all physical interactions
• Ray tracing paradigm is not computational
• Most rays do not affect what we see
• Scattering produces many (infinite) additional rays
• Alternative: ray casting
4
Ray Casting
• Only rays that reach the eye matter
• Reverse direction and cast rays
• Need at least one ray per pixel
5
Ray Casting Quadrics
• Ray casting has become the standard way to visualize quadrics which
are implicit surfaces in CSG systems
• Constructive Solid Geometry
• Primitives are solids
• Build objects with set operations
• Union, intersection, set difference
6
Ray Casting a Sphere
• Ray is parametric
• Sphere is quadric
• Resulting equation is a scalar quadratic equation which gives entry
and exit points of ray (or no solution if ray misses)
7
Shadow Rays
• Even if a point is visible, it will not be lit unless we can see a light
source from that point
• Cast shadow or feeler rays
8
Reflection
• Must follow shadow rays off reflecting or transmitting surfaces
• Process is recursive
9
Reflection and Transmission
10
Ray Trees
11
Ray Tree
12
Diffuse Surfaces
• Theoretically the scattering at each point of intersection generates
an infinite number of new rays that should be traced
• In practice, we only trace the transmitted and reflected rays but use
the Phong model to compute shade at point of intersection
• Radiosity works best for perfectly diffuse (Lambertian) surfaces
13
Building a Ray Tracer
• Best expressed recursively
• Can remove recursion later
• Image based approach
• For each ray …….
• Find intersection with closest surface
• Need whole object database available
• Complexity of calculation limits object types
• Compute lighting at surface
• Trace reflected and transmitted rays
14
When to stop
• Some light will be absorbed at each intersection
• Track amount left
• Ignore rays that go off to infinity
• Put large sphere around problem
• Count steps
15
Recursive Ray Tracer
color c = trace(point p, vector d, int step)
{
color local, reflected, transmitted;
point q;
normal n;
if(step > max) return(background_color);
16
Recursive Ray Tracer
q = intersect(p, d, status);
if(status==light_source)
return(light_source_color);
if(status==no_intersection)
return(background_color);
n = normal(q);
r = reflect(q, n);
t = transmit(q,n);
17
Recursive Ray Tracer
local = phong(q, n, r);
reflected = trace(q, r, step+1);
transmitted = trace(q,t, step+1);
return(local+reflected+
transmitted);
18
Computing Intersections
• Implicit Objects
• Quadrics
• Planes
• Polyhedra
• Parametric Surfaces
19
Implicit Surfaces
Ray from p0 in direction d
p(t) = p0 +t d
General implicit surface
f(p) = 0
Solve scalar equation
f(p(t)) = 0
General case requires numerical methods
20
Quadrics
General quadric can be written as
pT
Ap + bT
p +c = 0
Substitute equation of ray
p(t) = p0 +t d
to get quadratic equation
21
Sphere
(p – pc) • (p – pc) – r2
= 0
p(t) = p0 +t d
p0 • p0 t2
+ 2 p0 • (d – p0) t + (d – p0) • (d – p0)
– r2
= 0
22
Planes
p • n + c = 0
p(t) = p0 +t d
t = -(p0 • n + c)/ d • n
23
Polyhedra
• Generally we want to intersect with closed objects such as polygons
and polyhedra rather than planes
• Hence we have to worry about inside/outside testing
• For convex objects such as polyhedra there are some fast tests
24
Ray Tracing Polyhedra
•If ray enters an object, it must enter a front facing
polygon and leave a back facing polygon
•Polyhedron is formed by intersection of planes
•Ray enters at furthest intersection with front facing
planes
•Ray leaves at closest intersection with back facing
planes
•If entry is further away than exit, ray must miss the
polyhedron
25
Ray Tracing Polyhedra
26
Ray Tracing a Polygon
27
Ray Tracing a Polygon
28

More Related Content

What's hot

Ray Tracing in Computer Graphics
Ray Tracing in Computer GraphicsRay Tracing in Computer Graphics
Ray Tracing in Computer Graphics
KABILESH RAMAR
 
Illumination Model
Illumination ModelIllumination Model
Illumination Model
aishwaryabharadwaj7
 
illumination model in Computer Graphics by irru pychukar
illumination model in Computer Graphics by irru pychukarillumination model in Computer Graphics by irru pychukar
illumination model in Computer Graphics by irru pychukar
syedArr
 
Illumination model
Illumination modelIllumination model
Illumination model
Ankur Kumar
 
Illumination models
Illumination modelsIllumination models
Illumination models
KABILESH RAMAR
 
Concept of basic illumination model
Concept of basic illumination modelConcept of basic illumination model
Concept of basic illumination model
Ankit Garg
 
Iluminacion
IluminacionIluminacion
Iluminacion
johanna20
 
GRPHICS06 - Shading
GRPHICS06 - ShadingGRPHICS06 - Shading
GRPHICS06 - Shading
Michael Heron
 
Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface
Bhuvnesh Pratap
 
Chapter 2 geometrical_optics_a
Chapter 2 geometrical_optics_aChapter 2 geometrical_optics_a
Chapter 2 geometrical_optics_a
Gabriel O'Brien
 
Chapter 2 geometrical_optics_b
Chapter 2 geometrical_optics_bChapter 2 geometrical_optics_b
Chapter 2 geometrical_optics_b
Gabriel O'Brien
 
Lighting and shading
Lighting and shadingLighting and shading
Lighting and shading
Sri Harsha Vemuri
 
graphics notes
graphics notesgraphics notes
graphics notes
Sonia Pahuja
 
Cs8092 computer graphics and multimedia unit 1
Cs8092 computer graphics and multimedia unit 1Cs8092 computer graphics and multimedia unit 1
Cs8092 computer graphics and multimedia unit 1
SIMONTHOMAS S
 
Matrix optics
Matrix opticsMatrix optics
Matrix optics
Qahtan Al-zaidi
 
9.4 resolution
9.4 resolution9.4 resolution
9.4 resolution
Paula Mills
 
Ray Optics Class 12 Part-1
Ray Optics Class 12 Part-1Ray Optics Class 12 Part-1
Ray Optics Class 12 Part-1
Self-employed
 
Lec03 light
Lec03 lightLec03 light
Lec03 light
BaliThorat1
 
Ray Optics Class 12 Part-2
Ray Optics Class 12 Part-2Ray Optics Class 12 Part-2
Ray Optics Class 12 Part-2
Self-employed
 

What's hot (19)

Ray Tracing in Computer Graphics
Ray Tracing in Computer GraphicsRay Tracing in Computer Graphics
Ray Tracing in Computer Graphics
 
Illumination Model
Illumination ModelIllumination Model
Illumination Model
 
illumination model in Computer Graphics by irru pychukar
illumination model in Computer Graphics by irru pychukarillumination model in Computer Graphics by irru pychukar
illumination model in Computer Graphics by irru pychukar
 
Illumination model
Illumination modelIllumination model
Illumination model
 
Illumination models
Illumination modelsIllumination models
Illumination models
 
Concept of basic illumination model
Concept of basic illumination modelConcept of basic illumination model
Concept of basic illumination model
 
Iluminacion
IluminacionIluminacion
Iluminacion
 
GRPHICS06 - Shading
GRPHICS06 - ShadingGRPHICS06 - Shading
GRPHICS06 - Shading
 
Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface
 
Chapter 2 geometrical_optics_a
Chapter 2 geometrical_optics_aChapter 2 geometrical_optics_a
Chapter 2 geometrical_optics_a
 
Chapter 2 geometrical_optics_b
Chapter 2 geometrical_optics_bChapter 2 geometrical_optics_b
Chapter 2 geometrical_optics_b
 
Lighting and shading
Lighting and shadingLighting and shading
Lighting and shading
 
graphics notes
graphics notesgraphics notes
graphics notes
 
Cs8092 computer graphics and multimedia unit 1
Cs8092 computer graphics and multimedia unit 1Cs8092 computer graphics and multimedia unit 1
Cs8092 computer graphics and multimedia unit 1
 
Matrix optics
Matrix opticsMatrix optics
Matrix optics
 
9.4 resolution
9.4 resolution9.4 resolution
9.4 resolution
 
Ray Optics Class 12 Part-1
Ray Optics Class 12 Part-1Ray Optics Class 12 Part-1
Ray Optics Class 12 Part-1
 
Lec03 light
Lec03 lightLec03 light
Lec03 light
 
Ray Optics Class 12 Part-2
Ray Optics Class 12 Part-2Ray Optics Class 12 Part-2
Ray Optics Class 12 Part-2
 

Similar to Ray Tracing

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
Green Custard
 
november6.ppt
november6.pptnovember6.ppt
november6.ppt
CharlesMatu2
 
Real-time lightmap baking
Real-time lightmap bakingReal-time lightmap baking
Real-time lightmap baking
Rosario Leonardi
 
Texture Mapping
Texture MappingTexture Mapping
Texture Mapping
Syed Zaid Irshad
 
Line Detection in Computer Vision
Line Detection in Computer VisionLine Detection in Computer Vision
Line Detection in Computer Vision
Parth Nandedkar
 
Ray Tracing.pdf
Ray Tracing.pdfRay Tracing.pdf
Ray Tracing.pdf
Mattupallipardhu
 
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
Wolfgang Engel
 
3 d
3 d3 d
testpang
testpangtestpang
testpang
pangpang2
 
Light (1)
Light (1)Light (1)
Light (1)
jay gala
 
Ray casting algorithm by mhm
Ray casting algorithm by mhmRay casting algorithm by mhm
Ray casting algorithm by mhm
Md Mosharof Hosen
 
Anti collision monitoring
Anti collision monitoringAnti collision monitoring
Anti collision monitoring
Shreyansh Shukla
 
Astronomical observations.ppt
Astronomical observations.pptAstronomical observations.ppt
Astronomical observations.ppt
ObservatorioDiscover
 
Fassold-MMAsia2023-Tutorial-GeometricDL-Part1.pptx
Fassold-MMAsia2023-Tutorial-GeometricDL-Part1.pptxFassold-MMAsia2023-Tutorial-GeometricDL-Part1.pptx
Fassold-MMAsia2023-Tutorial-GeometricDL-Part1.pptx
HannesFesswald
 
Line Detection in Computer Vision - Recent Developments and Applications
Line Detection in Computer Vision - Recent Developments and ApplicationsLine Detection in Computer Vision - Recent Developments and Applications
Line Detection in Computer Vision - Recent Developments and Applications
Parth Nandedkar
 
Projection Matrices
Projection MatricesProjection Matrices
Projection Matrices
Syed Zaid Irshad
 
Compass robot forming cirlce
Compass robot forming cirlceCompass robot forming cirlce
Compass robot forming cirlce
Christian Jay Avance
 
Sparse fourier transform
Sparse fourier transformSparse fourier transform
Sparse fourier transform
Aarthi Raghavendra
 
Algorithmic Techniques for Parametric Model Recovery
Algorithmic Techniques for Parametric Model RecoveryAlgorithmic Techniques for Parametric Model Recovery
Algorithmic Techniques for Parametric Model Recovery
CurvSurf
 
Bump Mapping
Bump MappingBump Mapping
Bump Mapping
Syed Zaid Irshad
 

Similar to Ray Tracing (20)

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
 
november6.ppt
november6.pptnovember6.ppt
november6.ppt
 
Real-time lightmap baking
Real-time lightmap bakingReal-time lightmap baking
Real-time lightmap baking
 
Texture Mapping
Texture MappingTexture Mapping
Texture Mapping
 
Line Detection in Computer Vision
Line Detection in Computer VisionLine Detection in Computer Vision
Line Detection in Computer Vision
 
Ray Tracing.pdf
Ray Tracing.pdfRay Tracing.pdf
Ray Tracing.pdf
 
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
 
3 d
3 d3 d
3 d
 
testpang
testpangtestpang
testpang
 
Light (1)
Light (1)Light (1)
Light (1)
 
Ray casting algorithm by mhm
Ray casting algorithm by mhmRay casting algorithm by mhm
Ray casting algorithm by mhm
 
Anti collision monitoring
Anti collision monitoringAnti collision monitoring
Anti collision monitoring
 
Astronomical observations.ppt
Astronomical observations.pptAstronomical observations.ppt
Astronomical observations.ppt
 
Fassold-MMAsia2023-Tutorial-GeometricDL-Part1.pptx
Fassold-MMAsia2023-Tutorial-GeometricDL-Part1.pptxFassold-MMAsia2023-Tutorial-GeometricDL-Part1.pptx
Fassold-MMAsia2023-Tutorial-GeometricDL-Part1.pptx
 
Line Detection in Computer Vision - Recent Developments and Applications
Line Detection in Computer Vision - Recent Developments and ApplicationsLine Detection in Computer Vision - Recent Developments and Applications
Line Detection in Computer Vision - Recent Developments and Applications
 
Projection Matrices
Projection MatricesProjection Matrices
Projection Matrices
 
Compass robot forming cirlce
Compass robot forming cirlceCompass robot forming cirlce
Compass robot forming cirlce
 
Sparse fourier transform
Sparse fourier transformSparse fourier transform
Sparse fourier transform
 
Algorithmic Techniques for Parametric Model Recovery
Algorithmic Techniques for Parametric Model RecoveryAlgorithmic Techniques for Parametric Model Recovery
Algorithmic Techniques for Parametric Model Recovery
 
Bump Mapping
Bump MappingBump Mapping
Bump Mapping
 

More from Syed Zaid Irshad

Operating System.pdf
Operating System.pdfOperating System.pdf
Operating System.pdf
Syed Zaid Irshad
 
DBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_SolutionDBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_Solution
Syed Zaid Irshad
 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptx
Syed Zaid Irshad
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
Syed Zaid Irshad
 
Professional Issues in Computing
Professional Issues in ComputingProfessional Issues in Computing
Professional Issues in Computing
Syed Zaid Irshad
 
Reduce course notes class xi
Reduce course notes class xiReduce course notes class xi
Reduce course notes class xi
Syed Zaid Irshad
 
Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xii
Syed Zaid Irshad
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
Syed Zaid Irshad
 
C Language
C LanguageC Language
C Language
Syed Zaid Irshad
 
Flowchart
FlowchartFlowchart
Flowchart
Syed Zaid Irshad
 
Algorithm Pseudo
Algorithm PseudoAlgorithm Pseudo
Algorithm Pseudo
Syed Zaid Irshad
 
Computer Programming
Computer ProgrammingComputer Programming
Computer Programming
Syed Zaid Irshad
 
ICS 2nd Year Book Introduction
ICS 2nd Year Book IntroductionICS 2nd Year Book Introduction
ICS 2nd Year Book Introduction
Syed Zaid Irshad
 
Security, Copyright and the Law
Security, Copyright and the LawSecurity, Copyright and the Law
Security, Copyright and the Law
Syed Zaid Irshad
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
Syed Zaid Irshad
 
Data Communication
Data CommunicationData Communication
Data Communication
Syed Zaid Irshad
 
Information Networks
Information NetworksInformation Networks
Information Networks
Syed Zaid Irshad
 
Basic Concept of Information Technology
Basic Concept of Information TechnologyBasic Concept of Information Technology
Basic Concept of Information Technology
Syed Zaid Irshad
 
Introduction to ICS 1st Year Book
Introduction to ICS 1st Year BookIntroduction to ICS 1st Year Book
Introduction to ICS 1st Year Book
Syed Zaid Irshad
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
Syed Zaid Irshad
 

More from Syed Zaid Irshad (20)

Operating System.pdf
Operating System.pdfOperating System.pdf
Operating System.pdf
 
DBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_SolutionDBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_Solution
 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptx
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
 
Professional Issues in Computing
Professional Issues in ComputingProfessional Issues in Computing
Professional Issues in Computing
 
Reduce course notes class xi
Reduce course notes class xiReduce course notes class xi
Reduce course notes class xi
 
Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xii
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
C Language
C LanguageC Language
C Language
 
Flowchart
FlowchartFlowchart
Flowchart
 
Algorithm Pseudo
Algorithm PseudoAlgorithm Pseudo
Algorithm Pseudo
 
Computer Programming
Computer ProgrammingComputer Programming
Computer Programming
 
ICS 2nd Year Book Introduction
ICS 2nd Year Book IntroductionICS 2nd Year Book Introduction
ICS 2nd Year Book Introduction
 
Security, Copyright and the Law
Security, Copyright and the LawSecurity, Copyright and the Law
Security, Copyright and the Law
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Data Communication
Data CommunicationData Communication
Data Communication
 
Information Networks
Information NetworksInformation Networks
Information Networks
 
Basic Concept of Information Technology
Basic Concept of Information TechnologyBasic Concept of Information Technology
Basic Concept of Information Technology
 
Introduction to ICS 1st Year Book
Introduction to ICS 1st Year BookIntroduction to ICS 1st Year Book
Introduction to ICS 1st Year Book
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
 

Recently uploaded

OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
PreethaV16
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
Kamal Acharya
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
Roger Rozario
 
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
OKORIE1
 
Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
VanTuDuong1
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
AI in customer support Use cases solutions development and implementation.pdf
AI in customer support Use cases solutions development and implementation.pdfAI in customer support Use cases solutions development and implementation.pdf
AI in customer support Use cases solutions development and implementation.pdf
mahaffeycheryld
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
Paris Salesforce Developer Group
 
Presentation on Food Delivery Systems
Presentation on Food Delivery SystemsPresentation on Food Delivery Systems
Presentation on Food Delivery Systems
Abdullah Al Noman
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
DharmaBanothu
 
Assistant Engineer (Chemical) Interview Questions.pdf
Assistant Engineer (Chemical) Interview Questions.pdfAssistant Engineer (Chemical) Interview Questions.pdf
Assistant Engineer (Chemical) Interview Questions.pdf
Seetal Daas
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
ijseajournal
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
DharmaBanothu
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
q30122000
 

Recently uploaded (20)

OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
 
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
 
Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
AI in customer support Use cases solutions development and implementation.pdf
AI in customer support Use cases solutions development and implementation.pdfAI in customer support Use cases solutions development and implementation.pdf
AI in customer support Use cases solutions development and implementation.pdf
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
 
Presentation on Food Delivery Systems
Presentation on Food Delivery SystemsPresentation on Food Delivery Systems
Presentation on Food Delivery Systems
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
 
Assistant Engineer (Chemical) Interview Questions.pdf
Assistant Engineer (Chemical) Interview Questions.pdfAssistant Engineer (Chemical) Interview Questions.pdf
Assistant Engineer (Chemical) Interview Questions.pdf
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
 

Ray Tracing

  • 2. Introduction • OpenGL is based on a pipeline model in which primitives are rendered one at time • No shadows (except by tricks or multiple renderings) • No multiple reflections • Global approaches • Rendering equation • Ray tracing • Radiosity 2
  • 3. Ray Tracing • Follow rays of light from a point source • Can account for reflection and transmission 3
  • 4. Computation • Should be able to handle all physical interactions • Ray tracing paradigm is not computational • Most rays do not affect what we see • Scattering produces many (infinite) additional rays • Alternative: ray casting 4
  • 5. Ray Casting • Only rays that reach the eye matter • Reverse direction and cast rays • Need at least one ray per pixel 5
  • 6. Ray Casting Quadrics • Ray casting has become the standard way to visualize quadrics which are implicit surfaces in CSG systems • Constructive Solid Geometry • Primitives are solids • Build objects with set operations • Union, intersection, set difference 6
  • 7. Ray Casting a Sphere • Ray is parametric • Sphere is quadric • Resulting equation is a scalar quadratic equation which gives entry and exit points of ray (or no solution if ray misses) 7
  • 8. Shadow Rays • Even if a point is visible, it will not be lit unless we can see a light source from that point • Cast shadow or feeler rays 8
  • 9. Reflection • Must follow shadow rays off reflecting or transmitting surfaces • Process is recursive 9
  • 13. Diffuse Surfaces • Theoretically the scattering at each point of intersection generates an infinite number of new rays that should be traced • In practice, we only trace the transmitted and reflected rays but use the Phong model to compute shade at point of intersection • Radiosity works best for perfectly diffuse (Lambertian) surfaces 13
  • 14. Building a Ray Tracer • Best expressed recursively • Can remove recursion later • Image based approach • For each ray ……. • Find intersection with closest surface • Need whole object database available • Complexity of calculation limits object types • Compute lighting at surface • Trace reflected and transmitted rays 14
  • 15. When to stop • Some light will be absorbed at each intersection • Track amount left • Ignore rays that go off to infinity • Put large sphere around problem • Count steps 15
  • 16. Recursive Ray Tracer color c = trace(point p, vector d, int step) { color local, reflected, transmitted; point q; normal n; if(step > max) return(background_color); 16
  • 17. Recursive Ray Tracer q = intersect(p, d, status); if(status==light_source) return(light_source_color); if(status==no_intersection) return(background_color); n = normal(q); r = reflect(q, n); t = transmit(q,n); 17
  • 18. Recursive Ray Tracer local = phong(q, n, r); reflected = trace(q, r, step+1); transmitted = trace(q,t, step+1); return(local+reflected+ transmitted); 18
  • 19. Computing Intersections • Implicit Objects • Quadrics • Planes • Polyhedra • Parametric Surfaces 19
  • 20. Implicit Surfaces Ray from p0 in direction d p(t) = p0 +t d General implicit surface f(p) = 0 Solve scalar equation f(p(t)) = 0 General case requires numerical methods 20
  • 21. Quadrics General quadric can be written as pT Ap + bT p +c = 0 Substitute equation of ray p(t) = p0 +t d to get quadratic equation 21
  • 22. Sphere (p – pc) • (p – pc) – r2 = 0 p(t) = p0 +t d p0 • p0 t2 + 2 p0 • (d – p0) t + (d – p0) • (d – p0) – r2 = 0 22
  • 23. Planes p • n + c = 0 p(t) = p0 +t d t = -(p0 • n + c)/ d • n 23
  • 24. Polyhedra • Generally we want to intersect with closed objects such as polygons and polyhedra rather than planes • Hence we have to worry about inside/outside testing • For convex objects such as polyhedra there are some fast tests 24
  • 25. Ray Tracing Polyhedra •If ray enters an object, it must enter a front facing polygon and leave a back facing polygon •Polyhedron is formed by intersection of planes •Ray enters at furthest intersection with front facing planes •Ray leaves at closest intersection with back facing planes •If entry is further away than exit, ray must miss the polyhedron 25
  • 27. Ray Tracing a Polygon 27
  • 28. Ray Tracing a Polygon 28