![Page 1: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/1.jpg)
CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing
Paul Taylor 2010
![Page 2: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/2.jpg)
Zones, Portals and Anti-Portals
With Pictures!
![Page 3: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/3.jpg)
Zones
• Air-tight areas of your level that constitute different areas.
http://www.hourences.com/book/tutorialszoning.htm
![Page 4: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/4.jpg)
Portals
• These are the windows between your Zones• You can either think of zones as airtight areas,
or pretend to fill them with water
![Page 5: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/5.jpg)
A more effective Zone / Portal combination
![Page 6: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/6.jpg)
Occlusion Planes
• A newer advance in pre-rendering occlusion– This was one of the key technologies that enabled
large open-world games to be created• A plane which is inserted into any object
which is large enough to be a ‘good’ occluder
![Page 7: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/7.jpg)
The Bigger the Better!
![Page 8: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/8.jpg)
Remember what occluders do
![Page 9: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/9.jpg)
Get Creative!
• Don’t forget your ceilings and floors!• You should keep your visible occluders down
to only like 3 or 4
![Page 10: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/10.jpg)
Fog is your friend!
![Page 11: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/11.jpg)
Bonuses
• Much shorter Z-Depth Required before culling• Heavy Fog can be used in situations of high
complexity• Even on a ‘Sunny Clear Day’ with huge draw-
distances, fog can be used to stop pop-in
![Page 12: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/12.jpg)
Negatives
More code in your shaders• Easily offset by the savings in polygonsSome extra possible issues with artefacts• Fatter Vertices
![Page 13: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/13.jpg)
How?
Two Main Methods:• Vertex Based Fog - Cheaper• Table Based Fog (Pixel Fog) - ExpensiveImportant Attributes• Distance (range / plane)• Drop Off (Very similar to lighting!)• Z or W based
![Page 14: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/14.jpg)
Vertex Fog
Functions in a similar way to Per Vertex Colours, or Per Vertex Lighting
Fog values are interpolated across polygons based on Vertex Values
• All the usual per-vertex problems apply here too!
![Page 15: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/15.jpg)
Plane Based Fog
viewpoint
viewpoint
AfterBefore
Object 1(not in Fog)
View Plane
Object 2(in Fog)
Object 1( in Fog)
Object 2(not in Fog)
View Plane
![Page 16: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/16.jpg)
Range
• Ranged based fog has a start and an end– Vertices before the FogStart are unfogged,
Vertices after FogEnd are Completely obscured– A function is used to interpolate from FogStart to
FogEnd• Simplest: Linear Interpolation• More complex: Eg: Exponential, quadratic, etc.
![Page 17: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/17.jpg)
Range Based Fog
After
Before
Object 1(not in Fog)
Object 2(in Fog)
viewpoint
Object 1(not in Fog)
Object 2(in Fog)
fog_startt
fog_end
![Page 18: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/18.jpg)
Linear Fog
![Page 19: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/19.jpg)
Exponential Fog (2 types)
• D = distance from viewpoint• Density = Variable from 0.0 to 1.0• The second equation has a steeper gradient
through the middle section
http://msdn.microsoft.com/en-us/library/bb173401%28VS.85%29.aspx
![Page 20: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/20.jpg)
Exponential Fog Curves
Linear Fog
![Page 21: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/21.jpg)
Vertex Based Fog Limitations
Vertex 0f = 1
fog_start
fog_end
Vertex 1f = 0
Interpolated half-way pointf = 0.5
![Page 22: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/22.jpg)
Polygon based Fog & Non Z Objects
• Fail!
![Page 23: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/23.jpg)
A Tessellation Solution
Vertex 0f = 1
fog_start
fog_end
Vertex 1f = 0
Interpolatedf = 0.5
Vertex 2f = 1
Vertex 3f = 0
![Page 24: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/24.jpg)
Z-Fog
The most basic Pixel Fog is Z-Fog (Depth-Fog)Things that can go wrong:Tilting on the Y axis results in:
http://cs.gmu.edu/~jchen/cs662/fog.pdf
![Page 25: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/25.jpg)
Why does it happen?
Side View of the previous slide
![Page 26: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/26.jpg)
How can we solve it?
• We could Fix the rotation on the Y axis • Or we could calculate the true distance from
eye to each pixel.• It just so happens that we can get this value
for free (Processing wise, we will need an extra float per vertex)
![Page 27: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/27.jpg)
W-Fog (The DX9 Way)
• What is W?• How do we make sure W exists?• Both these matrices will work perfectly as an
XYZ projection matrix.• Below will create a W = Z * S. not exactly
helpful.• Above will
Incorrect Projection Matrix for Accurate W Based Fog
000
00
000
000
nQz
sQ
c
c
M
Correct Projection Matrix for Accurate W based Fog
000
100
000
000
sQzs
Qsc
sc
M
n
![Page 28: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/28.jpg)
W-Fog the DX10 Way
W Fog is easy, we already use world coordinates for vertices in our lighting, so we can just add a float to pass the eye-vertex distance to the pixel shader
![Page 29: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/29.jpg)
Newest Fog Technologies
• Technical Innovations to reduce your visibility!
• If you want to be ‘at the front’ you need to be looking for papers from Google Scholar!– Take each idea you like, figure out how it’s done,
then figure out what you could do better!• The following is from the latest build of the
UDK
![Page 30: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/30.jpg)
Exponential Height Fog
• New kind of global fog with density that decreases with height
• Never creates a hard line (unlike standard fog); supports one layer
• Can specify both "towards the light" and "away from the light" colours
• Rendering cost similar to two layers of constant density height fog
• Can now use different colours for the hemisphere facing the light and vice versa
![Page 31: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/31.jpg)
Constant Density Height Fog
![Page 32: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/32.jpg)
Exponential Height Fog
http://udn.epicgames.com/Three/rsrc/Three/ContentBlog/1ExpResized.jpg
![Page 33: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/33.jpg)
Pipelines are for Chumps
Raycasting and Raytracing
![Page 34: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/34.jpg)
Ray Casting
• Definition Time• There are two definitions of Ray Casting• The Old and the New• The old was related to 3D games back in the
Wolfenstein / Doom 1 Era. Where gameplay was on a 2D platform
• The New definition is:– Non Recursive Ray Tracing
![Page 35: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/35.jpg)
Ray Tracing
• http://www.flipcode.com/archives/Raytracing_Topics_Techniques-Part_1_Introduction.shtml
Glass Ball
![Page 36: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/36.jpg)
Rays from the Sun or from the Screen
• Rays could be programmed to work in either direction
• We choose from the screen to the Light– Only X x Y Pixels to trace
• From the Light we would need to emulate Millions of Rays to find the few thousand that reach the screen
![Page 37: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/37.jpg)
Our Rays
![Page 38: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/38.jpg)
Center of Projection
(0,0)
![Page 39: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/39.jpg)
Viewport
(0,0)
Screen
Clipping Planes
![Page 40: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/40.jpg)
Into World Coordinates
(0,0)
Screen
Clipping Planes
![Page 41: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/41.jpg)
Getting Each Initial Ray
• Origin = (0,0,0)• Direction = ScreenX,screenY, zMin
– ScreenX, ScreenY are the float locations of each pixel in projected world coordinates
– zMin is the plane on which the screen exists
![Page 42: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/42.jpg)
Surface Materials
• Surfaces must have their Material Properties set– Diffuse, Reflective, Emissive, and Colour need to
be considered
![Page 43: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/43.jpg)
For Each Pixel (the main Raytrace loop)
For each pixel {
Construct ray from camera through pixel Find first primitive hit by ray Determine colour at intersection point Draw colour to pixel Buffer
}
![Page 44: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/44.jpg)
Intersections
• The simplest way is to loop through all your primitives (All Polygons)– If the Polygon Normal DOT RayDirection(Cos
Theta) < 0 // Face is opposite to Ray Ignore– Now we can Intersect the Ray with the Polygon– Or Intersect the Ray with the Polygons Plane
![Page 45: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/45.jpg)
Ray / Polygon Intersection
p0, p1 and p2 are verts of the trianglepoint(u,v) = (1-u-v)*p0 + u*p1 + v*p2U > 0V > 0U + V <= 1.0
![Page 46: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/46.jpg)
Line Representation
point(t) = p + t * dt is any point on the line p is a known point on the lineD is the direction vectorCombined:p + t * d = (1-u-v) * p0 + u * p1 + v * p2A Point on the line (p + t * d) which Is part of the triangle[(1-u-v) * p0 + u * p1 + v * p2]
![Page 47: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/47.jpg)
• http://www.lighthouse3d.com/opengl/maths/index.php?raytriint
![Page 48: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/48.jpg)
Intersections Suck!
• http://local.wasp.uwa.edu.au/~pbourke/geometry/planeline/
• http://www.netcomuk.co.uk/~jenolive/vect18c.html
• http://softsurfer.com/Archive/algorithm_0104/algorithm_0104B.htm#Line-Plane%20Intersection
• http://members.tripod.com/~Paul_Kirby/vector/Vplanelineint.html
![Page 49: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/49.jpg)
Intersecting a Plane
• A point on the Plane = p1• Plane Normal = n.• Ray = p(t) = e + td
P(t) = Point on RayE = OriginD = Direction Vectort = [(P1 – e) . n]/ d.n
![Page 50: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/50.jpg)
World / Object Coordiantes
• We need to translate the Ray into Object Coordinates / Vice Versa to get this to work
• Ray = p(t) = e + td• Ray = Inv (Object->World)e + t Inv (Object-
>World)d
![Page 51: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/51.jpg)
After Finding the Intersecting Plane
• You need a simple way to check for a hit or miss
• If your Object has a bounding box this can be achieved through a line check
![Page 52: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/52.jpg)
Miss Conditions
![Page 53: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/53.jpg)
![Page 54: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/54.jpg)
Hit Conditions
![Page 55: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/55.jpg)
For Other Shaped Flat Polygons
• An Even Number of Intersections with the Outside of the Polygon means a Miss
• An Odd Number of Intersections means a Hit
![Page 56: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/56.jpg)
Task List for Ray Casting
1) Create a vector for each Pixel on the screena) From the Origin of the Camera Matrix (0,0,0)b) That intersects with a Pixel in the screen
2) Use this Vector to create a trace through the World
a) From the Zmin to the Zmax Clipping Volumeb) UnProjected into World Coordinates
3) Intersect the trace with every object in the world
![Page 57: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/57.jpg)
4) When the ray hits an Object we need to check how the pixel should be lita) Check if the Ray has a direct view to each of the lights in the sceneb) calculate the input from each light.c) Color the pixel based on the lighting and surface properties
![Page 58: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/58.jpg)
One extra task for Ray Casting
• After Intersection Calculate the reflective Vector– Dot Product of Ray and Surface Normal
• Then cast a new Ray– This continues in a recursive fashion untill:
• A ray heads off into the universe• A ray hits a light• We reach our maximum recursion level
![Page 59: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/59.jpg)
How we would like to be able to calculate light
![Page 60: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/60.jpg)
Conservation of Energy
• A Physics-Based Approach to Lighting– Surfaces will absorb some light, and reflect some
light– Any surfaces may also be light emitting– Creating a large simultaneous equation can solve
the light distribution (I mean LARGE)– The light leaving a point is the sum of the light
emitted + the sum of all reflected light
![Page 61: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/61.jpg)
Don’t Scream (loudly)
![Page 62: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/62.jpg)
The Rendering Equation
http://en.wikipedia.org/wiki/Rendering_equation
Light Leaving Point X in direction
Light Emitted by Point X in direction
Integral over the Input Hemisphere
Bidirectional reflective function (BDRF) in the direction from direction ’
Light toward Point X from direction ’
Attenuation of inward light related to incidence angle
![Page 63: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/63.jpg)
The Monte Carlo Method
• Repeated Random Sampling• Deterministic Algorithms may be unfeasibly
complex (light)
![Page 64: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/64.jpg)
Metropolis Light Transport
• A directed approach to simplifying the BDRF• Still considered a Monte Carlo Method• It directs the randomness considering more
samples from directions with a higher impact on the point being assessed
![Page 65: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/65.jpg)
BDRF Tracing
http://graphics.stanford.edu/papers/metro/
![Page 66: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/66.jpg)
Metropolis Light Transport
http://graphics.stanford.edu/papers/metro/
![Page 67: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/67.jpg)
Radiosity
• Simplifying the Rendering Equation by making all surfaces perfectly diffuse reflectors
• This simplifies the BDRF function
![Page 68: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/68.jpg)
Ray Tracing and the GPU
![Page 69: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/69.jpg)
Adios Larrabee!
• http://www.thinq.co.uk/news/2010/5/26/intel-abandons-discrete-graphics/
![Page 70: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/70.jpg)
DIY CUDA (An Introduction to it!)
• Stolen From NVIDIA_CUDA_Tutorial_No_NDA_Apr08.pdf
![Page 71: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/71.jpg)
![Page 72: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/72.jpg)
![Page 73: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/73.jpg)
![Page 74: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/74.jpg)
![Page 75: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/75.jpg)
![Page 76: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/76.jpg)
![Page 77: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/77.jpg)
![Page 78: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/78.jpg)
![Page 79: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/79.jpg)
![Page 80: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/80.jpg)
![Page 81: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/81.jpg)
![Page 82: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/82.jpg)
![Page 83: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/83.jpg)
![Page 84: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/84.jpg)
![Page 85: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/85.jpg)
![Page 86: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/86.jpg)
![Page 87: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/87.jpg)
*GTX 260 : 192 CUDA Cores
![Page 88: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/88.jpg)
*GTX 260 : 192 CUDA Cores
![Page 89: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/89.jpg)
![Page 90: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/90.jpg)
![Page 91: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/91.jpg)
![Page 92: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/92.jpg)
![Page 93: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/93.jpg)
![Page 94: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/94.jpg)
Perhaps a better example
• This shows the scalability of CUDA arrays
![Page 95: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/95.jpg)
![Page 96: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/96.jpg)
![Page 97: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/97.jpg)
![Page 98: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/98.jpg)
![Page 99: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/99.jpg)
![Page 100: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/100.jpg)
![Page 101: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/101.jpg)
![Page 102: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/102.jpg)
![Page 103: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/103.jpg)
![Page 104: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/104.jpg)
CUDA References to get you going
• http://llpanorama.wordpress.com/cuda-tutorial/
• http://users.ece.gatech.edu/~lanterma/mpg08/
![Page 105: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/105.jpg)
The main CUDA point:
• Compute Shaders follow the same logic• You’ll need to be epic with compute shaders to be
highly desirable in industry• It’ll give you massive credibility in Cluster Software
development– A lot of clusters are moving toward GPU horsepower
• High Performance Computing =– Technical Proficiency– Lots of cash– Games Related Knowledge gives you an extreme edge
over other parallel programmers
![Page 106: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/106.jpg)
DIY Farming by Bungie
• http://www.bungie.net/images/Inside/publications/presentations/Life_on_the_Bungie_Farm.pptx
![Page 107: CSE3AGT – Zones Portals and Anti-Portals, Fog and Ray Tracing Paul Taylor 2010](https://reader035.vdocuments.site/reader035/viewer/2022062511/551a7d50550346761a8b4eba/html5/thumbnails/107.jpg)
References
• http://developer.nvidia.com/object/Implementing_Fog_Direct3D.html
• http://www.hourences.com/book/tutorialszoning.htm