Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Build a Ray Tracer (Graphics) from Scratch
Rating: 3.9 out of 5(7 ratings)
101 students

Build a Ray Tracer (Graphics) from Scratch

Building a simple toy ray tracer - 3D Graphics from scratch
Created byMuhammad Ahmad
Last updated 9/2021
English

What you'll learn

  • Ray Tracing
  • Realistic Graphics
  • Graphics
  • Monte Carlo Path Tracing

Course content

1 section8 lectures1h 8m total length
  • Introduction2:38

    learn the fundamentals of ray tracing from scratch, contrast true light simulation with emulation, and implement triangle and sphere primitives, area lights, and color-driven shadows while addressing performance.

  • Setup and Hello World9:46

    Set up an empty C++ project, configure GLM and the simple fast media library, and build a windowed hello program to render a blank image incrementally.

  • Triangle Primitive23:58

    Implement the triangle primitive as the building block for the ray tracer, compute its normal and intersection, and render a floor composed of triangles.

  • Sphere Object8:10

    Add a sphere object to the ray tracer, implement its hit function using the quadratic discriminant to find intersections, compute normals, and render with basic lighting.

  • Direct Lighting11:19

    Learn to implement direct lighting in a ray tracer using Monte Carlo path tracing, sampling many rays, handling emissive light sources, and modulating brightness for realistic shadows.

  • Indirect Lighting4:36

    Implement indirect lighting by recursively tracing rays to simulate bounced light and softer shadows, using random directions, normals, dot products, and color attenuation to achieve realism.

  • Cornell Box6:01

    Create a Cornell box scene by adding a ceiling and red left wall and green right wall, showing color bleed and bloom while rendering with a thousand samples for realism.

  • Final1:46

    This final lecture explains current issues with implementing transparent and metal like materials, postpones them for now, and promises future additions, while highlighting high-quality renders and a diffuse lighting focus.

Requirements

  • C++

Description

We will be implementing a simple toy ray tracer in this course.


Ray tracing is a very important 3D graphics rendering technique. We normally emulate how light works: we emulate the fresnel effect, emulate bounce lighting, emulate global illumination, and so on.


With ray tracing we "simulate" light: we follow light how it actually operates in the real world (but with a twist). As such we get a lot of effects for free:

- Colour Bleed

- Bloom

- Ambient Occlusion

- Realistic Shadows

- Shadow Fallout

- Diffuse Materials


All of these would take a lot of code to emulate but as you will see in this course, these can be implemented very easily using ray tracing.


In this course we will be doing the following:


1) Implement a triangle primitive (you can use this to render OBJ meshes as a challenge)

2) Implement sphere primitive

3) Implement area lights

4) Implement direct lighting for diffuse materials

5) Implement indirect lighting for diffuse materials

6) Render a variation of the famous Cornell Box scene


If you love making things from scratch, you will love this course. In a little over an hour, you will make your own ray tracer from scratch. This course is oriented towards beginners and so should be easily picked up by anybody.

Who this course is for:

  • Beginner to Intermediate developers who have working knowledge of C++