POV-Ray : Newsgroups : povray.general : Text, csg & speed Server Time
4 Aug 2024 02:23:36 EDT (-0400)
  Text, csg & speed (Message 1 to 8 of 8)  
From: Jellby
Subject: Text, csg & speed
Date: 2 Sep 2003 15:12:06
Message: <3f54eb85@news.povray.org>
Hi all,

I'm modelling an engraved ring (the One Ring, actually), and I'm suffering a 
serious slow down when I add the text. Currently, the basic structure of 
the model is something like this:

  union {
    INNER_RING (inside of the letters, sort of a torus)
    difference {
      OUTER_RING (a slightly bigger torus)
      TEXT (a union of individually rotated and translated letters)
    }
  }

The whole thing is bounded_by a short cylinder of the right size. Is there 
anything I could do to improve the rendering speed? Without text it renders 
in around 2 minutes, with text it takes more than 2 hours.

-- 
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby


Post a reply to this message

From: ingo
Subject: Re: Text, csg & speed
Date: 2 Sep 2003 15:41:01
Message: <Xns93EADC93B9B9Bseed7@povray.org>
in news:3f54eb85@news.povray.org Jellby wrote:

> I'm modelling an engraved ring

A completly different approach by Remco de Korte,
http://www.xs4all.nl/~remcodek/imaginc.html

Ingo


Post a reply to this message

From: Mike Williams
Subject: Re: Text, csg & speed
Date: 2 Sep 2003 16:22:00
Message: <bJ9aMBAcnPV$Ew+p@econym.demon.co.uk>
Wasn't it Jellby who wrote:
>Hi all,
>
>I'm modelling an engraved ring (the One Ring, actually), and I'm suffering a 
>serious slow down when I add the text. Currently, the basic structure of 
>the model is something like this:
>
>  union {
>    INNER_RING (inside of the letters, sort of a torus)
>    difference {
>      OUTER_RING (a slightly bigger torus)
>      TEXT (a union of individually rotated and translated letters)
>    }
>  }
>
>The whole thing is bounded_by a short cylinder of the right size. Is there 
>anything I could do to improve the rendering speed? Without text it renders 
>in around 2 minutes, with text it takes more than 2 hours.

If possible, try cutting the OUTER_RING into letter-sized pieces,
difference one letter from each piece and union them back together
afterwards. Then remove your manual bounding, and let POV bounr it
automatically. The logic behind this is explained on my holes tutorial
page:

<http://www.econym.demon.co.uk/holetut/>

If the letters overlap, it should still work if you difference several
adjacent letters from each piece. It might sound like that would make it
run slower, but you still get the huge advantage of the tighter
bounding.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Warp
Subject: Re: Text, csg & speed
Date: 2 Sep 2003 16:24:08
Message: <3f54fc68@news.povray.org>
Jellby <jel### [at] m-yahoocom> wrote:
> Is there 
> anything I could do to improve the rendering speed?

  One thing which comes to mind is to use a cylindrical heighfield
(created by the HF_Cylinder() macro) to create the outer part of
the ring (with text and all). This would simply require you to
draw an image map suitable for this with an external painting program.
  The good thing is that you can smooth the edges of the text, which
you can't do with the text object (and in fact, if you use this method,
you certainly should because sharp edges don't work very well with
heightfields).

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Jellby
Subject: Re: Text, csg & speed
Date: 4 Sep 2003 15:13:37
Message: <3f578ee0@news.povray.org>
Among other things, Mike Williams wrote:

>>I'm modelling an engraved ring (the One Ring, actually), and I'm suffering
>>a serious slow down when I add the text. Currently, the basic structure of
>>the model is something like this:
>>
>>  union {
>>    INNER_RING (inside of the letters, sort of a torus)
>>    difference {
>>      OUTER_RING (a slightly bigger torus)
>>      TEXT (a union of individually rotated and translated letters)
>>    }
>>  }
>>
>>The whole thing is bounded_by a short cylinder of the right size. Is there
>>anything I could do to improve the rendering speed? Without text it
>>renders in around 2 minutes, with text it takes more than 2 hours.
> 
> If possible, try cutting the OUTER_RING into letter-sized pieces,
> difference one letter from each piece and union them back together
> afterwards. Then remove your manual bounding, and let POV bounr it
> automatically.

Thanks for the ideas (yours and the other posters'). I tried this, but it 
was becoming a too complicated code and I didn't see much improvement (I 
assume it would have worked if I had done it right from the beginning).

However, if I manually bound each letter inside the TEXT union, render time 
goes from 180 to 18 minutes (True Type Font test percentage: 44%). I 
thought they would have been automatically bounded, since they are inside a 
union...

-- 
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby


Post a reply to this message

From: Mike Williams
Subject: Re: Text, csg & speed
Date: 4 Sep 2003 21:58:44
Message: <QIIIcAALs+V$EwOz@econym.demon.co.uk>
Wasn't it Jellby who wrote:
>Among other things, Mike Williams wrote:
>
>>>I'm modelling an engraved ring (the One Ring, actually), and I'm suffering
>>>a serious slow down when I add the text. Currently, the basic structure of
>>>the model is something like this:
>>>
>>>  union {
>>>    INNER_RING (inside of the letters, sort of a torus)
>>>    difference {
>>>      OUTER_RING (a slightly bigger torus)
>>>      TEXT (a union of individually rotated and translated letters)
>>>    }
>>>  }
>>>
>>>The whole thing is bounded_by a short cylinder of the right size. Is there
>>>anything I could do to improve the rendering speed? Without text it
>>>renders in around 2 minutes, with text it takes more than 2 hours.
>> 
>> If possible, try cutting the OUTER_RING into letter-sized pieces,
>> difference one letter from each piece and union them back together
>> afterwards. Then remove your manual bounding, and let POV bounr it
>> automatically.
>
>Thanks for the ideas (yours and the other posters'). I tried this, but it 
>was becoming a too complicated code and I didn't see much improvement (I 
>assume it would have worked if I had done it right from the beginning).
>
>However, if I manually bound each letter inside the TEXT union, render time 
>goes from 180 to 18 minutes (True Type Font test percentage: 44%). I 
>thought they would have been automatically bounded, since they are inside a 
>union...

POV automatic bounding works for unions, but it doesn't work for
differences, which is basically the whole point of the holes tutorial
page I mentioned.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Jellby
Subject: Re: Text, csg & speed
Date: 5 Sep 2003 08:30:50
Message: <3f5881f9@news.povray.org>
Among other things, Mike Williams wrote:

>>However, if I manually bound each letter inside the TEXT union, render
>>time goes from 180 to 18 minutes (True Type Font test percentage: 44%). I
>>thought they would have been automatically bounded, since they are inside
>>a union...
> 
> POV automatic bounding works for unions, but it doesn't work for
> differences, which is basically the whole point of the holes tutorial
> page I mentioned.

I see, I expected it to work for unions inside a difference too.

-- 
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby


Post a reply to this message

From: Christopher James Huff
Subject: Re: Text, csg & speed
Date: 5 Sep 2003 10:34:39
Message: <cjameshuff-084931.10343705092003@netplex.aussie.org>
In article <QIIIcAALs+V$EwOz@econym.demon.co.uk>,
 Mike Williams <mik### [at] econymdemoncouk> wrote:

> POV automatic bounding works for unions, but it doesn't work for
> differences, which is basically the whole point of the holes tutorial
> page I mentioned.

It does work in most cases, but does not produce bounds that are as 
optimal as what a human looking at the involved shapes could come up 
with. The same goes for intersections...I think POV simply intersects 
the bounding boxes, which can result in very loose bounding. Your 
message implied that there was no bounding done at all.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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