POV-Ray : Newsgroups : povray.newusers : if version patch present condition : Re: if version patch present condition Server Time
2 May 2024 14:40:33 EDT (-0400)
  Re: if version patch present condition  
From: clipka
Date: 31 Jan 2015 03:26:01
Message: <54cc9199$1@news.povray.org>
Am 27.01.2015 um 09:34 schrieb Mr:
> Hi, there is something I want to do with the version directive, could you
> confirm it's possible? I want to add some options to a texture which are
> specific
> to uberpov in a scene, but still be able to run it with pov 3.7 just ignoring
> them. would it be possible?

Not yet, but I'm currently building UberPOV v1.37.1.0-beta.9, which will 
auto-define a variable for this purpose, allowing you to use the 
following procedure for feature detection:

#ifdef(unofficial)

   // UberPOV predefines a global variable "unofficial" to identify
   // as an unofficial branch, containing a string value for further
   // identification.

   #if(unofficial = "patch")

     // UberPOV identifies as "patch" (rather than "UberPOV") to
     // indicate that it is a collection of various patches, and
     // that it defines a function "patch(STRING)" returning a
     // numeric value to retrieve further information.

     #if(patch("upov-reflection-roughness") > 0)

       // UberPOV returns a non-zero value for this function call
       // to indicate that it supports the "roughness" keyword
       // in the reflection block. The return value also serves as
       // a feature-specific version number in case the functionality
       // changes in the future.

       // Note that the mechanism is not intended to tell you whether
       // this actually /is/ UberPOV; the intention is that any
       // unofficial POV-Ray branch that supports the same feature
       // in the same way as UberPOV would have the patch() function
       // behave in exactly the same manner.

       roughness 0.1

     #end
   #end
#end


Post a reply to this message

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