POV-Ray : Newsgroups : povray.text.scene-files : Something weird with gamma and the camera : Re: Something weird with gamma and the camera Server Time
18 May 2024 05:55:20 EDT (-0400)
  Re: Something weird with gamma and the camera  
From: Kenneth
Date: 25 Jan 2016 03:50:03
Message: <web.56a5dfff85b549be33c457550@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
>
> .... However, in order to
> not break the main scene's "#version" choice, it needs to revert the
> change at the end of the file; this is done using the following
> construct (which also acts as a guard against double inclusion):
>
>     #ifndef(FOO_INC_TEMP)
>     #declare FOO_INC_TEMP = version;
>     #version 3.5; // for example
>
>     // include file content goes here
>
>     #version FOO_INC_TEMP
>     #end
>

Thanks for that. It's the best explanation I've seen for why that code is
placed at the beginning and end of all built-in #include files. I have to admit
that I've never fully understood the code's full purpose until now.

The way that the #version directive is described in the documentation may have
been part of the reason why I didn't fully grasp it.  The docs give this
example...

#local Temp_Vers = version;  // Save previous value
#version 1.0;              // Change to 1.0 mode
..... // Version 1.0 stuff goes here...
#version Temp_Vers;        // Restore previous version

IMO, the comment "Save previous value" (or version) in that first line should
instead say, "Save current version", as that is what is really meant there.  (I
do now realize that, when including an #include file in a scene, the SCENE's
#version would be the meaning of "previous value"-- but it's a little bit
confusing, when read 'out of context' in the docs there.)

A question out of curiosity (and using your #include file example above of the
variable name #ifndef(FOO_INC_TEMP) : Is the reason for using such 'odd'
variable names in #include files (of which some *are* rather odd) so that the
chances of it being an *actual* variable name in a scene file are very low? In
other words, are they purposely odd so that they won't be confused with other
scene file variables that we would normally think to use? OR does it matter at
all? (as #include files use #local variables, not #declared ones)

By the way, in the 3.7 documentation concerning #version for SCENE use, it says
(in error?), "Naturally the default setting for this option is #version 3.5."
Should that say 3.62 now?


Post a reply to this message

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