|
![](/i/fill.gif) |
Greg M. Johnson wrote:
>
> I didn't quite like how the starfield pigments looked in a sky_sphere,
> so I'm going to make my own.
>
> Q: which will render faster,
> i) pow(10,6) spheres, or
A mesh with triangles will render quicker, and use far less memory.
If the triangles are far enough away, they look just like spheres
that are far, far away.
#local SEED=seed(0);
mesh {
#local iI=0;#while(iI<NUMBER_OF_STARS)
#local vR=<rand(SEED),rand(SEED),rand(SEED)>*360;
triangle {
vrotate(<0,1,DISTANCE>,vR),
vrotate(<-97/112,-.5,DISTANCE>,vR),
vrotate(< 97/112,-.5,DISTANCE>,vR)
}
#local iI=iI+1;#end
no_shadow
pigment { rgb 1 }
finish { ambient 1 diffuse 0 }
translate CAMERA_POSITION // makes stars appear stationary
}
Set DISTANCE so that the triangles just become points.
Post a reply to this message
|
![](/i/fill.gif) |