Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 1.09 KB

README.md

File metadata and controls

32 lines (20 loc) · 1.09 KB

go-simple-ray

go-simple-ray is a very basic raytracer used as a learning exercise. It's limitations:

  • No proper lighting.
  • Minimal reflection and refraction implemented.
  • Only objects to be handled are spheres since the maths for sphere -> ray intersection is very simple

Scenes:

go-simple-ray uses JSON to describe scenes. Scenes are composed of the following:

  • eye - the cameras position
  • objects - a list of objects (spheres)
  • lights - a list of lights
  • ambientLight - the global illumination (a light)

Spheres contain:

  • a position (x, y, z), a radius (r), a color (r, g, b) and a diffuse component (a, b, c)

Lights contain:

  • A light contains a position (x, y, z) and a color (r, g, b)

This is a VERY basic raytracer, but i think it's quite clean, and could be used by someone to learn.

Example output:

Flowers

Resources