----------------------------------- apython1992 Sat Jul 09, 2011 7:26 pm Bugs are sometimes cool. ----------------------------------- Yeah I'm submitting a bug. I'm starting to work on lighting and shading in my raytracer, and part of that is determining whether an object is in shadow or not. To do this, you need to see if any objects are blocking the light source from a point on the object. My method right now includes seeing if the light source is "in front of itself" (this is the bug, I just haven't fixed it yet), but it ended up producing a kind of cool picture due to the inaccuracy of floating point numbers. Cool! ----------------------------------- RandomLetters Sat Jul 09, 2011 8:46 pm RE:Bugs are sometimes cool. ----------------------------------- I think you have just found a new way of generating cloud textures like that in photoshop :P http://www.photoshopessentials.com/images/elements/8/photo-effects/light-rays/photoshop-elements-clouds.jpg It looks completely random too. ----------------------------------- DemonWasp Sun Jul 10, 2011 1:10 am RE:Bugs are sometimes cool. ----------------------------------- The method photoshop uses is almost certainly unrelated; it's called "midpoint displacement": http://www.gameprogrammer.com/fractal.html The noise generated is also not random, though it does look like it. In particular, if camera and light source both lie on the normal of a plane, and the camera looks directly at the plane, you should see an interesting artifact (neither square nor circle, but something similar). apython, mind seeing if i'm right on that one? ----------------------------------- apython1992 Sun Jul 10, 2011 10:23 am Re: Bugs are sometimes cool. ----------------------------------- This is the shot taken (had to re-create the bug) suggested by DemonWasp. I used the exact same scene definition, with the light source placed on the plane's normal in line with the camera. I think the noise was really just because of floating point numbers (sometimes the light may be considered "blocking itself", other times it won't). ----------------------------------- DemonWasp Sun Jul 10, 2011 3:03 pm RE:Bugs are sometimes cool. ----------------------------------- Well, that isn't what I would have predicted. You're absolutely correct that it was floating-point errors, but I would have expected a kind of circular or square pattern, not the pattern we see here (the pink object is always shadowed by itself, the blue sphere is never shadowed by itself).