POV-Ray : Newsgroups : povray.bugreports : Re: Is this a bug? Server Time
23 Jun 2024 15:16:47 EDT (-0400)
  Re: Is this a bug? (Message 1 to 1 of 1)  
From: Ron Parker
Subject: Re: Is this a bug?
Date: 3 Sep 1999 16:11:52
Message: <37d02b88@news.povray.org>
On 3 Sep 1999 12:05:59 -0400, Nieminen Juha wrote:
>  Someone discovered this bug in povray.newusers. I'm confirming that it
>really is a bug before posting a bug report.

Yes, it really is a bug.  I'm taking the liberty of posting the bug report;
hope that's okay.

>  When rendering the following scene povray issues the warning "No pigment
>type given" although there are no objects without pigment in the scene.
>  If the 'material' statement is removed and 'Test' is used as 'texture'
>instead, the warning disappears.
>
>camera { location -z*5 look_at 0 }
>light_source { <100,100,-100> 1 }
>
>#declare Test=
>  material
>  { texture { pigment { rgb x } }
>  }
>
>union
>{ sphere { -x,2 material { Test } }
>  sphere { x,2 material { Test } }
>}

Here's the problem:  In parse.c, in the function Parse_Object_Mods, the part 
that parses materials doesn't set the TEXTURED_OBJECT flag.  Here's something 
that looks like a diff but isn't really one (because my line numbers would
be wrong anyway, since I look for these things in the superpatch code):

     CASE (MATERIAL_TOKEN)
       Local_Material.Texture  = Object->Texture;
       Local_Material.Interior = Object->Interior;
       Parse_Material(&Local_Material);
       Object->Texture  = Local_Material.Texture;
+      if ( Object->Texture ) {
+        Object->Type |= TEXTURED_OBJECT;
+      }
       Object->Interior = Local_Material.Interior;
     END_CASE


Post a reply to this message

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