POV-Ray : Newsgroups : povray.advanced-users : Parsing time Server Time
26 Dec 2024 13:35:56 EST (-0500)
  Parsing time (Message 1 to 7 of 7)  
From: Joel Gilmore
Subject: Parsing time
Date: 12 Nov 1999 02:24:36
Message: <382CDAB5.C3FB86F9@mail.flashmail.com>
Hi all,
Well, I guess I'm kinda new to the rendering scene, but I've jumped
straight in, and started putting together a chess set.
Using my own pieces, I modeled a pawn, and put eight of them on a chess
board, added nice lighting (IMHO :) etc.  Then I decided to have a shot
at doing the Queen.  Using sPatch, I modeled a rather nice head, using
the lathe tool, then adding dimples around the top.
I exported to pov, but when I looked at the source code, there was over
5000 lines!  And when I render, it takes a bit over two minutes to just
parse the code.
Is there anyway to reduce this time?  Or, alternatively, get some sort
of a preview so that I can try and place it all accurately?  I could
perhaps export it to Moray instead, but I've already put together the
pawn and so forth in Pov, and I quite enjoy working with the source
code.
Thanks :)
Joel


Post a reply to this message

From: Ken
Subject: Re: Parsing time
Date: 12 Nov 1999 02:52:13
Message: <382BC6E7.3926A702@pacbell.net>
Joel Gilmore wrote:
> 
> Hi all,
> Well, I guess I'm kinda new to the rendering scene, but I've jumped
> straight in, and started putting together a chess set.
> Using my own pieces, I modeled a pawn, and put eight of them on a chess
> board, added nice lighting (IMHO :) etc.  Then I decided to have a shot
> at doing the Queen.  Using sPatch, I modeled a rather nice head, using
> the lathe tool, then adding dimples around the top.
> I exported to pov, but when I looked at the source code, there was over
> 5000 lines!  And when I render, it takes a bit over two minutes to just
> parse the code.
> Is there anyway to reduce this time?  Or, alternatively, get some sort
> of a preview so that I can try and place it all accurately?  I could
> perhaps export it to Moray instead, but I've already put together the
> pawn and so forth in Pov, and I quite enjoy working with the source
> code.
> Thanks :)
> Joel

 Welcome to the world of raytracing. It is not fast but it is beautiful
when finished. I have done scenes that have over 150,000 lines of code :)
Really if you want to speed up your scene for position and testing purposes
you could make a dummy piece about the same size as the queen out of
say a cylinder or a box and comment out the other 5000 lines of code.
They will not be parsed if they are commented out and the box or cylinder
will parse very quickly. Once you have the coordinates established you
can transfer those to your real object and use that for postioning purposes.

-- 
Ken Tyler -  1200+ 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: omniVERSE
Subject: Re: Parsing time
Date: 12 Nov 1999 03:22:54
Message: <382bce5e@news.povray.org>
Maybe the triangle mesh compressor can help:
http://www.geocities.com/SiliconValley/Lakes/1434/pcm.html
Check out about it all there. Since I don't have sPatch here right now and
used it so little I can't confirm it will be of the correct form (sPatch
outputs bicubic_patch is all I know of so if triangle output is possible
guess that would be the one to choose) to be worked on by the mesh
compressor. Surely someone else knows.
Like Ken says the best way of previewing a lengthy parsing mesh would be to
approximate the basic shape with primitives, there is also the command-line
quality option +q# where # is 0 to 11, probably not a lot of help in this
case.  Being one to prefer CSG rather than meshes guess I'm not really one
to answer anyway. But I did, oops.

Bob


Post a reply to this message

From: Ken
Subject: Re: Parsing time
Date: 12 Nov 1999 03:32:45
Message: <382BD064.10688A9A@pacbell.net>
omniVERSE wrote:
> 
> Maybe the triangle mesh compressor can help:
> http://www.geocities.com/SiliconValley/Lakes/1434/pcm.html
> Check out about it all there. Since I don't have sPatch here right now and
> used it so little I can't confirm it will be of the correct form (sPatch
> outputs bicubic_patch is all I know of so if triangle output is possible
> guess that would be the one to choose) to be worked on by the mesh
> compressor. Surely someone else knows.
> Like Ken says the best way of previewing a lengthy parsing mesh would be to
> approximate the basic shape with primitives, there is also the command-line
> quality option +q# where # is 0 to 11, probably not a lot of help in this
> case.  Being one to prefer CSG rather than meshes guess I'm not really one
> to answer anyway. But I did, oops.
> 
> Bob

The real reason the 5000 lines of bicubic patches is taking so long to parse
is because each patch is being individualy subdivided internaly in pov into
a triangle mesh object. If the 5000 lines of code equal say 900 patches you
probably have something like 50,000 triangles to compute the locations of.
I am totaly guessing on the actual numbers here though the approximations
are close enough to let you know why it takes so long.

Anyway I do not consider 2 min. a long parse time since I learned how to
use while loops. In fact I am usualy happy these days if I can get a scene
to parse in just under 2 min. :)

-- 
Ken Tyler -  1200+ 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: Gilles Tran
Subject: Re: Parsing time
Date: 12 Nov 1999 07:05:12
Message: <382C0262.ABC434D5@inapg.inra.fr>
One solution is to export to DXF (low or medium resolution) and convert to
a mesh file (using Crossroads for instance). I've run comparative tests
some time ago on a 256 bezier patches / 2 Mo mesh and the mesh has the
following advantages : it parses faster, render faster, uses less memory,
it can be replicated in a scene many times with negligible memory overhead
(while replicating bezier patches more or less replicates the memory used
for each object), and it can be easily uv-mapped (if using a uv-mapping
syntax). The only negative aspect of meshes is the file size, which can be
huge. Since spatch lets you choose between several mesh resolutions, you
can do your tests on a small resolution mesh and use the medium (or high,
but these one are really big) mesh for the final tests. Of course, huge
meshes will take time to parse too. Mesh2 (Superpatch, UVpatch) meshes
parse much faster than official meshes.

Gilles

Joel Gilmore wrote:

> Hi all,
> Well, I guess I'm kinda new to the rendering scene, but I've jumped
> straight in, and started putting together a chess set.
> Using my own pieces, I modeled a pawn, and put eight of them on a chess
> board, added nice lighting (IMHO :) etc.  Then I decided to have a shot
> at doing the Queen.  Using sPatch, I modeled a rather nice head, using
> the lathe tool, then adding dimples around the top.
> I exported to pov, but when I looked at the source code, there was over
> 5000 lines!  And when I render, it takes a bit over two minutes to just
> parse the code.
> Is there anyway to reduce this time?  Or, alternatively, get some sort
> of a preview so that I can try and place it all accurately?  I could
> perhaps export it to Moray instead, but I've already put together the
> pawn and so forth in Pov, and I quite enjoy working with the source
> code.
> Thanks :)
> Joel


Post a reply to this message

From: Mike
Subject: Re: Parsing time
Date: 12 Nov 1999 07:52:19
Message: <382C0B21.86FC4127@aol.com>
> I exported to pov, but when I looked at the source code, there was over
> 5000 lines!  And when I render, it takes a bit over two minutes to just
> parse the code.
> Is there anyway to reduce this time?

Get a copy of the superpatch and run a replace on the file in the editor
like:

find: type 1
replace with:  type 2
find: u_steps 3
replace with:
find: v_steps 3
replace with: accuracy .01

I forget what type sPatch uses by default or the u and v steps, but the
idea is to make the patches have

type 2
accuracy .01

and to remove the u and v steps.  This type of bezier patch will parse very
quickly and the speed is comparable to a triangle mesh.

> Or, alternatively, get some sort
> of a preview so that I can try and place it all accurately?

Use a dummy object, like a cylinder, that is the same size as your chess
piece.  Just check the size of the object in sPatch and have the cylinder
use about the same dimensions.  When you have the right tranformations
simply replace the cylinder with the object you want to use.

-Mike


Post a reply to this message

From: Nieminen Juha
Subject: Re: Parsing time
Date: 12 Nov 1999 10:19:39
Message: <382c300b@news.povray.org>
One solution besides the ones already suggested is just modelling the
chess piece again with less patches. A chess queen piece doesn't sound like
it would need 5000 lines of bicubic patches. Your model is probably
overdetailed (ie. most of the patches do nothing important and could be
replaced with one bigger patch).
  Just a though.

-- 
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

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