POV-Ray : Newsgroups : povray.general : Starfield: pow(10,6) spheres or an isosurface? : Re: Starfield: pow(10,6) spheres or an isosurface? Server Time
5 Aug 2024 22:16:56 EDT (-0400)
  Re: Starfield: pow(10,6) spheres or an isosurface?  
From: John VanSickle
Date: 27 Aug 2002 14:45:08
Message: <3D6BC8C2.2A88CB09@hotmail.com>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.