POV-Ray : Newsgroups : povray.general : #version directive : Re: #version directive Server Time
29 Apr 2024 16:15:57 EDT (-0400)
  Re: #version directive  
From: clipka
Date: 10 Feb 2018 05:52:57
Message: <5a7ecf09$1@news.povray.org>
Am 10.02.2018 um 05:52 schrieb Kenneth:
> "Kenneth" <kdw### [at] gmailcom> wrote:
>>
>> Also, this:
>> "...and a CHANGE as of POV-Ray 3.7.1 or later it is now considered an outright
>> error to use #version 3.71 or higher in a main scene file that does not start
>> with a #version directive."
>>
> 
> Not to nitpick, but I'm still having trouble 'parsing' that sentence ;-)
> The way I see it is like this (and using a bit of Clipka's clarifications):
> 
> 1) The #version directive is now a requirement (actually since v3.7.0, I think.)
> That's clear.

In v3.7.0, this "requirement" is not actually enforced. In v3.7.0, you
always get a warning if the scene does not begin with a `#version`
statement, but that's it.

> 3) but: "... to use #version 3.71 [which is in green in the docs, meaning the
> #version directive in a scene] in a a main scene file that does not start with a
> #version directive", is the troublesome part. It kind of sounds 'circular' or
> not quite logical. But I think there are two ways of reading it:
> 
>        A) An OLD scene file (one that didn't use a #version directive to begin
> with) would produce "an outright error" if #version 3.7.1 were added to it AND
> the scene were to be run in v3.7.1  (I'm actually still not sure if this
> intepretation is correct.)

Inserting `#version 3.71` would mark the "old" scene file as no longer
"old", but rather overhauled to work with v3.7.1.

>        B) Assuming that v3.7.1 (or later) *is* the currently running version,
> and the scene itself does have #version 3.7.1 in it, then the scene already HAS
> a #version directive-- definitely not a situation where the scene "does not
> start with a #version directive"(!)

That totally depends on where the `#version 3.71` directive is placed.

> In this intepretation of the sentence, it
> doesn't make much too much sense (and this is the way I generally read it,
> unfortunately... without some effort to second-guess its meaning).

Consider the following scene:

    // Just a comment
    global_settings { assumed_gamma 1.0 }
    #version 3.71;
    // ...

That scene file would raise an error, because it claims to be a scene
designed for v3.7.1 but doesn't comply with the requirement that the
scene must start with a `#version` directive. The scene should be
changed as follows:

    // Just a comment
    #version 3.71;
    global_settings { assumed_gamma 1.0 }
    // ...

The easiest way to enforce this would be to raise an error (rather than
warn, as was the case in v3.7.0) whenever the first statement is not a
`#version` directive. However, consider the following scene:

    // Just a comment
    global_settings { assumed_gamma 1.0 }
    #version 3.5;
    // ...

This is apparently a scene designed for v3.5, where there was no
requirement for an initial `#version` statement, so for the sake of
backward compatibility we want just a warning, not an error.


Post a reply to this message

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