POV-Ray : Newsgroups : povray.newusers : Weird side-effect of wrinkles in a normal... Server Time
25 Nov 2024 17:39:13 EST (-0500)
  Weird side-effect of wrinkles in a normal... (Message 1 to 5 of 5)  
From: JYR
Subject: Weird side-effect of wrinkles in a normal...
Date: 8 May 2005 20:25:00
Message: <web.427ea840bc5bff406a3607400@news.povray.org>
Hi everybody!
I attempted to use "wrinkles" in a "normal" statement to give a rough finish
to the outer walls of some imaginary building. It is constructed
recursively and implies that its modules be rotated by 0, 90, 180, 270
degrees around the y-axis to take place at each corner. Now, i noticed a
slight difference in the appearance of the different modules. Investigating
further, i gathered the following minimal source to demonstrate a strange
behaviour...

//--------------------------------------------------
#version 3.6;

global_settings {assumed_gamma 1.0}

#declare degre=3;
#declare pdd=pow(2,degre);

camera {
    location  <-.25*pdd, .85*pdd, -1.6*pdd>
    look_at   (2-pdd)*y
}

light_source {<-500, 260, -240> rgb 1}

#macro cell (n)
    box {-n, n}
    texture {
        pigment {rgb 1}
        normal {wrinkles  scale .2}
    }
#end //macro cell (n)

#macro pyramide (n)
    #if (n=1)
        object {cell (1)}
    #else
        union {
            #local quadrant=0;
            #while (quadrant<4)
                object {
                    pyramide (n-1)
                    translate -pow(2,n-1)/2
                    rotate quadrant*90*y
                }
                #local quadrant=quadrant+1;
            #end //while
        }
    #end //if
#end //macro pyramide (n)

object {pyramide (degre)}

//--------------------------------------------------

You should see 16 distinct cubes grouped together, some of them much lighter
than the others. Yet stranger: if i set #version to 3.1, the 16 cubes
suddenly appear as one solid stone slab, as i expected them to. With
#version set to 3.2 or higher, the difference in color shows up. I tried to
change "noise_generator" to no avail.

Using POV-Ray for Windows, version 3.6.1a.icl8.win32, straight from the
official download site.

Any insight or explanation would be greatly appreciated!!!

J-Y

PS : a preview of said imaginary building is posted in p.b.i ...


Post a reply to this message

From: Slime
Subject: Re: Weird side-effect of wrinkles in a normal...
Date: 8 May 2005 21:41:40
Message: <427ebfd4$1@news.povray.org>
> You should see 16 distinct cubes grouped together, some of them much
lighter
> than the others. Yet stranger: if i set #version to 3.1, the 16 cubes
> suddenly appear as one solid stone slab, as i expected them to. With
> #version set to 3.2 or higher, the difference in color shows up. I tried
to
> change "noise_generator" to no avail.

That *is* weird. It looks like rotating the cubes is causing the normal
pattern to respond to light differently.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Mike Williams
Subject: Re: Weird side-effect of wrinkles in a normal...
Date: 9 May 2005 03:13:50
Message: <0H2e+AAb1wfCFwte@econym.demon.co.uk>
Wasn't it JYR who wrote:
>Hi everybody!
>I attempted to use "wrinkles" in a "normal" statement to give a rough finish
>to the outer walls of some imaginary building. It is constructed
>recursively and implies that its modules be rotated by 0, 90, 180, 270
>degrees around the y-axis to take place at each corner. Now, i noticed a
>slight difference in the appearance of the different modules. Investigating
>further, i gathered the following minimal source to demonstrate a strange
>behaviour...

I don't know why it happens, but if you're interested in a workround,
it's possible to arrange rotate the normals in the opposite direction to
the rotation of the quadrants, so that the cubes rotate but the wrinkles
don't.


#version 3.6;

global_settings {assumed_gamma 1.0}


#declare degre=3;
#declare pdd=pow(2,degre);

camera {
    location  <-.25*pdd, .85*pdd, -1.6*pdd>
    look_at   (2-pdd)*y
}

light_source {<-500, 260, -240> rgb 1}

#macro cell (n,Rot)
    box {-n, n}
    texture {
        pigment {rgb 1}
        normal {wrinkles  scale .2 rotate -Rot*90*y}
    }
#end //macro cell (n)

#macro pyramide (n,Rot)
    #if (n=1)
        object {cell (1,Rot)}
    #else
        union {
            #local quadrant=0;
            #while (quadrant<4)
                object {
                    pyramide (n-1,Rot+quadrant)
                    translate -pow(2,n-1)/2
                    rotate quadrant*90*y
                }
                #local quadrant=quadrant+1;
            #end //while
        }
    #end //if
#end //macro pyramide (n)

object {pyramide (degre,0)}




-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Abe
Subject: Re: Weird side-effect of wrinkles in a normal...
Date: 9 May 2005 06:15:00
Message: <web.427f3756cae8a0092fb55320@news.povray.org>
> Any insight or explanation would be greatly appreciated!!!
>
> J-Y
>
> PS : a preview of said imaginary building is posted in p.b.i ...

No big insight, except that it might be related to the original normal
perturbation function used by wrinkles. Try substituting
pigment_pattern{wrinkles} or function{f_wrinkles(x,y,z)} (along with
functions.inc) for wrinkles. It's not a perfect solution, but at least it
is close.

Abe


Post a reply to this message

From: JYR
Subject: Re: Weird side-effect of wrinkles in a normal...
Date: 9 May 2005 09:35:00
Message: <web.427f66a9cae8a0096a3607400@news.povray.org>
"Abe" <bul### [at] taconicnet> wrote:
> No big insight, except that it might be related to the original normal
> perturbation function used by wrinkles. Try substituting
> pigment_pattern{wrinkles} or function{f_wrinkles(x,y,z)} (along with
> functions.inc) for wrinkles. It's not a perfect solution, but at least it
> is close.
>
> Abe

Thanks to all for your answers! Abe, "pigment_pattern{wrinkles}" works just
fine. I really didn't think of converting a pattern initially created for
normal (ditto POV-Ray manual, 3.5.11.37) into a pigment pattern to use it
in a normal. And even better: i think your workaround makes a better rough
wall finish than directly applying a "wrinkles" normal pattern.

I can now go on with my scene, but I guess that leaves the following issue
open: "is it a bug or a feature?" ;-)

J-Y


Post a reply to this message

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