Real Time Raytracing with GLSL Shader

preview_player
Показать описание
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)
Рекомендации по теме
Комментарии
Автор

What the hell are they teaching at my university?

AdrianBermea
Автор

Nice demo! Looks very cool!: I was wondering! How did you handle the recursion in GLSL because for me it doesn't work!

christianveenman
Автор

it looks awesome! will you sell it or share it ? i'd love to check out the code.

AcidGnom
Автор

Could I borrow your shaders sir ? PLEEEZE ?

_msnnanbakbshhsn
Автор

Any chance I can get the code for this?

souslicer
Автор

or maybe u at least can recommend something to read to implement all these things.
:>

AcidGnom
visit shbcf.ru