POV-Ray : Newsgroups : povray.general : POV-Ray Quiz : Re: POV-Ray Quiz for Intermediate Users Server Time
4 Aug 2024 16:11:13 EDT (-0400)
  Re: POV-Ray Quiz for Intermediate Users  
From: Warp
Date: 5 Jun 2003 11:13:55
Message: <3edf5e33@news.povray.org>
Gena Obukhov <obu### [at] mailcom> wrote:
> According to this test it's rendering time. I'm confused :(

  Internally only one type of transformation matrix is used. Every
transformation you write with the POV-Ray SDL is stored in this internal
transformation matris, regardless of their syntax or amount.

  There's one additional thing, though:
  A transformation matrix is not always applied to an object. If the object
does not need any transformation matrix, then none is used in it. This
naturally speeds up rendering because the ray doesn't need to be multiplied
by the matrix when rendering.
  There are some primitives which have an optimization built into them:
For example, if you translate or rotate a sphere, only its center point
will be modified, but no transformation matrix will be assigned to it.
Similarly if you scale the sphere uniformly, only its radius will be modified.
(If the sphere has a texture, the a transformation must be applied to the
texture itself, though.) Only if you scale the sphere non-uniformly, a
transformation matrix will be applied to it.

  Now, this may explain the difference in rendering speed. If the tree
consists solely of primitives which have these built-in optimizations
(such as spheres, boxes, cylinders and cones, AFAIK) and you only use
transformations which are optimizable away (such as translates), POV-Ray
will not generate any transformation matrix for the whole tree structure.
  However, if you use a transformation not included in the optimizations
(such as the 'transform' block seems to be the case), matrices will be
applied to all objects in the tree, thus causing a penalty in render time.

  To test that this theory is correct, try your test with non-uniform
scaling (such as "scale <1,1.5,1.2>") in additions to the translates.
If the theory is correct, the render time should be identical no matter
what transformation syntax you use.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

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