POV-Ray : Newsgroups : povray.advanced-users : Triangles faster than objects Server Time
8 Jul 2024 19:40:42 EDT (-0400)
  Triangles faster than objects (Message 11 to 20 of 22)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 2 Messages >>>
From: Tim Attwood
Subject: Re: Triangles faster than objects
Date: 22 May 2007 00:44:34
Message: <46527532$1@news.povray.org>
> Before of making any change in my sourcecode, it would be useful if 
> someone
> knew the answer to the first question: Why TRIANGLES version is faster 
> than
> OBJECTS version? It should be something related to the povray internal
> parser.

Basically, triangles can be faster, because they can be put into
one mesh object.

Many objects usually end up slower, because then there needs to
be intersection tests against a large number of bounding boxes.

For comparison, I have a simple scene with two mesh objects
having about 10,000 triangles each (20k total) that renders
in 3 seconds on my 1.9G Athlon

--- include file ---
#declare Thing1 = mesh {
   triangle {...}
   triangle {...}
   ... etc
};
#declare Thing2 = mesh {
   triangle {...}
   triangle {...}
   ... etc
};
--- scene file ---
#include "somefile"
object{Thing1}
object{Thing2}
... and other stuff


Post a reply to this message

From: Penelope20k
Subject: Re: Triangles faster than objects
Date: 6 Jun 2007 05:53:30
Message: <4666841a@news.povray.org>
just a question ...

Is it the render (trace) which takes less time . or is it the parse time ?




news:web.464c7756a93451f1d8ef73430@news.povray.org...
> Hello,
> With my last render I noticed that if you render a scene which is divided
in
> triangles the render time is better than if you render the same scene
> divided in objects.
>
> For example, supose a scene formed by 50 objects with 100 triangles each
> one:.
>
>
//--------------------------------------------------------------------------
-
> //TRIANGLES version:
>
//--------------------------------------------------------------------------
-
> //5000 triangles = 5000 mesh2
> union{
>   //Triangle 1
>   mesh2 { [..] }
>   //Triangle 2
>   mesh2{  [..] }
>   [...]
>   //Triangle 5000
>   mesh2{  [..] }
> }
>
//--------------------------------------------------------------------------
-
> //OBJECTS version:
>
//--------------------------------------------------------------------------
-
> //50 objects = 50 mesh2
>   mesh2{ [..] } //Object 1
>   mesh2{ [..] } //Object 2
>   [...]
>   mesh2{ [..] } //Object 50
> //---------------------------------------------------------------------
>
> The TRIANGLES version has took 6 minutes to finish the render, while the
> OBJECTS version has took 8 minutes.
>
> Any comments?
>
> Regards,
>
> Joel.
>
>
>


Post a reply to this message

From: Penelope20k
Subject: Re: Triangles faster than objects
Date: 6 Jun 2007 06:03:21
Message: <46668669@news.povray.org>
simply answer this

Did you texture them ?
and how ?

i think that came from the way your render it , ore than the time to parse
file mesh or object ..





news:web.464c7756a93451f1d8ef73430@news.povray.org...
> Hello,
> With my last render I noticed that if you render a scene which is divided
in
> triangles the render time is better than if you render the same scene
> divided in objects.
>
> For example, supose a scene formed by 50 objects with 100 triangles each
> one:.
>
>
//--------------------------------------------------------------------------
-
> //TRIANGLES version:
>
//--------------------------------------------------------------------------
-
> //5000 triangles = 5000 mesh2
> union{
>   //Triangle 1
>   mesh2 { [..] }
>   //Triangle 2
>   mesh2{  [..] }
>   [...]
>   //Triangle 5000
>   mesh2{  [..] }
> }
>
//--------------------------------------------------------------------------
-
> //OBJECTS version:
>
//--------------------------------------------------------------------------
-
> //50 objects = 50 mesh2
>   mesh2{ [..] } //Object 1
>   mesh2{ [..] } //Object 2
>   [...]
>   mesh2{ [..] } //Object 50
> //---------------------------------------------------------------------
>
> The TRIANGLES version has took 6 minutes to finish the render, while the
> OBJECTS version has took 8 minutes.
>
> Any comments?
>
> Regards,
>
> Joel.
>
>
>


Post a reply to this message

From: JSR
Subject: Re: Triangles faster than objects
Date: 6 Jun 2007 07:15:01
Message: <web.4666971d10a189edd8ef73430@news.povray.org>
"Penelope20k" <pen### [at] caramailfr> wrote:
> just a question ...
> Is it the render (trace) which takes less time . or is it the parse time ?

Triangles version:
- parse time  : 17 sec
- render time : 5 min 44 sec
- Total time  : 6 min 1 sec

Objects version:
- parse time  : 4 sec
- render time : 7 min 43 sec
- Total time  : 7 min 47 sec

Regards,

Joel.


Post a reply to this message

From: Warp
Subject: Re: Triangles faster than objects
Date: 6 Jun 2007 07:23:11
Message: <4666991f@news.povray.org>
JSR <jsr### [at] gmailcom> wrote:
> Triangles version:
> Objects version:

  I'm still completely confused about what you mean with "triangles version"
and "objects version".

-- 
                                                          - Warp


Post a reply to this message

From: JSR
Subject: Re: Triangles faster than objects
Date: 6 Jun 2007 07:30:02
Message: <web.466698e710a189edd8ef73430@news.povray.org>
"Penelope20k" <pen### [at] caramailfr> wrote:
> simply answer this
>
> Did you texture them ?
> and how ?
>
> i think that came from the way your render it , ore than the time to parse
> file mesh or object ..



TRIANGLES VERSION
------------------------------------------------------------------------
union
{
    mesh2
    {
        vertex_vectors
        {
         3,<200.0,0.0,550.0>,<-300.0,0.0,550.0>,<-300.0000,0.0000,50.0000>
        }
        normal_vectors
        {
         3,<0.0,-1.0,0.0>,<0.0000,-1.0000,0.0000>,<-0.4470,-0.8940,0.0000>
        }
        uv_vectors
        {
            3,<0.000,0.000>,<0.000,1.000>,<1.000,0.000 >
        }
        texture_list
        {
            1, texture { mat_0_89_0_0_0_0_TEX_L004 }
        }
        face_indices
        {
            1,<0,1,2>,0
        }
    }

[...] the same for the next triangles...

OBJECTS VERSION
------------------------------------------------------------------------
    mesh2
    {
        vertex_vectors
        {
         53,<200,0,550>,<-300,0,550>,<-300,0,50>,............
        }
        normal_vectors
        {
         53,<0,-1,0>,<0,-1,0>,<-0.4470,-0.8940,0>,..............
        }
        uv_vectors
        {
            53,<0.000,0.000>,<0.000,1.000>,<1.000,0.000>,.........
        }
        texture_list
        {
            1, texture { mat_0_89_0_0_0_0_TEX_L004 }
        }
        face_indices
        {
            76,<0,1,2>,<2,3,4>,<2,7,12>,..........
        }
    }
[...] the same for the next objects


Regards,

Joel.


Post a reply to this message

From: Warp
Subject: Re: Triangles faster than objects
Date: 6 Jun 2007 07:57:46
Message: <4666a13a@news.povray.org>
For the sake of clarity, could you in the future use more descriptive
names, please? I'm getting completely confused with the use of the terms
"triangles version" and "objects version" which are completely nondescriptive.

  How about "each triangle as its own object" and "a single mesh2 with
all the triangles inside it"?

-- 
                                                          - Warp


Post a reply to this message

From: Penelope20k
Subject: Re: Triangles faster than objects
Date: 6 Jun 2007 08:24:07
Message: <4666a767$1@news.povray.org>
yes me too ..

i think that he s calling about object version by
creating a union of each meshes ...insteed of making list of meshes






news:4666991f@news.povray.org...
> JSR <jsr### [at] gmailcom> wrote:
> > Triangles version:
> > Objects version:
>
>   I'm still completely confused about what you mean with "triangles
version"
> and "objects version".
>
> -- 
>                                                           - Warp


Post a reply to this message

From: Warp
Subject: Re: Triangles faster than objects
Date: 6 Jun 2007 08:37:07
Message: <4666aa72@news.povray.org>
Penelope20k <pen### [at] caramailfr> wrote:
> i think that he s calling about object version by
> creating a union of each meshes ...insteed of making list of meshes

  That wasn't actually clarifying at all... :P

-- 
                                                          - Warp


Post a reply to this message

From: Penelope20k
Subject: Re: Triangles faster than objects
Date: 6 Jun 2007 08:45:22
Message: <4666ac62$1@news.povray.org>
Did your triangle can be mixed together ... means that when you union them,
POV will care only about visible faces (cause it have precompute them before
in the parse section) ..

when you dont union them ..the render has to think if or not the object is
visible by creating a ray,
so that means that it need to identify which objet is shown, and which part
of object is shown .
when you union it..the render send ray which intersect an object (and only
one cause you union meshes) , then it only need to compute what part of this
object must be shaown








news:46668669@news.povray.org...
> simply answer this
>
> Did you texture them ?
> and how ?
>
> i think that came from the way your render it , ore than the time to parse
> file mesh or object ..
>
>
>
>

> news:web.464c7756a93451f1d8ef73430@news.povray.org...
> > Hello,
> > With my last render I noticed that if you render a scene which is
divided
> in
> > triangles the render time is better than if you render the same scene
> > divided in objects.
> >
> > For example, supose a scene formed by 50 objects with 100 triangles each
> > one:.
> >
> >
>
//--------------------------------------------------------------------------
> -
> > //TRIANGLES version:
> >
>
//--------------------------------------------------------------------------
> -
> > //5000 triangles = 5000 mesh2
> > union{
> >   //Triangle 1
> >   mesh2 { [..] }
> >   //Triangle 2
> >   mesh2{  [..] }
> >   [...]
> >   //Triangle 5000
> >   mesh2{  [..] }
> > }
> >
>
//--------------------------------------------------------------------------
> -
> > //OBJECTS version:
> >
>
//--------------------------------------------------------------------------
> -
> > //50 objects = 50 mesh2
> >   mesh2{ [..] } //Object 1
> >   mesh2{ [..] } //Object 2
> >   [...]
> >   mesh2{ [..] } //Object 50
> > //---------------------------------------------------------------------
> >
> > The TRIANGLES version has took 6 minutes to finish the render, while the
> > OBJECTS version has took 8 minutes.
> >
> > Any comments?
> >
> > Regards,
> >
> > Joel.
> >
> >
> >
>
>


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 2 Messages >>>

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