POV-Ray : Newsgroups : povray.unofficial.patches : Bug in default texture Server Time
2 Nov 2024 09:20:54 EDT (-0400)
  Bug in default texture (Message 1 to 3 of 3)  
From: Sigmund Kyrre Aas
Subject: Bug in default texture
Date: 26 Dec 1999 10:22:13
Message: <38663278.C358B295@stud.ntnu.no>
Try rendering this in MegaPov 0.3 with and without the default{}
statement.
You'll see that the shadow from the transparent disc will become
black when default{} is present.

sig.


default {
   texture { pigment { rgb x } } 
}

disc { <0, 10, 0> y,  35,  10
    pigment { color rgbf <1,.97,1, .9> }
    //normal { wrinkles 0.01 scale <10,1,10> }
    finish {
        specular .8
        roughness 0.001
        ambient 0
        diffuse 0
        reflection .1
    }
}

box { <-5, -1, -5 >*100 <5, -.001, 5>*100 
    pigment {colour rgb <0,0,.1>}
    finish {
        diffuse .9
        brilliance .4
        specular .6
        roughness 0.2
        ambient .05
    }
}

camera {
  location  <2 ,5 ,9>*12
  look_at   <-1 , 0 ,13> 
  angle 50
}

light_source { <-2, 2, -5>*1000 color rgb 1 }


Post a reply to this message

From: mr art
Subject: Re: Bug in default texture
Date: 26 Dec 1999 11:33:04
Message: <38664329.A6DF285A@gci.net>
Sigmund Kyrre Aas wrote:
> 
> Try rendering this in MegaPov 0.3 with and without the default{}
> statement.
> You'll see that the shadow from the transparent disc will become
> black when default{} is present.
> 
> sig.
> 
> default{texture{pigment{rgb x}}}

Thinking that it had something to do with what was included in
the #default {} block, I tried including/excluding most of the
options: pigment{} normal{} finish{}
#default {texture {}} returns no error messages ( and it shouldn't )
#default {texture {pigment{}}}
	returns a "no pigment" error( and it should )
#default {texture {normal {}}}
	returns a "no normal" error( and it should )
#default {texture {finish {}}}
	returns no error messages ( and it shouldn't )
It is as if #default carries a finish that overrides even declared
finishes. I hope this helps in the bug hunt.


Post a reply to this message

From: Nathan Kopp
Subject: Re: Bug in default texture
Date: 26 Dec 1999 21:00:26
Message: <3866c83a@news.povray.org>
Sigmund Kyrre Aas <as### [at] studntnuno> wrote...
> Try rendering this in MegaPov 0.3 with and without the default{}
> statement.
> You'll see that the shadow from the transparent disc will become
> black when default{} is present.
>

I found and fixed the problem.

Here's a detailed description:

The problem was with a flag (HAS_FILTER) and another flag (POST_DONE) that
are internal properties of pigments and textures.  If a pigment has any
filter or transmit, then the HAS_FILTER flag should be set after the texture
has been parsed (what is called a post-process step).  Once that
post-processing is done, POST_DONE gets set to true.  Somehow the POST_DONE
of the default texture got copied to the object's texture.  Because of this,
MegaPov thought it already did the post-processing, and therefore HAS_FILTER
never got set.

When doing shadow computations, POV uses a shortcut:  if HAS_FILTER is not
set, then it knows that the object will block 100% of light, and therefore
does not need to waste computations calculating the texture.

In this case, HAS_FILTER was not set, so POV didn't even check to see if the
filter existed during shadow computations.

BTW, I do not know why this is not visible in the official version.
Probably a line got deleted in MegaPov during the addition of one of the
patches.

-Nathan


Post a reply to this message

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