POV-Ray : Newsgroups : povray.general : Making Code Conditional on Quality Setting Server Time
7 Nov 2024 15:35:25 EST (-0500)
  Making Code Conditional on Quality Setting (Message 1 to 9 of 9)  
From: wacampbell
Subject: Making Code Conditional on Quality Setting
Date: 29 Sep 2003 11:30:02
Message: <web.3f784f827beb29f5458b4d510@news.povray.org>
I am interested in making some of the code in my scene file conditional on
the quality setting.  To speed up rendering, I intend to replace my
detailed models with simple cube shapes when quality=0.   I have in mind to
do something like this:

#if( Quality == 0 )
     box{ ... }
#else
     object{ DetailedModel }
#end

The word Quality doesn't seem to be recognized as a valid variable.  Does
anyone have any thoughts on how I might accomplish this.

Thanks for your help.

Wayne


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Making Code Conditional on Quality Setting
Date: 29 Sep 2003 11:41:10
Message: <3f785296$1@news.povray.org>
In article <web.3f784f827beb29f5458b4d510@news.povray.org> , "wacampbell" 
<nomail@nomail> wrote:

> I am interested in making some of the code in my scene file conditional on
> the quality setting.

Unless you have an extremely complex scene, this will not really give you
much of a benefit...

> #if( Quality == 0 )
>      box{ ... }
> #else
>      object{ DetailedModel }
> #end
>
> The word Quality doesn't seem to be recognized as a valid variable.

Why should it be recognised?  And how did you get the idea it would be
recognised?

>  Does anyone have any thoughts on how I might accomplish this.

You can declare variables on the command-line.  How to do this is explained
in the manual.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Jerry
Subject: Re: Making Code Conditional on Quality Setting
Date: 29 Sep 2003 12:41:40
Message: <jerry-980DDC.09413429092003@netplex.aussie.org>
In article <web.3f784f827beb29f5458b4d510@news.povray.org>,
 "wacampbell" <nomail@nomail> wrote:

>I am interested in making some of the code in my scene file conditional on
>the quality setting.  To speed up rendering, I intend to replace my
>The word Quality doesn't seem to be recognized as a valid variable.  Does
>anyone have any thoughts on how I might accomplish this.

As far as I know there is no such variable.

I do this also, although I usually do it as simply on/off. If I'm doing 
a complex scene, I'll have a really simple version of each 
time-consuming object (such as cones for each mountain peak) as well as 
the real version.

Something like this:

#declare FINAL=1;
#declare DRAFT=0;

#declare renderVersion=FINAL;
#declare treeVersion=DRAFT;
#declare mountainVersion=FINAL;
#declare NakedMoleRatVersion=DRAFT;
etc....

Then, in the code:

#if (renderVersion | treeVersion)
//do the real tree
#else
//do the simple tree
#end

#if (renderVersion | mountainVersion)
//do the real mountain
#else
//do the simple mountain
#end

#if (renderVersion | NakedMoleRatVersion)
//do the real naked mole rat
#else
//do the simple rat
#end


So if I set renderVersion to FINAL, then everything gets done for 
"real"; if I set it to DRAFT, then only the items whose variable is set 
to FINAL get done for real, everything else is draft.

Jerry
-- 
"Give a man a fish and you feed him for a day. Teach him to fish, and you've
depleted the lake."--It Isn't Murder If They're Yankees
(http://www.ItIsntMurder.com/)


Post a reply to this message

From: -s0da-
Subject: Re: Making Code Conditional on Quality Setting
Date: 29 Sep 2003 13:02:20
Message: <3f78659c$1@news.povray.org>
I beg to differ.  This can be a HUGE benifit.

Not so much with actual shapes, as with textures,
and light sources.  Having a "rough draft" declaration
and using it to determine whether you'd like just a flat
gray wall, or a really complicated brick texture complete
with finish, bump maps, and color maps can cut your
render time by more than half.


"Thorsten Froehlich" <tho### [at] trfde> wrote in message
news:3f785296$1@news.povray.org...
> In article <web.3f784f827beb29f5458b4d510@news.povray.org> , "wacampbell"
> <nomail@nomail> wrote:
>
> > I am interested in making some of the code in my scene file conditional
on
> > the quality setting.
>
> Unless you have an extremely complex scene, this will not really give you
> much of a benefit...
>
> > #if( Quality == 0 )
> >      box{ ... }
> > #else
> >      object{ DetailedModel }
> > #end
> >
> > The word Quality doesn't seem to be recognized as a valid variable.
>
> Why should it be recognised?  And how did you get the idea it would be
> recognised?
>
> >  Does anyone have any thoughts on how I might accomplish this.
>
> You can declare variables on the command-line.  How to do this is
explained
> in the manual.
>
>     Thorsten
>
> ____________________________________________________
> Thorsten Froehlich, Duisburg, Germany
> e-mail: tho### [at] trfde
>
> Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Gilles Tran
Subject: Re: Making Code Conditional on Quality Setting
Date: 29 Sep 2003 13:18:41
Message: <3f786971@news.povray.org>

news:3f78659c$1@news.povray.org...
> I beg to differ.  This can be a HUGE benifit.
>
> Not so much with actual shapes, as with textures,
> and light sources.  Having a "rough draft" declaration
> and using it to determine whether you'd like just a flat
> gray wall, or a really complicated brick texture complete
> with finish, bump maps, and color maps can cut your
> render time by more than half.

That's what the current quality settings already do...
The original poster asked for the quality settings to be usable for other
scene elements. The fact is that, when working one a moderately complex
scene, it's just more flexible to create one's own switches and dummies to
manage this, including textures, shapes, lights, radiosity, media etc. What
one considers to be part of a rough draft is basically scene dependent. I
may very well fine tune the radiosity using a dummy object with high rad
settings, and fine tune the corresponding complex object with low rad
settings etc.

G.

-- 

**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: David Wallace
Subject: Re: Making Code Conditional on Quality Setting
Date: 29 Sep 2003 14:24:11
Message: <3f7878cb@news.povray.org>
I second this idea.  I currently use an IsTest variable for my more complex
scenes to control draft/final renders.

My method uses true and false as opposed to custom variables.

#declare IsTest = [true/false]
#declare ObjTest = [true/false]
#declare TexTest = [true/false]

#declare UseObj = ( IsTest & ObjTest ? RealObj : StubObj )
#declare UseTex = ( IsTest & TexTest ? RealTex : StubTex )

object { UseObj texture { UseTex } }

I differ from Jerry only in that Draft=true and Final=false.


Post a reply to this message

From: Christopher James Huff
Subject: Re: Making Code Conditional on Quality Setting
Date: 29 Sep 2003 14:29:42
Message: <cjameshuff-CB177A.14290829092003@netplex.aussie.org>
In article <web.3f784f827beb29f5458b4d510@news.povray.org>,
 "wacampbell" <nomail@nomail> wrote:

> The word Quality doesn't seem to be recognized as a valid variable.  Does
> anyone have any thoughts on how I might accomplish this.

Why did you think it would be? The documentation does not say it exists, 
nor does any other document I've ever seen. On top of that, it isn't 
even a valid built-in keyword. All built-in keywords are lower-case.

There was some discussion a while ago about implementing this, maybe you 
ran across that...but it isn't, and never has been available.

As for solving your problem...as I recall, you can specify variables in 
the *.ini file and command line. The manual should have the details.

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

From: wacampbell
Subject: Re: Making Code Conditional on Quality Setting
Date: 29 Sep 2003 15:10:02
Message: <web.3f7882d371802b05458b4d510@news.povray.org>
Thanks all for your helpful input.   I understand now what I have to do.

Wayne


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Making Code Conditional on Quality Setting
Date: 29 Sep 2003 18:13:13
Message: <3f78ae79$1@news.povray.org>
In article <3f78659c$1@news.povray.org> , "-s0da-" <ske### [at] msncom>
wrote:

> Not so much with actual shapes, as with textures,
> and light sources.

But setting Quality=n / +Qn with n<=5 disables them!  That is the whole
point of having the quality option in the first place ;-)

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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