POV-Ray : Newsgroups : povray.beta-test : error due to directive in layered texture Server Time
29 Jul 2024 00:25:30 EDT (-0400)
  error due to directive in layered texture (Message 1 to 1 of 1)  
From: Bob Hughes
Subject: error due to directive in layered texture
Date: 15 Jul 2005 09:10:17
Message: <42d7b5b9$1@news.povray.org>
This problem goes back to version 3.6, and possibly 3.5 (I forget now), 
which is also present in 3.7 beta 6.

This minimal scene shows what happens when an #if directive is used within 
the second layer texture. At parse time it's seen as a syntax error, expects 
a closing brace but instead there's the #. Seems it is okay if the layered 
texture is not predeclared (used directly in an object). I haven't had much 
time to check into it. I remember when I brought this up before it would 
work under certain circumstances so perhaps this is why, meaning it must be 
predeclared. Sorry to bring this up again so late in the game. Better late 
than never, right? Likewise with the beta 7...?

/* test for directive error in layered texture. camera and light not needed 
*/

#local A=yes;

#declare LT=
texture {
 pigment {rgb 1}
 finish {
  #if (A=yes)
  ambient 1
  #end
 }
}
texture {
 pigment {green 1 filter 1}
 finish {
  ambient 1
  // comment out this directive...
 // #if (A=yes)
 // ambient 1
 // #end
  // ...and it will render.
 }
}

sphere {4*z, 1 texture {LT}}


Post a reply to this message

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