filmov
tv
Real Time Raytracing with GLSL Shader

Показать описание
Raytracing shader that I wrote for an assignment at DigiPen. Took about a day and a half to do.
Features:
- Recursive Ray Tracing
- Reflection and transmission achieved by recursively casting rays (4 levels)
- 2 BRDFs, Dielectric and Phong
- Only spheres supported (walls are really large spheres)
- Real time hard shadows
- Cast a ray to each light source to determine occlusion
Scene Details:
- 2 Light sources (small white ball in centre of room, player controls yellow ball which is also a yellow light source)
- 3 small balls with phong and reflectivity
- 2 Dielectric balls, one with high transmission, another with high reflectivity
Implementation:
- Raytracing performed in a GLSL shader
- Object data passed in as arrays of uniforms each frame
- Full screen quad drawn over screen
- UV coords of quad used to generate rays for screen
- 60 FPS on demo scene of a mid-range laptop
- Performance highly dependent on how many screen fragments are reflective/transmissive (non-reflective surfaces do not cast additional rays)
Features:
- Recursive Ray Tracing
- Reflection and transmission achieved by recursively casting rays (4 levels)
- 2 BRDFs, Dielectric and Phong
- Only spheres supported (walls are really large spheres)
- Real time hard shadows
- Cast a ray to each light source to determine occlusion
Scene Details:
- 2 Light sources (small white ball in centre of room, player controls yellow ball which is also a yellow light source)
- 3 small balls with phong and reflectivity
- 2 Dielectric balls, one with high transmission, another with high reflectivity
Implementation:
- Raytracing performed in a GLSL shader
- Object data passed in as arrays of uniforms each frame
- Full screen quad drawn over screen
- UV coords of quad used to generate rays for screen
- 60 FPS on demo scene of a mid-range laptop
- Performance highly dependent on how many screen fragments are reflective/transmissive (non-reflective surfaces do not cast additional rays)
Комментарии