|
|
I am attempting to render a 1600x1200 AA 0.3 version of a level 5 Menger
Sponge. However, it will crash with a "POV-Ray for Windows has encountered
an error" message after about two minutes, occasionally. And, when it does
appear to parse correctly, there is no render window and the statistics say
that the entire four minutes was spent on render time. I check the folder
and find a 640x480 bitmap file, which is not what I wanted. It will also
crash for me if I try 800x600 no AA. I run Windows XP Home with POV-Ray
3.6.
//BEGIN POV FILE
//The method I'm using to do this is this: create a 3x3 block of cubes, then
comment out
//the appropriate cubes to remove. This creates the Menger Sponge. Most of
this POV file
//is just a bunch of declarations, and in the end, there will only be about
one object.
#include "colors.inc"
global_settings {
radiosity {
pretrace_start 0.08
pretrace_end 0.04
count 35
nearest_count 5
error_bound 1.8
recursion_limit 3
low_error_factor .5
gray_threshold 0.0
minimum_reuse 0.015
brightness 1
adc_bailout 0.01/2
}
}
background { White * .86 }
camera {
location <1.0, 2.0, -5.0>
look_at <-0.3, -0.3333, 0.0>
rotate <0.0, clock*360, 0.0>
right x*image_width/image_height
}
//This is the section where all the cubes are declared.
#declare s1 = 0.8;
#declare s2 = 0.9;
#declare s3 = 0.9;
#declare s4 = 0.9;
#declare s5 = 0.9;
#declare obj1 =
box { <-.5, -.5, -.5> <.5, .5, .5> //This is a 1x1 cube.
material {
texture {
pigment { White }
finish { diffuse .5 ambient 0 specular .5 }
}
}
}
#declare lev1 = union {
object { obj1 scale s1 translate <1, 1, 1> }
object { obj1 scale s1 translate <2, 1, 1> }
object { obj1 scale s1 translate <3, 1, 1> }
object { obj1 scale s1 translate <1, 2, 1> }
// object { obj1 scale s1 translate <2, 2, 1> }
object { obj1 scale s1 translate <3, 2, 1> }
object { obj1 scale s1 translate <1, 3, 1> }
object { obj1 scale s1 translate <2, 3, 1> }
object { obj1 scale s1 translate <3, 3, 1> }
object { obj1 scale s1 translate <1, 1, 2> }
// object { obj1 scale s1 translate <2, 1, 2> }
object { obj1 scale s1 translate <3, 1, 2> }
// object { obj1 scale s1 translate <1, 2, 2> }
// object { obj1 scale s1 translate <2, 2, 2> }
// object { obj1 scale s1 translate <3, 2, 2> }
object { obj1 scale s1 translate <1, 3, 2> }
// object { obj1 scale s1 translate <2, 3, 2> }
object { obj1 scale s1 translate <3, 3, 2> }
object { obj1 scale s1 translate <1, 1, 3> }
object { obj1 scale s1 translate <2, 1, 3> }
object { obj1 scale s1 translate <3, 1, 3> }
object { obj1 scale s1 translate <1, 2, 3> }
// object { obj1 scale s1 translate <2, 2, 3> }
object { obj1 scale s1 translate <3, 2, 3> }
object { obj1 scale s1 translate <1, 3, 3> }
object { obj1 scale s1 translate <2, 3, 3> }
object { obj1 scale s1 translate <3, 3, 3> }
translate <-2, -2, -2>
scale 1/3
}
#declare lev2 = union {
object { lev1 scale s2 translate <1, 1, 1> }
object { lev1 scale s2 translate <2, 1, 1> }
object { lev1 scale s2 translate <3, 1, 1> }
object { lev1 scale s2 translate <1, 2, 1> }
// object { lev1 scale s2 translate <2, 2, 1> }
object { lev1 scale s2 translate <3, 2, 1> }
object { lev1 scale s2 translate <1, 3, 1> }
object { lev1 scale s2 translate <2, 3, 1> }
object { lev1 scale s2 translate <3, 3, 1> }
object { lev1 scale s2 translate <1, 1, 2> }
// object { lev1 scale s2 translate <2, 1, 2> }
object { lev1 scale s2 translate <3, 1, 2> }
// object { lev1 scale s2 translate <1, 2, 2> }
// object { lev1 scale s2 translate <2, 2, 2> }
// object { lev1 scale s2 translate <3, 2, 2> }
object { lev1 scale s2 translate <1, 3, 2> }
// object { lev1 scale s2 translate <2, 3, 2> }
object { lev1 scale s2 translate <3, 3, 2> }
object { lev1 scale s2 translate <1, 1, 3> }
object { lev1 scale s2 translate <2, 1, 3> }
object { lev1 scale s2 translate <3, 1, 3> }
object { lev1 scale s2 translate <1, 2, 3> }
// object { lev1 scale s2 translate <2, 2, 3> }
object { lev1 scale s2 translate <3, 2, 3> }
object { lev1 scale s2 translate <1, 3, 3> }
object { lev1 scale s2 translate <2, 3, 3> }
object { lev1 scale s2 translate <3, 3, 3> }
translate <-2, -2, -2>
scale 1/3
}
#declare lev3 = union {
object { lev2 scale s3 translate <1, 1, 1> }
object { lev2 scale s3 translate <2, 1, 1> }
object { lev2 scale s3 translate <3, 1, 1> }
object { lev2 scale s3 translate <1, 2, 1> }
// object { lev2 scale s3 translate <2, 2, 1> }
object { lev2 scale s3 translate <3, 2, 1> }
object { lev2 scale s3 translate <1, 3, 1> }
object { lev2 scale s3 translate <2, 3, 1> }
object { lev2 scale s3 translate <3, 3, 1> }
object { lev2 scale s3 translate <1, 1, 2> }
// object { lev2 scale s3 translate <2, 1, 2> }
object { lev2 scale s3 translate <3, 1, 2> }
// object { lev2 scale s3 translate <1, 2, 2> }
// object { lev2 scale s3 translate <2, 2, 2> }
// object { lev2 scale s3 translate <3, 2, 2> }
object { lev2 scale s3 translate <1, 3, 2> }
// object { lev2 scale s3 translate <2, 3, 2> }
object { lev2 scale s3 translate <3, 3, 2> }
object { lev2 scale s3 translate <1, 1, 3> }
object { lev2 scale s3 translate <2, 1, 3> }
object { lev2 scale s3 translate <3, 1, 3> }
object { lev2 scale s3 translate <1, 2, 3> }
// object { lev2 scale s3 translate <2, 2, 3> }
object { lev2 scale s3 translate <3, 2, 3> }
object { lev2 scale s3 translate <1, 3, 3> }
object { lev2 scale s3 translate <2, 3, 3> }
object { lev2 scale s3 translate <3, 3, 3> }
translate <-2, -2, -2>
scale 1/3
}
#declare lev4 = union {
object { lev3 scale s4 translate <1, 1, 1> }
object { lev3 scale s4 translate <2, 1, 1> }
object { lev3 scale s4 translate <3, 1, 1> }
object { lev3 scale s4 translate <1, 2, 1> }
// object { lev3 scale s4 translate <2, 2, 1> }
object { lev3 scale s4 translate <3, 2, 1> }
object { lev3 scale s4 translate <1, 3, 1> }
object { lev3 scale s4 translate <2, 3, 1> }
object { lev3 scale s4 translate <3, 3, 1> }
object { lev3 scale s4 translate <1, 1, 2> }
// object { lev3 scale s4 translate <2, 1, 2> }
object { lev3 scale s4 translate <3, 1, 2> }
// object { lev3 scale s4 translate <1, 2, 2> }
// object { lev3 scale s4 translate <2, 2, 2> }
// object { lev3 scale s4 translate <3, 2, 2> }
object { lev3 scale s4 translate <1, 3, 2> }
// object { lev3 scale s4 translate <2, 3, 2> }
object { lev3 scale s4 translate <3, 3, 2> }
object { lev3 scale s4 translate <1, 1, 3> }
object { lev3 scale s4 translate <2, 1, 3> }
object { lev3 scale s4 translate <3, 1, 3> }
object { lev3 scale s4 translate <1, 2, 3> }
// object { lev3 scale s4 translate <2, 2, 3> }
object { lev3 scale s4 translate <3, 2, 3> }
object { lev3 scale s4 translate <1, 3, 3> }
object { lev3 scale s4 translate <2, 3, 3> }
object { lev3 scale s4 translate <3, 3, 3> }
translate <-2, -2, -2>
scale 1/3
}
#declare lev5 = union {
object { lev4 scale s5 translate <1, 1, 1> }
object { lev4 scale s5 translate <2, 1, 1> }
object { lev4 scale s5 translate <3, 1, 1> }
object { lev4 scale s5 translate <1, 2, 1> }
// object { lev4 scale s5 translate <2, 2, 1> }
object { lev4 scale s5 translate <3, 2, 1> }
object { lev4 scale s5 translate <1, 3, 1> }
object { lev4 scale s5 translate <2, 3, 1> }
object { lev4 scale s5 translate <3, 3, 1> }
object { lev4 scale s5 translate <1, 1, 2> }
// object { lev4 scale s5 translate <2, 1, 2> }
object { lev4 scale s5 translate <3, 1, 2> }
// object { lev4 scale s5 translate <1, 2, 2> }
// object { lev4 scale s5 translate <2, 2, 2> }
// object { lev4 scale s5 translate <3, 2, 2> }
object { lev4 scale s5 translate <1, 3, 2> }
// object { lev4 scale s5 translate <2, 3, 2> }
object { lev4 scale s5 translate <3, 3, 2> }
object { lev4 scale s5 translate <1, 1, 3> }
object { lev4 scale s5 translate <2, 1, 3> }
object { lev4 scale s5 translate <3, 1, 3> }
object { lev4 scale s5 translate <1, 2, 3> }
// object { lev4 scale s5 translate <2, 2, 3> }
object { lev4 scale s5 translate <3, 2, 3> }
object { lev4 scale s5 translate <1, 3, 3> }
object { lev4 scale s5 translate <2, 3, 3> }
object { lev4 scale s5 translate <3, 3, 3> }
translate <-2, -2, -2>
scale 1
}
object { lev5 }
light_source { <2, 2, 2> White }
light_source { <0, 0, 0> White*.75}
Post a reply to this message
|
|
|
|
In message <b8f### [at] lazysodorguk>, Alex <pov### [at] lazysodorguk>
writes
<snip>
>
>I'll have a little play after I've had some lunch, see what I can come
>up with. There's more than one way to skin a cat.
This code uses a lot less memory (even with radiosity added), but it
does render much more slowly. Your cubes approach is well suited to
hierarchical bounding. My method generates a union of long and
progressively thinner boxes, which are used with 2 other rotated copies
to cut holes out of a cube. This can't be efficiently bound.
It's worth noting that my level 4 is equivalent to your level 5, we both
start from a different point.
global_settings{
assumed_gamma 1.0
max_trace_level 6
adc_bailout 1/250
}
#include "colors.inc"
// posn - x,y co-ords of centre of current square
// sz - width of square. centre 3rd will be cut out,
// surrounding 8 sections call macro recursively
// levl - current recursion level
#macro do_holes(posn,sz,levl)
box{posn-<1,1,0>*sz/6-z*0.51,posn+<1,1,0>*sz/6+z*0.51}
#if (levl>0)
do_holes(posn+<1,0,0>/3*sz,sz/3,levl-1)
do_holes(posn+<1,1,0>/3*sz,sz/3,levl-1)
do_holes(posn+<0,1,0>/3*sz,sz/3,levl-1)
do_holes(posn+<-1,1,0>/3*sz,sz/3,levl-1)
do_holes(posn+<-1,0,0>/3*sz,sz/3,levl-1)
do_holes(posn+<-1,-1,0>/3*sz,sz/3,levl-1)
do_holes(posn+<0,-1,0>/3*sz,sz/3,levl-1)
do_holes(posn+<1,-1,0>/3*sz,sz/3,levl-1)
#end //if levl
#end //macro
#declare holes=union{
do_holes(<0,0>,1,2) // last number here controls recursion depth
}
difference{
box{-1/2,1/2}
object {holes}
object {holes rotate <90,0,0>}
object {holes rotate <0,90,0>}
texture{
pigment{rgb <8,3,0>/9}
finish{ambient 0 diffuse 1}
}
}
light_source{<60,50,-50> colour Gray40}
light_source{<-60,50,-50> colour Gray20}
light_source{<0,-70,-50> colour Gray10}
camera {
right 4*x
up 3*y
direction 10*z
location <4,3,-7>
look_at <0,0,0>
}
Hope this is of some help.
Another thought: Mine is too slow. You could maybe combine the two
approaches? Declare mine at level 2 as an object, and use that in place
of the source cube in your code at level 2.
--
Alex
Post a reply to this message
|
|