/* Scene for POVRay Short Code Contest, Round 4 * Copyright 2006 Mike Kost * mike@tashcorp.net * http://povray.tashcorp.net */ /* Very frustrating, but it turned out that it was more verbose to move the scene in front of the default camera than it was to just move the camera. That, or I'm not creative enough. Either way - frustrating. */ camera { location 49 look_at 0 } // The light source needs to be in the middle of the boxes, so <15,15,15> = 15 light_source{ 15 1.4 } /*** High quality rendering *** *light_source {15, 1.2} */ #local a=0; #local b=seed(5); #while(a<300) box{ -1,1 // pigment { color rgb 0 } is inferred by povray /* The boxes are only made reflective. By having a black pigment (default) it's possible to ignore all the other finish properties like ambient and diffuse */ finish{ reflection 1 } translate 30*} #local a=a+1; #end box{ -99, 99 /* High quality rendering * * -999, 999 */ /* By placing the camera inside the box (it's hollow), I didn't have to make the box's pigment transparent as is usually done for isosurfaces */ interior{ media { /* It was annoying that default media settings were not sufficient to get a good image. It took a samples/intervals > 10 to be reasonable, so 99 becamse the default. 'Intervals' was used for esthetics and since the code was under 255 bytes even though the word is longer than 'samples' */ intervals 99 /* High quality rendering * * samples 20 */ scattering {1,.01} // density { function {1} } is inferred by Povray } } hollow } /* Once I had established the media effect I was looking for, the trick was throwing out all the non-critical elements necessary to get it down below 256 bytes. The good variations in the light/media interaction was the priority. I started with a more symmetric and organized pattern for the shapes, but all the macro scripting was byte-expensive. Boxes were the cheapest shapes, and a random distribution produced a good media effect. I ended up writing a (python) script to render lots of different seed value for 'b' so that I could search for a pleasing media effect. Tekno Frannansa's City scene (verbose sdl version) from Round 3 had several good tips for tweaking the last few bytes from code. Several elements inferred by Povray that were helpful are noted above. I've also included notes showing modifications to improve the render quality. - Bumping the media sampling does improve the media effect - When you do this, it doesn't take as much light to get the same result - Increase the media box size so that the media/non-media boundary is less visible */