POV-Ray : Newsgroups : povray.advanced-users : Triangles faster than objects Server Time
5 Jul 2024 15:49:37 EDT (-0400)
  Triangles faster than objects (Message 1 to 10 of 22)  
Goto Latest 10 Messages Next 10 Messages >>>
From: JSR
Subject: Triangles faster than objects
Date: 17 May 2007 11:45:01
Message: <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: 17 May 2007 12:05:01
Message: <web.464c7cc710a189edd8ef73430@news.povray.org>
//-------------------------------------------------------------------------------------
//TRIANGLES VERSION
//-------------------------------------------------------------------------------------
Scene Statistics
  Finite objects:       102622
  Infinite objects:          0
  Light sources:             1
  Total:                102623

Render Statistics
Image Resolution 600 x 450

Pixels:           271205   Samples:          936365   Smpls/Pxl: 3.45
Rays:            5680389   Saved:           1562927   Max Level: 8/8

Ray->Shape Intersection          Tests       Succeeded  Percentage

Mesh                          13512384         6380525     47.22
Bounding Box                 561876288       155376363     27.65
Light Buffer                 329974685       129222522     39.16
Vista Buffer                  70349529        53234143     75.67

Calls to Noise:                   0   Calls to DNoise:              10

Shadow Ray Tests:           6437521   Succeeded:               2377081
Reflected Rays:             3141031
Transmitted Rays:            447019

Radiosity samples calculated:            24608 (0.67 %)
Radiosity samples reused:              3655578
  Samples (final trace)                  21806
  Samples (recursion 1)                  22419
  Samples (recursion 2)                   2189

Smallest Alloc:                  20 bytes
Largest  Alloc:              820992 bytes
Peak memory used:         126868251 bytes
Total Scene Processing Times
  Parse Time:    0 hours  0 minutes 17 seconds (17 seconds)
  Photon Time:   0 hours  0 minutes  0 seconds (0 seconds)
  Cloth Time:    0 hours  0 minutes  0 seconds (0 seconds)
  Mechsim Time:  0 hours  0 minutes  0 seconds (0 seconds)
  Render Time:   0 hours  5 minutes 44 seconds (344 seconds)
  Postpr. Time:  0 hours  0 minutes  0 seconds (0 seconds)
  Total Time:    0 hours  6 minutes  1 seconds (361 seconds)
CPU time used: kernel 1.14 seconds, user 360.52 seconds, total 361.66
seconds
Render averaged 746.57 PPS over 270000 pixels

POV-Ray finished

Preset source file is 'C:3drenderescena.pov'.
Rendering using command line '+a0.1 +w600 +h450'.
Redirecting Options
  All Streams to console..........On
  Debug Stream to console.........On
  Fatal Stream to console.........On

//-------------------------------------------------------------------------------------
//OBJECTS VERSION
//-------------------------------------------------------------------------------------
Scene Statistics
  Finite objects:         1536
  Infinite objects:          0
  Light sources:             1
  Total:                  1537

Render Statistics
Image Resolution 600 x 450

Pixels:           271205   Samples:          960525   Smpls/Pxl: 3.54
Rays:            6995949   Saved:           1543608   Max Level: 8/8

Ray->Shape Intersection          Tests       Succeeded  Percentage

Mesh                          18179572         8868577     48.78
Bounding Box                 658399737       193317922     29.36
Light Buffer                 165146399        57866676     35.04
Vista Buffer                  25771960        16353274     63.45

Calls to Noise:                   0   Calls to DNoise:              10

Shadow Ray Tests:           8417812   Succeeded:               3330785
Reflected Rays:             4039029   Total Internal:              638
Refracted Rays:              223097

Radiosity samples calculated:            36437 (0.81 %)
Radiosity samples reused:              4483771
  Samples (final trace)                  34036
  Samples (recursion 1)                  35009
  Samples (recursion 2)                   1428

Smallest Alloc:                  20 bytes
Largest  Alloc:             1729240 bytes
Peak memory used:          53654523 bytes
Total Scene Processing Times
  Parse Time:    0 hours  0 minutes  4 seconds (4 seconds)
  Photon Time:   0 hours  0 minutes  0 seconds (0 seconds)
  Cloth Time:    0 hours  0 minutes  0 seconds (0 seconds)
  Mechsim Time:  0 hours  0 minutes  0 seconds (0 seconds)
  Render Time:   0 hours  7 minutes 43 seconds (463 seconds)
  Postpr. Time:  0 hours  0 minutes  0 seconds (0 seconds)
  Total Time:    0 hours  7 minutes 47 seconds (467 seconds)
CPU time used: kernel 0.38 seconds, user 466.58 seconds, total 466.95
seconds
Render averaged 578.22 PPS over 270000 pixels

POV-Ray finished


Post a reply to this message

From: Le Forgeron
Subject: Re: Triangles faster than objects
Date: 17 May 2007 13:22:13
Message: <464c8f45$1@news.povray.org>
Le 17.05.2007 17:40, JSR nous fit lire :

> The TRIANGLES version has took 6 minutes to finish the render, while the
> OBJECTS version has took 8 minutes.
> 
> Any comments?

Yes... precision of triangles is limited, precision of objects is
infinite.
End of debat!

-- 
The superior man understands what is right;
the inferior man understands what will sell.
-- Confucius


Post a reply to this message

From: Warp
Subject: Re: Triangles faster than objects
Date: 17 May 2007 19:53:56
Message: <464ceb13@news.povray.org>
Le Forgeron <jgr### [at] freefr> wrote:
> precision of objects is infinite.

  Exactly what do you base this claim on?

-- 
                                                          - Warp


Post a reply to this message

From: Mike Williams
Subject: Re: Triangles faster than objects
Date: 18 May 2007 00:27:46
Message: <iFd7OKAFhSTGFw+b@econym.demon.co.uk>
I don't recognise that version of PovRay. Is it possible that you're
using something like MegaPov? That might be significant.

It's also possible that the way you've clumped the triangles into
objects happens to interfere with the automatic bounding process, and
leads to less efficient bounding. E.g. if your "objects" were generated
by choosing 100 random triangles from the set of 5000, then each object
would have its own bounding octree that spanned the whole scene.

The stats suggest that the two renders are not exactly equivalent. One
of them has a few rays that get totally internally reflected, and the
other one doesn't. That might be because your objects have a different
"inside" than the individual triangles that compose them. Or it might be
because there's something else slightly different in your scenes that
you're not telling us about.
-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: JSR
Subject: Re: Triangles faster than objects
Date: 18 May 2007 03:20:03
Message: <web.464d531110a189edd8ef73430@news.povray.org>
> I don't recognise that version of PovRay. Is it possible that you're
> using something like MegaPov? That might be significant.

Yes, sorry, I use MegaPov 1.2.1

> It's also possible that the way you've clumped the triangles into
> objects happens to interfere with the automatic bounding process, and
> leads to less efficient bounding. E.g. if your "objects" were generated
> by choosing 100 random triangles from the set of 5000, then each object
> would have its own bounding octree that spanned the whole scene.

The scene contains several .DXF objects transformed to mesh2. Every object
is a mesh2 structure, with different number of triangles each one.

> The stats suggest that the two renders are not exactly equivalent. One
> of them has a few rays that get totally internally reflected, and the
> other one doesn't. That might be because your objects have a different
> "inside" than the individual triangles that compose them. Or it might be
> because there's something else slightly different in your scenes that
> you're not telling us about.

The two scenes should be identical, changing only the way the geometry is
constructed, in one way with objects and the other with triangles.


Post a reply to this message

From: Chambers
Subject: Re: Triangles faster than objects
Date: 18 May 2007 09:26:21
Message: <464da97d$1@news.povray.org>
So you're saying that you get better results by listing each triangle 
individually, rather than grouping them into meshes?

That would imply that POV-Ray is doing some very efficient bounding on 
your triangles.  Which would also imply that your meshes aren't composed 
very well, either.

-- 
...Ben Chambers
www.pacificwebguy.com


Post a reply to this message

From: JSR
Subject: Re: Triangles faster than objects
Date: 18 May 2007 10:50:01
Message: <web.464dbcf010a189edd8ef73430@news.povray.org>
> So you're saying that you get better results by listing each triangle
> individually, rather than grouping them into meshes?

Yes.

> That would imply that POV-Ray is doing some very efficient bounding on
> your triangles.  Which would also imply that your meshes aren't composed
> very well, either.

Every mesh2 represents an object. For example, a table with 4 legs and 1
board would be represented with a total of 5 objects (5 mesh2). Each object
with their vertexs and faces.

//----------------------------------------------------------------------

My aim is to reduce the parse time because when I use the TRIANGLES version
the parse time is very long (1 min) because of the number of mesh2. With
OBJECTS version the parse time is very good (8 seg), but render time is
worse.

Joel.


Post a reply to this message

From: Ferro
Subject: Re: Triangles faster than objects
Date: 18 May 2007 19:05:01
Message: <web.464e302410a189edb19873360@news.povray.org>
> My aim is to reduce the parse time because when I use the TRIANGLES version
> the parse time is very long (1 min) because of the number of mesh2. With
> OBJECTS version the parse time is very good (8 seg), but render time is
> worse.
>
> Joel.

First of all... your "triangles" version is actually 5000 mesh2 objects that
consist of one triangle each. And your "objects" version it's just 50 mesh2
objects with more triangles each. Your "triangles" version SEEMS
innefficient... yet total render time is faster than the "objects" version.

Have you tried having everything in just ONE mesh2? From the sound of it,
parse time might be less with a longer render time... just something to
try, I guess. I would suggest that you just stick to the one with the
shortest total
render time... which as of now looks like the "triangles" version. I
realize this is not too helpful, but I can't think of anything better as of
now.

Oh, by the way... how are you changing your models to mesh2, what kind of
software? That might have something to do with it... maybe... ?


Post a reply to this message

From: JSR
Subject: Re: Triangles faster than objects
Date: 21 May 2007 05:55:01
Message: <web.46516bb410a189edd8ef73430@news.povray.org>
> Oh, by the way... how are you changing your models to mesh2, what kind of
> software? That might have something to do with it... maybe... ?

I have my own application to convert from OpenGL triangles to PovRay
triangles or objects (mesh2).

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.

Joel.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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