Lecture 06: What is the ray tracing. Camera rays

Computer graphics in Game development

Ivan Belyavtsev

6.11.2020

Administrative: Home work&deadlines

Rasterization labs

  • Official due date: Saturday, 7 November 2020, 12:00 AM
  • Feel free to ask questions via Telegram

Template for the second part of labs

github.com/djbelyak/basic-of-ray-tracing

Basics of rasterization recall

Idea

  1. Create the world as 3D polygons (triangles)
  2. Project the geometry to 2D plane
  3. Rasterize each peace of geometry

Basics of rasterization recall

Pros

  • Great math underlying
  • Low computational complexity
  • Clear flow

Basics of rasterization recall

Cons

  • Hard to compute lighting
  • Hard to compute shadows
  • Hell with blending and transparency

Idea of ray tracing

From: [1]

Mathematical definition of ray

\[Ray=origin+t*\vec{direction}\]

\[t>0, |\vec{direction}| = 1\]

Pinehole camera

From: http://commons.wikimedia.org/wiki/Image:Pinhole-camera.png

Camera ray

From: https://www.gamedev.net/forums/topic/587264-ray-generation-with-rotated-camera/

[2]

Basic ray tracing scheme

From: [3]

“Ray generation” experiment

TODO

  • Implement camera rays
  • Implement miss function

“Ray generation” experiment

Reference

From: https://github.com/djbelyak/basic-of-ray-tracing

“Ray generation” experiment

What is the new knowledge?

  • Primary ray color defines color of pixel
  • Primary rays make a camera frustrum
  • Miss function returns background color

References

1.
McGuire M. The graphics codex. 2.14 ed. Casual Effects, 2018.
2.
Shirley P. Ray tracing in one weekend. second. Amazon.com Services LLC, 2019. Vol. 1.
3.
Lefrançois M.-K., Gautron P. DX12 raytracing tutorial - part 2 [Electronic resource]. URL: https://developer.nvidia.com/rtx/raytracing/dxr/DX12-Raytracing-tutorial-Part-2.
// reveal.js plugins