Skip to content
Snippets Groups Projects
Commit 77a6b9ea authored by allai5's avatar allai5
Browse files

new docs dump

parent cbbc4fa0
Branches
No related merge requests found
--- ---
layout: default layout: default
title: "Ray Triangle Intersection" title: Ray Triangle Intersection
permalink: /pathtracer/ray_triangle_intersection permalink: /pathtracer/ray_triangle_intersection
grand_parent: "A3: Pathtracer"
nav_order: 1
parent: (Task 2) Intersections
--- ---
# Ray Triangle Intersection # Ray Triangle Intersection
Given a triangle defined by points _p0_, _p1_ and _p2_ and a ray given by its origin _o_ and direction _d_, the barycentrics of the hit point as well as the _t_-value of the hit can be obtained by solving the system: We recommend that you implement the *Moller-Trumbore algorithm*, a fast algorithm
that takes advantage of a barycentric coordinates parameterization of the
intersection point, for ray-triangle intersection.
![triangle_eq1](triangle_eq1.png) <center><img src="triangle_intersect_diagram.png" style="height:320px"></center>
<center><img src="triangle_intersect_eqns.png" style="height:400px"></center>
Where:
![triangle_eq2](triangle_eq2.png)
This system can be solved by Cramer's Rule, yielding:
![triangle_eq3](triangle_eq3.png)
In the above, |a b c| denotes the determinant of the 3x3 with column vectors _a_, _b_, _c_.
Note that since the determinant is given by:![triangle_eq4](triangle_eq4.png)
you can rewrite the above as:
![triangle_eq5](triangle_eq5.png)
Of which you should notice a few common subexpressions that, if exploited in an implementation, make computation of _t_, _u_, and _v_ substantially more efficient.
A few final notes and thoughts: A few final notes and thoughts:
......
docs/pathtracer/raytracing_diagram.png

59.8 KiB

--- ---
layout: default layout: default
title: "(Task 4) Shadow Rays" title: (Task 4) Shadow Rays
permalink: /pathtracer/shadow_rays permalink: /pathtracer/shadow_rays
parent: "A3: Pathtracer"
--- ---
# (Task 4) Shadow Rays # (Task 4) Shadow Rays
...@@ -34,27 +35,27 @@ At this point, you can add all kinds of lights among the options you have when y ...@@ -34,27 +35,27 @@ At this point, you can add all kinds of lights among the options you have when y
The head of Peter Schröder rendered with hemishphere lighting. The head of Peter Schröder rendered with hemishphere lighting.
![shadow_area](new_results/shadow_peter.png) <center><img src="new_results/shadow_peter.png" style="height:240px"></center>
A sphere and a cube with hemishphere lighting A sphere and a cube with hemishphere lighting
![shadow_hemisphere](new_results/cube_sphere_hemisphere.png) <center><img src="new_results/cube_sphere_hemisphere.png" style="height:240px"></center>
Hex and cube under diretional lighting Hex and cube under directional lighting
![ref1](new_results/ref1.png) <center><img src="new_results/ref1.png" style="height:240px"></center>
Bunny on a plane under point light Bunny on a plane under point light
![ref1](new_results/ref2.png) <center><img src="new_results/ref2.png" style="height:400px"></center>
Spot on a sphere under diretional lighting Spot on a sphere under diretional lighting
![ref1](new_results/ref3.png) <center><img src="new_results/ref3.png" style="height:240px"></center>
Spot on a sphere under hemisphere lighting Spot on a sphere under hemisphere lighting
![ref1](new_results/ref4.png) <center><img src="new_results/ref4.png" style="height:240px"></center>
docs/pathtracer/sphere_intersect_diagram.png

50.6 KiB

docs/pathtracer/sphere_intersect_eqns.png

72.1 KiB

docs/pathtracer/triangle_intersect_diagram.png

89.7 KiB

docs/pathtracer/triangle_intersect_eqns.png

57.5 KiB

--- ---
layout: default layout: default
title: "Visualization of normals" title: Visualization of normals
permalink: /pathtracer/visualization_of_normals permalink: /pathtracer/visualization_of_normals
parent: "A3: Pathtracer"
--- ---
# Visualization of normals # Visualization of normals
...@@ -12,10 +13,5 @@ You can set the `bool normal_colors` to true in `student/debug.h` to check if th ...@@ -12,10 +13,5 @@ You can set the `bool normal_colors` to true in `student/debug.h` to check if th
Here are some reference results: Here are some reference results:
![normalviz](new_results/cbox_normal.png) <img src="new_results/cbox_normal.png" style="height:200px"> <img src="new_results/norm1.png" style="height:200px">
<img src="new_results/norm2.png" style="height:194px"> <img src="new_results/norm3.png" style="height:194px">
![normalviz](new_results/norm1.png)
![normalviz](new_results/norm2.png)
![normalviz](new_results/norm3.png)
docs/results/me_f20_crop.png

576 KiB

0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment