POV-Ray : Newsgroups : povray.binaries.images : Problem with textobject. Server Time
3 Oct 2024 09:24:51 EDT (-0400)
  Problem with textobject. (Message 1 to 9 of 9)  
From: Lo van den Berg
Subject: Problem with textobject.
Date: 4 Feb 2000 08:49:35
Message: <389AD918.39A1D321@yahoo.com>
Hi,

I have made the following simple image. It renders in under 4 minutes.
To my astonishment the addition of a text object causes a render time
43times longer than without. The source is included and contains the
version with the textobject.

At 576x432:
with Textobject : 2h 54m
without Textobject: 0h 4m

Also the statistics tell me:
Ray->Shape Intersection          Tests       Succeeded  Percentage
True Type Font                60249600           11479      0.02

Why? Can anybody explain?

Lo van den Berg
lov### [at] yahoocom


Post a reply to this message


Attachments:
Download 'joy_0.03.49.jpg' (49 KB) Download 'us-ascii' (3 KB)

Preview of image 'joy_0.03.49.jpg'
joy_0.03.49.jpg

From: Peter Warren
Subject: Re: Problem with textobject.
Date: 4 Feb 2000 09:21:52
Message: <389ae080@news.povray.org>
Pardon me for my rudeness but...

What is your point?

Text Objects take a long time to render in Pov?

I cannot provide you with a technical explanation
of this.

You have posted an interesting image.

Peter Warren
war### [at] hotmailcom


Post a reply to this message

From: Ken
Subject: Re: Problem with textobject.
Date: 4 Feb 2000 09:31:35
Message: <389AE2C2.30701F15@pacbell.net>
Peter Warren wrote:
> 
> Pardon me for my rudeness but...
> 
> What is your point?
> 
> Text Objects take a long time to render in Pov?
> 
> I cannot provide you with a technical explanation
> of this.

From a conversation with Ron Parker:

The text object is represented as a CSG union, with each glyph being a
separate object. A glyph is represented internally as a series of quadratic
curves (which require a large number of mathematical calculations).

To test for insideness, POV first makes sure the point is between the front
and back planes of the glyph, then makes sure the projection of the point
into X,Y space falls inside the glyph representation by counting crossings.

To intersect a ray, POV first finds the intersection points of the ray 
with the front and back planes.  Those points are projected onto the plane
and tested to make sure they're inside the glyph representation before
being pushed onto the intersection stack.  Finally, it projects the ray
itself into the plane (skipping the case where the ray is parallel to the
extrusion direction) and tests the projection of the ray against each curve
in the glyph representation.
--------------------

Now if we take what we learned above it becomes apparent that the text
object in it's own right requires quite a few calculations to represent
properly. If we now use the text object in a CSG operation we add greatly
to the number of ray intersection tests needed which consequently adds to
the render time of the scene it is used in.


-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Fabian Brau
Subject: Re: Problem with textobject.
Date: 4 Feb 2000 10:06:23
Message: <389AEBC5.1199CD0E@umh.ac.be>
Hello,

a simple solution is to use Elefont (http://www.armanisoft.ch) 
it's free. The text will be save as DXF. After you transform DXF to 
POV with Crossroad (http://www.europa.com/~keithr/crossroads/) or 
with 3DWin (http://www.stmuc.com/thbaier/). Then the text will be a 
mesh (use WinMeshComp 
(http://www.geocities.com/SiliconValley/Lakes/1434/download/mc21win.zip) 
to reduce the size of the include and/or to transform into Mesh2 if you 
use MegaPov). Mesh and Mesh2 are much fast to render than text object.

I hope this help.

Fabian Brau.

Lo van den Berg wrote:
> 
> Hi,
> 
> I have made the following simple image. It renders in under 4 minutes.
> To my astonishment the addition of a text object causes a render time
> 43times longer than without. The source is included and contains the
> version with the textobject.
> 
> At 576x432:
> with Textobject : 2h 54m
> without Textobject: 0h 4m
> 
> Also the statistics tell me:
> Ray->Shape Intersection          Tests       Succeeded  Percentage
> True Type Font                60249600           11479      0.02
> 
> Why? Can anybody explain?
> 
> Lo van den Berg
> lov### [at] yahoocom
> 
>   ------------------------------------------------------------------------
>  [Image]
> 
>   ------------------------------------------------------------------------
> #include "colors.inc"
> #include "metals.inc"
> #include "golds.inc"
> 
> // -----------------TEXTURES---------------
> #declare Tx1=texture {
>         T_Gold_5D
>         normal {
>                 granite .35
>                 turbulence .25
>                 frequency 5
>         }
>         scale 2.111
> }
> 
> #declare Tx2=texture {
>         T_Chrome_2A
>         normal {
>                 bumps .81
>                 turbulence .77
>         }
>         finish {
>                 reflection 0.1
>                 metallic
>         }
>         scale 2.21
> }
> 
> #declare BaseTexture=texture {
>         pigment { color White }
>         finish { reflection 0.23 }
> }
> 
> #declare RecursionTexture=texture {
>         pigment { color Black }
>         finish { reflection 0.43 }
> }
> 
> #declare JoyTexture=texture {
>         pigment {
>                 color rgb <24/255,107/255,165/255>
>         }
>         finish {
>                 reflection 0.6
>         }
> }
> 
> #declare MaterialTexture=texture {
>         material_map {
>                 gif "joy.gif"
>                 interpolate 2
>                 texture { RecursionTexture }
>                 texture { JoyTexture }
>         }
>         rotate 90*x
> }
> 
> // -----------------MACROS---------------
> #macro RecText( iRecLevel,iScaleFraction,iBaseTexture,iRecTexture )
> texture {
>         checker
>         texture { iBaseTexture }
> #if (iRecLevel=0)
>         texture { iRecTexture }
> #else
>         RecText( iRecLevel-1,iScaleFraction,iRecTexture,iBaseTexture )
>         scale 1/iScaleFraction
> #end
> }
> #end
> 
> plane {
>         y, 0
>         RecText( 2, 3, MaterialTexture, RecursionTexture )
> }
> 
> camera
> {
>         location < 0.0, 2.0,-7.0>
>         look_at < 0.0, 0.5, 0.0>
> //      look_at < 0.0, 0.0,-7.0>
> }
> 
> light_source
> {
>         < 0.0, 20.0, -20.0>
>         color White
> }
> 
> light_source
> {
>         < 20.0, 25.0, -25.0>
>         color White
> }
> 
> difference {
>         plane {
>                 z, 0
>                 texture {
>                         material_map {
>                                 gif "joy.gif"
>                                 interpolate 2
>                                 once
>                                 texture { pigment { color rgbt <0,0,0,1> } }
>                                 texture { Tx2 }
>                         }
>                         translate <-0.5,-0.03, 0.0>
>                         scale 3
>                 }
>                 bounded_by {
>                         box { <-1.5, 0.0,-0.01>,<1.5,3.0,0.01> }
>                 }
>         }
>         text {
>                 ttf "timrom.ttf"
>                 "High Tech Automation"
>                 0.1, 0
>                 scale 0.15
>                 translate <-0.2, 2.6,-0.01>
>         }
>         hollow
> }
> 
> intersection {
>         plane {
>                 z, 0
>                 texture {
>                         material_map {
>                                 gif "joy.gif"
>                                 interpolate 2
>                                 once
>                                 texture { JoyTexture }
>                                 texture { pigment { color rgbt <0,0,0,1> } }
>                         }
>                 }
>         }
>         box {
>                 < 0.01,0.01,-0.01>, < 0.99,0.99,0.01>
>                 texture { pigment { color rgbt <0,0,0,1> } }
>         }
>         translate <-0.1,-0.03,-0.3>
>         scale 3
>         hollow
> }
> 
> light_source {
>         < 3,4,-3>,
>         color White
>         spotlight
>         radius 15
>         falloff 20
>         point_at <0,1.5,-0.3>
> }
> 
> /*
> fog {
>         fog_type 2
>         color rgbt <1,1,1,0.3>
>         distance 10
>         fog_offset 0
>         fog_alt 1
> }
> */


Post a reply to this message

From: Lo van den Berg
Subject: Re: Problem with textobject.
Date: 4 Feb 2000 10:55:00
Message: <389AF5A4.FECC7D4F@yahoo.com>
Well, thanks for the tips and the information...

Lo van den Berg
lov### [at] yahoocom


Post a reply to this message

From: Chris Huff
Subject: Re: Problem with textobject.
Date: 4 Feb 2000 15:33:46
Message: <chrishuff_99-1CFE85.15343804022000@news.povray.org>
In article <389AE2C2.30701F15@pacbell.net>, lin### [at] povrayorg 
wrote:

> Now if we take what we learned above it becomes apparent that the text
> object in it's own right requires quite a few calculations to represent
> properly. If we now use the text object in a CSG operation we add greatly
> to the number of ray intersection tests needed which consequently adds to
> the render time of the scene it is used in.

Also, the text object is differenced from a plane. Since a plane is 
infinite, the combination of plane - text object is tested for every 
pixel. If you used a large box instead of a plane, you would probably 
notice a big increase in rendering speed, since the object can be 
bounded so it is only tested for in a specific area. To possibly get 
even more of a speedup, use a separate box for the area with the text 
object differenced from it, and surround it with other boxes to create a 
seamless floor.(confining the area with the text object CSG to as small 
an area as possible)

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Mike Williams
Subject: Re: Problem with textobject.
Date: 4 Feb 2000 16:07:37
Message: <mYReZBAXazm4Ewdd@econym.demon.co.uk>
Wasn't it Lo van den Berg who wrote:
>Hi,
>
>I have made the following simple image. It renders in under 4 minutes.
>To my astonishment the addition of a text object causes a render time
>43times longer than without. The source is included and contains the
>version with the textobject.
>
>At 576x432:
>with Textobject : 2h 54m
>without Textobject: 0h 4m
>
>Also the statistics tell me:
>Ray->Shape Intersection          Tests       Succeeded  Percentage
>True Type Font                60249600           11479      0.02
>
>Why? Can anybody explain?


I can't really explain the exact technical details about what is
happening, but I can give you a rough idea, and provide a fix.

What's happening is that the automatic generation of bounding slabs has
some sort of a problem with CGI differences, and this is causing it to
check for intersections with the text in lots of places where the text
can't possibly be.

The fix is to add a manual bounding box to the text, like:-

        text {
                ttf "timrom.ttf"
                "High Tech Automation"
                0.1, 0
                scale 0.15
                translate <-0.2, 2.6,-0.01>
                bounded_by {
                        box { <-0.2, 2.6,-0.01>,<1.5,3.0,0.01> }
                }
        }

With this slight change, you'll find that the version with the text
renders in only twice the time of the textless version, and there'll
only be 602,080 True Type Font tests instead of 60,249,600


Post a reply to this message

From: Chris Huff
Subject: Re: Problem with textobject.
Date: 4 Feb 2000 16:26:26
Message: <chrishuff_99-184EFE.16272004022000@news.povray.org>
In article <mYR### [at] econymdemoncouk>, Mike Williams 
<mik### [at] econymdemoncouk> wrote:

> What's happening is that the automatic generation of bounding slabs has
> some sort of a problem with CGI differences, and this is causing it to
> check for intersections with the text in lots of places where the text
> can't possibly be.

Probably due to the plane being an infinite object. Oh, and it's CSG, 
not CGI. :-)


> The fix is to add a manual bounding box to the text, like:-
> ...

Why did I not think of this? It is much better than my previously 
suggested box method...although a box is a bit faster than a plane 
anyway. Try using a single large box(instead of a plane) and also 
bounding the text object.

I still can't see how I missed that bounding thing... :-(

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Ken
Subject: Re: Problem with textobject.
Date: 4 Feb 2000 17:00:34
Message: <389B4BEC.81DBD17E@pacbell.net>
Chris Huff wrote:

> I still can't see how I missed that bounding thing... :-(

  I thought about it about 5 min. after I posted my response but
without first testing to see if it made an appreciable difference
I decided to remain silent instead - I didn't have time to test
it.

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

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