POV-Ray : Newsgroups : povray.general : quicker render alternatives to povray : Re: quicker render alternatives to povray Server Time
31 Jul 2024 06:25:50 EDT (-0400)
  Re: quicker render alternatives to povray  
From: Rahul
Date: 18 Mar 2008 00:35:01
Message: <web.47df542272535d7259eba08c0@news.povray.org>
Alain <ele### [at] netscapenet> wrote:

> Try puting all spheres representing the same element in an union, and assigh the
> pigment to that union. That mean about 4 unions for most organic molecules:
> carbon, hydrogen, oxygen and nitrogen.
> If all, or most, spheres use the same finish, set that finish as the default
> finish. Do the same for the proeminent pigment like:
> #default texture{pigment{Carbon}finish{Your_finish}}

True. Most of my files have a max of about 5 elements.


Here's a snippet; as other previous posters indicated maybe this is helpful in
detecting inefficiencies in the code. As I indicated, I'm only trying to  to
tweak it to coax a better performance out of it. The person who originally
wrote it probably did not have performance as a criterion at all. So its very
very likely that we are doing a lot of stuff in an inefficient manner! I'd be
open to any suggestions people can throw at me! Thanks!


*****************************************************************************

#include "colors.inc"
#include "textures.inc"

#declare ATM_FINISH = finish {specular 0.9 roughness 0.001 ambient rgb
<0.3,0.3,0.3> metallic}
#declare RIBBON_FINISH = finish {specular 0.9 roughness 0.001 ambient rgb
<0.3,0.3,0.3>}
#declare SURF_FINISH = finish {specular 0.9 roughness 0.001 ambient rgb
<0.3,0.3,0.3>}
#declare N_tex = texture { pigment { colour red 0.231 green 0.318 blue 1.000 }
finish{ ATM_FINISH }}
#declare C_tex = texture { pigment { colour red 0.100 green 0.100 blue 0.100 }
finish{ ATM_FINISH }}
#declare O_tex = texture { pigment { colour red 0.700 green 0.000 blue 0.000 }
finish{ ATM_FINISH }}
....
[snip]
....
//************ CAMERA *********

#declare zoom = 15;

// Define Camera Positions
#declare xtopview = camera {orthographic direction <1, 0, 0> sky <0, 0, 1> up
<0, 0, zoom> right<zoom*4/3,0,0> rotate <0,0,180> loca
tion <0, 0, 20> look_at <0, 0, 0>}
#declare xfrontview = camera {orthographic location  <0, -20, 0> direction <1,
0, 0> sky <0, 0, 1> up <0, 0, zoom> right<zoom*4/3,0>
 look_at <0, 0,0>}

.....
[snip]
.....

//************ LIGHTS *********

#declare Intensity = 1.7;

light_source
{
  0*z // light's position (translated below)
  color rgb 1.7  // light's color
  // <widthVector> <heightVector> nLightsWide mLightsHigh
  area_light
  <12, 0, 0> <0, 0, 12> // lights spread out across this distance (x * z)
  4, 4                // total number of lights in grid (4x*4z = 16 lights)
  adaptive 0          // 0,1,2,3...
  jitter              // adds random softening of light
  translate <30, -60, 40>   // <x y z> position of light
  shadowless
}
light_source
{
  0*z // light's position (translated below)
  color rgb 1  // light's color
  // <widthVector> <heightVector> nLightsWide mLightsHigh
  area_light
  <12, 0, 0> <0, 12, 0> // lights spread out across this distance (x * z)
  6, 6                // total number of lights in grid (4x*4z = 16 lights)
  adaptive 0          // 0,1,2,3...
  jitter              // adds random softening of light
  translate <7.5, 4, 20>   // <x y z> position of light
  shadowless
}
....
[snip]
....
//************ Simulation Box ******

background { color rgb < 1.000, 1.000, 1.000 >}


//********** CAMERA *************

camera { xfrontview }

//********** ATOMS *************

declare atoms = union {
sphere   { <1.34073,2.44067,2.09778>,  0.77 texture{C_tex}}
sphere   { <0.22055,2.50846,2.75588>,  0.73 texture{O_tex}}
sphere   { <2.20820,2.40215,2.77242>,  0.32 texture{H_tex}}
sphere   { <-0.54093,2.52909,2.04946>,  0.32 texture{H_tex}}
sphere   { <0.07183,-0.04000,-0.02136>,  1.3 texture{Pt_tex}}
sphere   { <2.90433,-0.03858,-0.02034>,  1.3 texture{Pt_tex}}
sphere   { <1.50770,2.40207,0.19218>,  1.3 texture{Pt_tex}}
....
[around 100 spheres here]
[snip]

} // End atom union
object {atoms rotate <0,0,0> translate <-7.50771, -4.47073, 2.07789> scale
0.775927395422}


Post a reply to this message

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