RIVEREND bespoke animation suite in Common LISP
Oooh what a fancy tagline
This code was originally born from the raytracing exmaple given in Paul Graham’s ANSI Common LISP
The structure of the project is roughly as follows:
- tracer.lisp contains a raytracing function and some helpers to do the job
- tri.lisp and ball.lisp are files with class definitions for tri and ball, as well as
normal
andintersect
generic functions. They are bothsurfers
- Tracer will render the environment modeled by the \*world\* list by cycling through it, for each ray, and calculating the closest intersection.
- colors contains functions for generating and managing colors. Need to move some stuff from env to colors.
- env has all sorts of auxilliary functions for actually generating scenes.
- We still aren’t propertly rendering to a video stream. There is undoubtedly a way to do that, though.
Sooo, I want to have lighting functions include things like movable lights, multiple lights, spot lights, varying intensity, and shadows. This means building a light object, and modifying lambert
to compute brightness by finding which lights hit that point, and at what intensities, and then computing shine/reflection.
Then of course, it’d be nice to change brightness and color according to material properties of the other places the ray goes. I haven’t thought too much about how the rest of this would go.
The weird thing is that after the first surface, there’s no single ray to go look at, is there? You’re kind of interested in the whole environment. Does that you have scan all vectors with non-negative dot products with the normal of the tangent surface? That’s waaay too many calculations.
I’ll worry about this at a later date.
Write now I’m trying to use what I’ve learned about CLOS to replace structures with objects. Hopefully this will facillitate advances in geometry specification/typing.
At some point I should look into making macros to implement TBAG geometry.
I’d love for the process of using this to involve a proper gui window that updates frames, and maybe implements a simple frame-browser. My workflow now is pretty janky.