Download presentation
Presentation is loading. Please wait.
1
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff
2
Overview What are rasterization and ray tracing Why rasterization is King How rasterization works – Pros/Cons How ray tracing works – Pros/Cons Conclusion Questions?
3
What is rasterization and ray tracing? Rasterization – Given a set of rays and a primitive, efficiently compute the subset of rays hitting the primitive Ray Tracing – Given a ray and a set of primitives, efficiently compute the subset of primitives hit by the ray
4
Why rasterization is King Early 80’s – Development was being done on several graphical visualization techniques, but the two major were rasterization and ray tracing. – Ray tracing involved complex and time consuming calculations – Rasterization was relatively simple and required little computation time Bottom line: Cost of hardware
5
How rasterization works
6
Application – This is the application that has the information about what is to be rendered. – Sends information about vertex locations of scene to graphics hardware.
7
How rasterization works Vertex shader – Collects information about vertices one triangle at a time – Multiple vertex shaders in parallel – Gathers X, Y, and Z information for each vertex – Also gather light information if object is directly lit by a source – Optimization: Z-culling
8
How rasterization works Rasterizer – Converts vertex information into pixel representation
9
How rasterization works Shader – Most difficult stage – Multiple pixel shaders in parallel – Two primary methods; shadow maps and shadow volumes – Texture filtering – Bump mapping
10
How rasterization works Framebuffer – Memory structure that holds final information and is sampled for display – Multiple ways to sample – May or may not update all pixels (if no update)
11
Example of shadow volumes
12
Rasterization Pros – Hardware is ubiquitous. – Hardware is inexpensive. – Primary real-time graphics method, therefore, lots of people developing new techniques and improving all the time. – Rasterization pipeline has evolved to be more flexible allowing for new techniques to be developed. Cons – Difficult to render realistic images. – Requires new and complex algorithms to solve simple problems like shadows, light, and reflection. – Large memory requirements.
13
How ray tracing works
14
Ray-generation – Creates a ray that will travel into or through the scene – May be called by the shading stage
15
How ray tracing works Ray-traversal – This step follows the ray through the scene until a possible intersection is detected – Scene stored in a 3D structure, as ray passes through, queries to see if primitives exist within distance of ray
16
How ray tracing works Intersection – Calculates if the ray actually intersects a primitive – If it intersects, move on to shading; if not, go back to ray traversal
17
How ray tracing works Shading – Most complex stage. – Gathers all data and finalizes pixel color – Calls ray-generation to create reflection/refraction rays and shadow rays – Writes to the frame buffer
18
How ray tracing works Framebuffer – Memory structure that holds final information and is sampled for display – Multiple ways to sample – May or may not update all pixels (if no update)
19
How ray tracing works
20
Image rendered using ray tracing
22
This scene was rendered with a Nvidia GTX 480 using Nvidia’s OptiX ray tracing engine – 1920x1080 resolution – The GTX 480 is capable of processing 48 million rays/s. – Runs at a stunning 4.5 fps!
23
Ray Tracing Pros – Can create extremely realistic images – Follows line-of-sight so only calculates what can be seen – Shadows can be calculated accurately at time of rendering Cons – Time consuming – No real ray-tracing focused hardware
24
Conclusion Ray tracing isn’t ready for real-time yet. Potential to combine techniques for more realistic images without sacrificing a lot of performance. More focus on hardware and algorithms could result in real-time ray tracing.
25
Questions?
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.