POV-Ray : Newsgroups : povray.advanced-users : rectangles Server Time
25 Dec 2024 01:07:09 EST (-0500)
  rectangles (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Christoph Hormann
Subject: rectangles
Date: 20 Jun 2000 13:09:45
Message: <394FA557.CE84BDB5@schunter.etc.tu-bs.de>
Because I needed some simple rectangle shape for a scene I am working on
and because it is used about 1000 times in the scene, I tried some
different possibilities building that shape and checked
memory-use/tracing time.  

It is just a very quick test on a concrete scene, differences in time
are quite low, so you probably can not say anything definitive from
these values (did not want to wait longer :-).  BTW, scene also contains
many other objects.  

Any comments/ideas ?

Christoph


Objects I tested:

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

mesh {
   triangle{<0.0,0.0,0.0>,<0.0,0.0,1.0>,<1.0,0.0,1.0>}
   triangle{<0.0,0.0,0.0>,<1.0,0.0,0.0>,<1.0,0.0,1.0>}
}

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

union {
   triangle{<0.0,0.0,0.0>,<0.0,0.0,1.0>,<1.0,0.0,1.0>}
   triangle{<0.0,0.0,0.0>,<1.0,0.0,0.0>,<1.0,0.0,1.0>}
}

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

box {  
   <0, -0.00001, 0>  
   <1,  0.00001, 1>  
}

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

plane {
  y, 0.0
  hollow on
  clipped_by { box
   { <0, -0.1, 0>
     <1,  0.1, 1> } }
}

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

polygon {
  5, <0, 0>, <0, 1>, <1, 1>, <1, 0>, <0, 0>
  rotate 90*x
} 

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


Time/memory data:

###################################################################
-------------------------------------------------------------------
mesh
-------------------------------------------------------------------
Peak memory used:         47840394 bytes
-------------------------------------------------------------------
Time For Parse:    0 hours  0 minutes  10.0 seconds (10 seconds)
Time For Trace:    0 hours  3 minutes   7.0 seconds (187 seconds)
    Total Time:    0 hours  3 minutes  17.0 seconds (197 seconds) 
###################################################################
-------------------------------------------------------------------
union
-------------------------------------------------------------------
Peak memory used:         47803698 bytes
-------------------------------------------------------------------
Time For Parse:    0 hours  0 minutes  11.0 seconds (11 seconds)
Time For Trace:    0 hours  3 minutes   3.0 seconds (183 seconds)
    Total Time:    0 hours  3 minutes  14.0 seconds (194 seconds)  
###################################################################
-------------------------------------------------------------------
box
-------------------------------------------------------------------
Peak memory used:         47920778 bytes
-------------------------------------------------------------------
Time For Parse:    0 hours  0 minutes  10.0 seconds (10 seconds)
Time For Trace:    0 hours  3 minutes   2.0 seconds (182 seconds)
    Total Time:    0 hours  3 minutes  12.0 seconds (192 seconds)  
###################################################################
-------------------------------------------------------------------
clipped plane
-------------------------------------------------------------------
Peak memory used:         48296618 bytes
-------------------------------------------------------------------
Time For Parse:    0 hours  0 minutes  10.0 seconds (10 seconds)
Time For Trace:    0 hours  3 minutes   0.0 seconds (180 seconds)
    Total Time:    0 hours  3 minutes  10.0 seconds (190 seconds)  
###################################################################
-------------------------------------------------------------------
polygon
-------------------------------------------------------------------
Peak memory used:         47882238 bytes
-------------------------------------------------------------------
Time For Parse:    0 hours  0 minutes  10.0 seconds (10 seconds)
Time For Trace:    0 hours  2 minutes  57.0 seconds (177 seconds)
    Total Time:    0 hours  3 minutes   7.0 seconds (187 seconds)
###################################################################

--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Peter Popov
Subject: Re: rectangles
Date: 20 Jun 2000 17:35:14
Message: <4povkscsicheqtn7cspqqinudp3tp9phuv@4ax.com>
On Tue, 20 Jun 2000 19:09:43 +0200, Christoph Hormann
<Chr### [at] schunteretctu-bsde> wrote:

>
>Because I needed some simple rectangle shape for a scene I am working on
>and because it is used about 1000 times in the scene, I tried some
>different possibilities building that shape and checked
>memory-use/tracing time.  
>
>It is just a very quick test on a concrete scene, differences in time
>are quite low, so you probably can not say anything definitive from
>these values (did not want to wait longer :-).  BTW, scene also contains
>many other objects.  
>
>Any comments/ideas ?

You've missed one. A zero-thickness box (yes it works). Try something
like box { <-1,0,-1>, <1,0,1> } and see what happens. It should render
faster than a regular box.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Chris Huff
Subject: Re: rectangles
Date: 20 Jun 2000 18:01:32
Message: <chrishuff-65652E.17055220062000@news.povray.org>
In article <394FA557.CE84BDB5@schunter.etc.tu-bs.de>, 
chr### [at] gmxde wrote:

> mesh {
>    triangle{<0.0,0.0,0.0>,<0.0,0.0,1.0>,<1.0,0.0,1.0>}
>    triangle{<0.0,0.0,0.0>,<1.0,0.0,0.0>,<1.0,0.0,1.0>}
> }

> ###################################################################
> -------------------------------------------------------------------
> mesh
> -------------------------------------------------------------------
> Peak memory used:         47840394 bytes
> -------------------------------------------------------------------
> Time For Parse:    0 hours  0 minutes  10.0 seconds (10 seconds)
> Time For Trace:    0 hours  3 minutes   7.0 seconds (187 seconds)
>     Total Time:    0 hours  3 minutes  17.0 seconds (197 seconds) 


Perhaps you should try something like:

#declare Block =
mesh {
   triangle{<0.0,0.0,0.0>,<0.0,0.0,1.0>,<1.0,0.0,1.0>}
   triangle{<0.0,0.0,0.0>,<1.0,0.0,0.0>,<1.0,0.0,1.0>}
}

object {Block}
object {Block}
object {Block}
...

This allows POV to use the same mesh data in separate objects. It may 
not cause much of an efficiency increase here, but in meshes with more 
triangles it can make a big difference.

Also, there is nothing wrong with a box having a thickness of 0, 
although I often prefer to avoid all infinitely thin shapes in my scene. 
This probably wouldn't make any difference in memory or speed, though.

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Mike Williams
Subject: Re: rectangles
Date: 21 Jun 2000 01:26:54
Message: <+Gck8CAlyEU5Ew7U@econym.demon.co.uk>
Wasn't it Christoph Hormann who wrote:
>
>Because I needed some simple rectangle shape for a scene I am working on
>and because it is used about 1000 times in the scene, I tried some
>different possibilities building that shape and checked
>memory-use/tracing time.  
>
>It is just a very quick test on a concrete scene, differences in time
>are quite low, so you probably can not say anything definitive from
>these values (did not want to wait longer :-).  BTW, scene also contains
>many other objects.  
>
>Any comments/ideas ?

I'd guess that the vast majority of the tracing time would be consumed
by looking for the bounding boxes which have been automatically
generated. Each ray has to be checked against all 1000 bounding boxes,
but once the bounding boxes have been located, the ray only has to be
checked against at most one actual object. (Because the object exactly
fills the bounding box, if there's no reflection or transparency the ray
will always terminate at the first object). So the construction details
of your object would only be expected to have a tiny influence the trace
time.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Christoph Hormann
Subject: Re: rectangles
Date: 21 Jun 2000 01:42:55
Message: <395055E0.3E4623FC@schunter.etc.tu-bs.de>
Chris Huff wrote:
> 
> Perhaps you should try something like:
> 
> #declare Block =
> mesh {
>    triangle{<0.0,0.0,0.0>,<0.0,0.0,1.0>,<1.0,0.0,1.0>}
>    triangle{<0.0,0.0,0.0>,<1.0,0.0,0.0>,<1.0,0.0,1.0>}
> }
> 
> object {Block}
> object {Block}
> object {Block}
> ...

Of course that's what I did with all objects, sorry I did not write it
in that point.

> 
> This allows POV to use the same mesh data in separate objects. It may
> not cause much of an efficiency increase here, but in meshes with more
> triangles it can make a big difference.
> 

AFAIK with large meshes, mesh { triangle... } will also be much better
than union { triangle...}

Christoph

--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Christoph Hormann
Subject: Re: rectangles
Date: 21 Jun 2000 01:42:58
Message: <395055E2.2AE0E761@schunter.etc.tu-bs.de>
Peter Popov wrote:
> 
> You've missed one. A zero-thickness box (yes it works). Try something
> like box { <-1,0,-1>, <1,0,1> } and see what happens. It should render
> faster than a regular box.
> 

I didn't know, it is possible ( similar to cylinder ) but definitely
worth trying.  

Christoph

--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Christoph Hormann
Subject: Re: rectangles
Date: 21 Jun 2000 01:43:02
Message: <395055E7.E9860113@schunter.etc.tu-bs.de>
Mike Williams wrote:
> 
> I'd guess that the vast majority of the tracing time would be consumed
> by looking for the bounding boxes which have been automatically
> generated. Each ray has to be checked against all 1000 bounding boxes,
> but once the bounding boxes have been located, the ray only has to be
> checked against at most one actual object. (Because the object exactly
> fills the bounding box, if there's no reflection or transparency the ray
> will always terminate at the first object). So the construction details
> of your object would only be expected to have a tiny influence the trace
> time.
> 

your argumentation sounds quite reasonable, even though objects are
partly transparent in this case :-) I also looked more on the memory 
point, where differences are much larger.  

Christoph

--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Warp
Subject: Re: rectangles
Date: 21 Jun 2000 05:25:54
Message: <39508a21@news.povray.org>
Christoph Hormann <Chr### [at] schunteretctu-bsde> wrote:
: AFAIK with large meshes, mesh { triangle... } will also be much better
: than union { triangle...}

  A mesh takes a lot less memory than a union of triangles.
  Perhaps a bit surprisingly a union does not render considerably slower than
a mesh (although one could think that a mesh could have some optimizations).

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Warp
Subject: Re: rectangles
Date: 21 Jun 2000 05:28:00
Message: <39508a9f@news.povray.org>
Have you tested if there's any difference in render time between putting
all those 1000 rectangles into a union or separately in the scene?
  Povray may be able to make some bounding box optimizations with unions,
but I may remember wrong.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Fabian BRAU
Subject: Re: rectangles
Date: 21 Jun 2000 06:13:48
Message: <3950954C.56F4A98A@umh.ac.be>
Question:

is the majority of the memory is used by the rectangle or not?
Because one mesh of an object or 1000 mesh (copies) of the
same mesh use almost the same amount of memory. So if the 
answer of my question is yes I dont understand why there is no
more difference between mesh and box for the memory peak.

Fabian.


> 
> Because I needed some simple rectangle shape for a scene I am working on
> and because it is used about 1000 times in the scene, I tried some
> different possibilities building that shape and checked
> memory-use/tracing time.
> 
> It is just a very quick test on a concrete scene, differences in time
> are quite low, so you probably can not say anything definitive from
> these values (did not want to wait longer :-).  BTW, scene also contains
> many other objects.
> 
> Any comments/ideas ?
> 
> Christoph
> 
> Objects I tested:
> 
> //------------------------------
> 
> mesh {
>    triangle{<0.0,0.0,0.0>,<0.0,0.0,1.0>,<1.0,0.0,1.0>}
>    triangle{<0.0,0.0,0.0>,<1.0,0.0,0.0>,<1.0,0.0,1.0>}
> }
> 
> //------------------------------
> 
> union {
>    triangle{<0.0,0.0,0.0>,<0.0,0.0,1.0>,<1.0,0.0,1.0>}
>    triangle{<0.0,0.0,0.0>,<1.0,0.0,0.0>,<1.0,0.0,1.0>}
> }
> 
> //------------------------------
> 
> box {
>    <0, -0.00001, 0>
>    <1,  0.00001, 1>
> }
> 
> //------------------------------
> 
> plane {
>   y, 0.0
>   hollow on
>   clipped_by { box
>    { <0, -0.1, 0>
>      <1,  0.1, 1> } }
> }
> 
> //------------------------------
> 
> polygon {
>   5, <0, 0>, <0, 1>, <1, 1>, <1, 0>, <0, 0>
>   rotate 90*x
> }
> 
> //------------------------------
> 
> Time/memory data:
> 
> ###################################################################
> -------------------------------------------------------------------
> mesh
> -------------------------------------------------------------------
> Peak memory used:         47840394 bytes
> -------------------------------------------------------------------
> Time For Parse:    0 hours  0 minutes  10.0 seconds (10 seconds)
> Time For Trace:    0 hours  3 minutes   7.0 seconds (187 seconds)
>     Total Time:    0 hours  3 minutes  17.0 seconds (197 seconds)
> ###################################################################
> -------------------------------------------------------------------
> union
> -------------------------------------------------------------------
> Peak memory used:         47803698 bytes
> -------------------------------------------------------------------
> Time For Parse:    0 hours  0 minutes  11.0 seconds (11 seconds)
> Time For Trace:    0 hours  3 minutes   3.0 seconds (183 seconds)
>     Total Time:    0 hours  3 minutes  14.0 seconds (194 seconds)
> ###################################################################
> -------------------------------------------------------------------
> box
> -------------------------------------------------------------------
> Peak memory used:         47920778 bytes
> -------------------------------------------------------------------
> Time For Parse:    0 hours  0 minutes  10.0 seconds (10 seconds)
> Time For Trace:    0 hours  3 minutes   2.0 seconds (182 seconds)
>     Total Time:    0 hours  3 minutes  12.0 seconds (192 seconds)
> ###################################################################
> -------------------------------------------------------------------
> clipped plane
> -------------------------------------------------------------------
> Peak memory used:         48296618 bytes
> -------------------------------------------------------------------
> Time For Parse:    0 hours  0 minutes  10.0 seconds (10 seconds)
> Time For Trace:    0 hours  3 minutes   0.0 seconds (180 seconds)
>     Total Time:    0 hours  3 minutes  10.0 seconds (190 seconds)
> ###################################################################
> -------------------------------------------------------------------
> polygon
> -------------------------------------------------------------------
> Peak memory used:         47882238 bytes
> -------------------------------------------------------------------
> Time For Parse:    0 hours  0 minutes  10.0 seconds (10 seconds)
> Time For Trace:    0 hours  2 minutes  57.0 seconds (177 seconds)
>     Total Time:    0 hours  3 minutes   7.0 seconds (187 seconds)
> ###################################################################
> 
> --
> Christoph Hormann <chr### [at] gmxde>
> Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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