Skip to content

Visualize simple ray-tracing by representing sampling ray with line

Notifications You must be signed in to change notification settings

SorasitWang/ray-tracing_visualize

Repository files navigation

ray-tracing_visualize

Visualize ray-tracing by representing sampling ray with line.

  • Trace light ray (shadow ray) to check whether this fragment can reach the light source.

  • Set object's material :

    • Phong's color : compute local color (+light source color)

    • Flectiont&fraction coeffiecent : determines the weight of color from reflect&refract ray

    • Index : Snell's law

  • Continuously draw ray.

Further Improvement

  • Performance : should not be memoryless (trace ray every frame).
  • Realtime user interaction : ray origin, object material&position.
  • Text label : display each ray properties.
  • Problem with no-thickness surface

Scene 1 :

  • Point light + shadow map + cube with reflect&refract property, max ray depth = 2.
  • Black light ray means can not reach the light source.
  • White sampling ray mens intersect with on one.

ray_scene0

Scene 2 :

  • Point light + 3 mirrors + opaque object (the yellow one), max ray depth = 6.
  • Draw object in wireframe mode for displaying purpose.
  • All refract rays are white.
ray_scene1.mp4

Scene 3 :

  • Point light + sphere with reflect&refract property, max ray depth = 2.
  • Color of light ray represents the color from Phong's model from that light source.
  • Also, color of sampling ray represents color from it's children.
ray_scene2.mp4

About

Visualize simple ray-tracing by representing sampling ray with line

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published