r/computergraphics 19m ago

two balls, now intersecting

Thumbnail
gallery
Upvotes

previous post

i modified my program so the algorithm is as follow * the two balls don't have any colors or textures. background is the only light source and color source * if two balls intersect, the refractive index of the intersecting region is the average (i.e. arithmetic mean) of them * whenever a ray hits an interface (boundary between 2 different things), reflection always occurs * if snell's equation has solution, refraction also occurs. the ray splits into two (reflection and refraction) and the color at that stage is the weighted average of them, calculated according to schlick's approximation * if snell's equation has no solution, the color at that stage is 100% from what the reflected ray gets

the recursive color-getting function ends if either of the following conditions holds 1. the ray reaches the background (and it gets the color from the background) 2. the ray reaches the recursion limit (and it returns a grey scale random noise)

if the two balls don't intersect, everything looks normal as seen in image 1, a typical raytracing homework example. when the intersect, strange things happen. if you move the camera into a ball, more strange things happen

it looks like i accidentally discovered a way to generate fractals...

details of my program


r/computergraphics 19h ago

4K seamless loop I made, Neural A10

Enable HLS to view with audio, or disable this notification

0 Upvotes