Vulkan: Raytrace / Raytracing

Peter Shirley
Ray Tracing in One Weekend
Ray Tracing: The Next Week
Ray Tracing: The Rest of Your Life

  • eye / camera
  • image
  • 16:9 aspect ratio
  • viewport =
  • viewport’s aspect ratio == rendered image aspect ratio
  • viewport: 2 units in height
  • projection plane
  • projection point
  • distance between plane and point: 1 unit = focal length


difference between global operator and member operator


Ray-triangle intersection (PDF)
Fast Minimum Storage Ray-Triangle Intersection
How to get the intersection point? Ray Triangle Intersection C++
WebGL 2.0 : 044 : Ray to Triangle Intersection

Depends on, stb single-file public domain libraries for C/C++

OpenGL Frameworks

OpenGL Loading Library
An OpenGL Loading Library is a library that loads pointers to OpenGL functions at runtime, core as well as extensions. This is required to access functions from OpenGL versions above 1.1 on most platforms.

  • GLEW (OpenGL Extension Wrangler)
  • GL3W
  • Galogen
  • glad (Multi-Language GL/GLES/EGL/GLX/WGL Loader-Generator)
  • Glatter
  • glsdk (Unofficial OpenGL SDK)
  • glbinding (C++)
  • libepoxy
  • GLee

GLFW, GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan development on the desktop
GLUT (GL Utility Toolkit)
What is the difference between FreeGLUT vs GLFW?


WGSL, WebGPU Shading Language




The OpenGL Utility Toolkit (GLUT) Programming Interface API Version 3
7 Callback Registration

Scratchapixel 2.0

Learn Computer Graphics From Scratch!
The Perspective and Orthographic Projection Matrix
Ray Tracing: Rendering a Triangle – Why Are Triangles Useful?
Ray Tracing: Rendering a Triangle – Ray-Triangle Intersection: Geometric Solution
A Minimal Ray-Tracer: Rendering Simple Shapes – Ray-Sphere Intersection
Rasterization: a Practical Implementation

  • The Rasterization Algorithm
  • Optimizing: 2D Triangles Bounding Box
  • When Two Triangles Overlap the Same Pixel: The Depth Buffer (or Z-Buffer)

Chapter 1: Getting Started

Nikita Voloboev

Ray Tracing – Links

Canvas + WebGL

How to render 3D in 2D canvas


HTML Canvas Graphics
HTML Canvas Reference

MDN Web Docs

Einführung in WebGL
Canvas tutorial


Evaluating Different Spatial Anti Aliasing Techniques


Kantenglättung Anti-Aliasing erklärt – Guide: Wie funktionieren MSAA, TXAA und Co.?
Best Anti-Aliasing | Different Techniques to Get Clear Images
What is Anti-Aliasing: A definitive guide
PC Graphics Settings Explained: MLAA vs MSAA vs FXAA vs TAA vs SMAA

RayTracingInVulkan, Implementation of Peter Shirley’s Ray Tracing In One Weekend book using Vulkan and NVIDIA’s RTX extension.

nvpro-samples, Denoising a Vulkan ray traced image using OptiX denoiser, Ray tracing glTF scene with Vulkan, Vulkan ray tracing examples and tutorials using VK_NV_ray_tracing

Vulkan Tutorial

Vulkan Tutorial



FlyCube, Graphics API wrapper is written in C++ on top of Directx 12 and Vulkan. Provides main features including ray tracing.

Research Unit of Computer Graphics | TU Wien, Powerful low-level C++20 rendering framework for Vulkan 1.2, including Real-Time Ray Tracing (RTX) support, built atop Auto-Vk., Low-level convenience and productivity layer atop Vulkan-Hpp

Window System Integration (WSI)

Qt Graphics
Introducing the Vulkan WSI Layer (PDF)

NamePointer / carl-vbn
Making a 3D Gravity Simulator with OpenGL (Part 1)
Adding Camera movement and User Interface to my 3D Gravity Simulator
LinkedIn: Carl von Bonin

Daniel Elwell / frozein

The First 3 Months Developing My VOXEL RAYTRACING Engine

Dr. Anton Gerdelan

Anton’s OpenGL 4 Tutorials

Foundations of Game Engine Development

Foundations of Game Engine Development
Foundations of Game Engine Development: Figures


Brendan Galea

Vulkan (c++) Game Engine Tutorials

Vulkan vs. OpenGL

GDC 2018 – Getting explicit: How Hard is Vulkan really?
What Is Vulkan & Why Should Gamers CARE?
DirectX 12 & Vulkan as Fast As Possible
DCS: What is Vulkan API?
Vulkan vs OpenGL | Getting into Computer Graphics | OpenGL CUDA Interop | Cuda Education
What is Vulkan?
Should you learn Vulkan(C++)? Can beginners learn it?
Vulkan Tutorials [Deutsch]


OpenGL vs Vulkan
Open GL (Default) VS Open GL (Skia) VS Vulkan (Skia) Antutu Benchmark

Window System Integration (WSI)

XDC 2019 | Introducing the Vulkan WSI Layer – Rosen Zhelev


Intro To Modern OpenGL Tutorial (2014)

Game Dev Academy

What is a Graphics Pipeline? Featuring DirectX 11
hat is a Shader? | Pixel and Vertex Shaders


What Are Shaders?
Writing a Shader in OpenGL
How Shaders Work in OpenGL
Vertex and Fragment Shaders – Interactive 3D Graphics
What Is A Shader? UE4 Materials 101 – Episode 1
1. What is a shader? What is GLSL? Why are they useful in games – Shader Course
Shaders 101 – Intro to Shaders
Shader Basics, Blending & Textures • Shaders for Game Devs [Part 1] (Unity)


Computer Graphics 2.7: Aliasing and Anti aliasing Techniques
Antialiasing – Interactive 3D Graphics


Fun With WebGL 2.0
WebGL 2.0 : 044 : Ray to Triangle Intersection

RuhrJS Conference

RuhrJS 2018 – Martin Splitt – Creative experiments with WebGL shaders in JavaScript


Intro To Modern OpenGL Tutorial (Playlist)


Building Collision Simulations: An Introduction to Computer Graphics

The Cherno

OpenGL (Playlist), last update 2020
Welcome to OpenGL
Vertex Buffers and Drawing a Triangle in OpenGL
ImGui in OpenGL

OpenGL Course – Create 3D and 2D Graphics With C++

Joshua Shucker

Planet Vulkan (Playlist)
Episode 7.5 – Graphics Pipeline Overview


I created my own Ray Tracing Engine from scratch

NVIDIA Developer

Arun Ravindran ArunRocks

Building a Ray Tracer in Python – Part 1 (Points in 3D Space)

First Principles of Computer Vision

Radiometry and Reflectance | Photometric Stereo | Shape from Shading (Playlist)

Introduction to OpenGLES and GLSL programming
NOT in this talk:

  • Clipping
  • Vendor Extensions
  • Geometry Shaders
  • Lightning
  • Stencils
  • Framebuffer Objects
  • Culling
  • Framerate
  • Tesselation Shaders
  • Quaternions
  • Shading
  • Blending


  • API for rendering 2D and 3D Computer Graphics
  • Developed by SGI in 1992
  • Open Standard, now maintained by Khronos Group consortium
  • Used in CAD, Games, VR/AR, etc…


  • OpenGL for Embedded Systems
  • Implementations by nvidia, AMD, etc.
  • Available on Windows, MacOSX, Linux, iOS, Android, etc.
  • Bindings for C, C++, Java, C#, Python, Ruby, Go, etc.
  • Latest version OpenGL ES 3.2 (2019)
  • … but anything from OpenGL ES 2.0 onwards is cool!


  • Native Platform Interface
  • Creates & Configures OpenGL ES Context (view/window/fullscreen)
  • Your platform might come with something else (Mesa, WGL, CGL, GLX, etc.)


  • Describe our geomentry in world coordinates (3D)
  • Rasterizer projects it onto a projection plane (2D) => your screen
  • Geometry in projection plane are now called fragments
  • For each of the triangles, we figure out how we wan to color them
  • If we have a triangle on that surface with 3 colors, the rasterizer will interpolate the values between the colors (pixel by pixel)
  • Vertex- and Fragment-Shader go the projection and the texture mapping
  • When you render a scene, the vertex shader is responsible for taking all your geometry and transforms/moves/scales it. Then it’s passed to the Rasterizer stage that does the real projection, figuring out which vertices end up on the 2D surface (plane) => output: fragments.

GLSL Shader Language

  • C-like syntax
  • Vector and Matrix types (float, vec2, vec3, vec4, mat4, etc.)
  • Built-in math functions (sin, cos, exp, sqrt, dot, cross, etc.)
  • No recursion
  • Limited loops

Vertex Shader

  • Runs once for each vertex of each triangle of the geometry
  • Get per-vertex input from attribute
  • Global parameters: get parameters from uniform: projection from camera
  • Pass output to fragment shader in varying
  • Pass position vector to rasierizer pipeline in gl_Position (magic variable)

Fragment Shader

  • Runs once for each fragment of each rasterized triangle
  • Sets the final color for each fragment
  • Get per-vertex input from varying
  • Get parameters from uniform: get texture data from uniform sample2D
  • Pass color vector to fragment pipeline in gl_FragColor


  • Vectors describe coordinates
  • Matrices describe transformations

Vector Operations

  • Scalar Multiplication / dot-product: alpha = acos(dot(u,v))
  • Vector Multiplication / cross-product: n = cross(u,v)

Transformation Matrices

  • Translate
  • Rotate
  • Scale

Projection Matrix (perspective vs. orthographic)

Matrix Operations

  • Multiplication of a vector with a matrix: transformed vector
  • Multiplication of a matric with a matrix: chained transformation, Raspberry PI OpenGL Epics Toolkit
Experimental Physics and
Industrial Control System, EPICS Home at Argonne

EPICS – Experimental Physics and Industrial Control System


OpenGL with C++ (Playlist)
Vulkan with C++ (Playlist)
OpenGL with Python (Playlist)
OpenGL with Python – Vertex Buffer Objects and Vertex Array Objects

OGLdev – Modern OpenGL Tutorials

OGLdev – Modern OpenGL Tutorials

  • World Coordinate System
  • Local Coordinate System
  • Object Coordinate System
  • Object Space
  • View Transformation
  • Camera Transformation
  • Eye Transformation
  • Camera Coordinate System
  • View Coordinate System
  • Camera Space
  • View Space
  • Eye Space
  • Perspective Projection
  • Perspective Projection Matrix
  • = Clip Coordinate System
  • = Clip Space
  • Perspective Division
  • Range -1 ro +1 on all axes
  • = Normalized Device Coordinates (NDC)
  • Viewport Transformation
  • = Window coordinates (ex. 1920 x 1080)
  • Multiply all matrices to a single matrix
  • = WVP / MVP
  • UVN camera
  • Location / Position (x, y, z)
  • Orientation in UVN axis system
  • N vector = eye to world
  • V vector = up-vector/li>
  • U vector = right-vector/li>

David Parker (2011 – 2013)

OpenGL Screencasts and Tutorials


How to Code Minecraft (GLFW & Glad)

Dustin Biser

Quaternion Camera Demo – (C++, OpenGL)
Shadow Mapping Demo
GPU Smoke Simulations


LinkedIn Dustin Biser (Arcball)

Victor Gordan

OpenGL Tutorials, 13.08.2021 (Playlist)


LinkedIn Victor Gordan

Michael Grieco

C++ OpenGL Tutorial (Playlist)
2D Pong (C++ OpenGL) (Playlist)

LinkedIn Michael Grieco

Thomas Sheppard (Galway-Mayo Institute of Technology, Ireland)

Introduction to perspective projection

Build Succeeded (Direct2D)

C++ Win32 Direct2D



Math for Game Developers: Perspective Projection Matrix


Projection in Computer Graphics



How to make a 3D projection in Python | Rendering a cube in 2D! (No OpenGL)



Parallelizing GPU-intensive Workloads via Multi-Queue Operations using Kompute & Vulkan


GPU computing in Vulkan, The ultimate way to parallel computing using Vulkan API.
Learn the Vulkan API with C++, Learn the fundamentals of the popular Vulkan API for modern graphics rendering using C++!

Learn OpenGL

Advanced Lightning

Normal Mapping

TBN matrix

  • Tangent,
  • Bitangent and
  • Normal vector


GLEW linking

1>OpenGLBook_Chapter1.obj : error LNK2001: unresolved external symbol __imp__glewGetErrorString@4
1>OpenGLBook_Chapter1.obj : error LNK2001: unresolved external symbol __imp__glewInit@0
1>C:\Users\bacr\source\repos\FreeGLUT_example2\Release\FreeGLUT_example2.exe : fatal error LNK1120: 2 unresolved externals

1>OpenGLBook_Chapter1.obj : error LNK2001: unresolved external symbol _glewGetErrorString@4
1>OpenGLBook_Chapter1.obj : error LNK2001: unresolved external symbol _glewInit@0
1>C:\Users\bacr\source\repos\FreeGLUT_example2\Release\FreeGLUT_example2.exe : fatal error LNK1120: 2 unresolved externals

>dumpbin -headers glew-2.1.0\lib\Release\Win32\glew32.lib | findstr /c:"  Symbol name  : _glewInit"
  Symbol name  : _glewInit@0

Tools for inspecting .lib files?
Problems with glew library and glewinit() function
About the use of glew library (unresolved external symbol __imp__glewInit @ 0)
Glew in VS 2010: unresolved external symbol __imp__glewInit
OpenGL: How to compile glew32.dll from source file

Build started...
1>------ Build started: Project: FreeGLUT_example2, Configuration: Release Win32 ------
1>Generating code
1>Previous IPDB not found, fall back to full compilation.
1>All 16 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
1>Finished generating code
1>FreeGLUT_example2.vcxproj -> C:\Users\bacr\source\repos\FreeGLUT_example2\Release\FreeGLUT_example2.exe
1>        1 Datei(en) kopiert.
1>        1 Datei(en) kopiert.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========



io7m-r1 0.10.0 Documentation
Normal Mapping


com.io7m.r2 0.3.0-SNAPSHOT Documentation, Aggressively minimalist deferred renderer


Framebuffer Object (FBO)
Vertex Buffer Object (VBO)
Immediate Mode
Retained Mode
Z-Buffering (auch Depth Buffering, Tiefenpuffer)
Rasterung von Polygonen

Microsoft Docs

Retained Mode Versus Immediate Mode

OpenGL Documentation


gluPerspective — set up a perspective projection matrix
gluLookAt — define a viewing transformation


docs.GL (only OpenGL, no utility functions!)


OpenGL Programming/Modern OpenGL Tutorial Arcball
How to implement a simple Arcball Camera
Arcball Controller
User controlled rotation with arcBall
arcball controls with Qt, and OpenGL

Mario Konrad

OpenGL: Tutorial 8 – ArcBall
Tutorial: OpenGL



C# vs. OpenGL (Tao.Framework) – Arcball Rotation with zoom and pan
OpenGL Arcball Test
Arcball Test in C++ and OpenGL with a custom math library

Focal length

FocalLength to Fov formula in OpenGl
How to set focal length in OpenGL^_^
is focal length equal to the distance from the optical center to the near clipping plane- openGL
P2 vs projection plane

Leave a Reply

Your email address will not be published. Required fields are marked *