This page documents my exploration with ray marching. I have worked extensively with 3D rendering, and written all kinds of code for various things, even generating 3D geometry, however it has always been a dream of mine to write my own 3D render engine from scratch. This is topic is one that I am simply exploring with no final goal in plan. I'll explain a bit about what is happening alongside renders of the various states. Jump to the bottom of the page for the current and most advanced state. I'd like to give a huge thanks/reference to Inigo Quilez for providing fantastic reference material for this kind of work.
This program was written entirely in Processing and uses a ray marching algorithm and signed distance fields.
The first bits take so much work getting the structure of the objects and rendering algorithm all working together before you get to see any results, but finally, here is a circle!
Adding a light. Now parts of the sphere that are occluded by itself are in shadow.
I wanted everything to fit inside of a box because I think its cool and it helps keep my code efficient because the rays never have to travel too far. Lighting is still either on or off, so you can't really see that its a box other than the corner in the shadow.
Added some falloff to the light so points closer to the light receive more... light.
Added more primitives to the scene. More importantly, I started doing some Monte Carlo rendering to get soft shadows. The noise is just from not sampling enough... but that takes lots of time to do!
Added secondary bounces to the rays that grab light and color data.
Added Monte Carlo rendering to the camera for anti-aliasing and depth of field.
Created system for saving and generating different scenes. Started rendering more complex scenes.
Added system for transform matrixes in order to rotate the camera. Also implemented some optimization by pre-computing which objects a ray might hit so it only check those objects for intersections instead of every object in the scene.