POV-Ray : Newsgroups : povray.newusers : Reflection bluring Server Time
5 Nov 2024 03:18:02 EST (-0500)
  Reflection bluring (Message 1 to 5 of 5)  
From: jfmiller
Subject: Reflection bluring
Date: 17 Aug 2002 22:25:00
Message: <3d5f057c$1@news.povray.org>
Hi all,

I have read of about using texture_map with slightly different
normals to make a reflection appear blury.  I've tried to replicate this but
I can't seem to get it to work.  Can someone post some source code or a
tutorial on how this is done?

Thanks
JFMILLER


Post a reply to this message

From: Tim Nikias
Subject: Re: Reflection bluring
Date: 18 Aug 2002 05:37:38
Message: <3d5f6ae2@news.povray.org>
The important part about the texture is to
have same pigment and finish, but varying
normals. This is most easily done by translating
the normal for every sample using:

#declare R=seed(1);
#declare Random_Vector=<rand(R),rand(R),rand(R)>*Magnifier;

Specify an amount of samples:
#declare Blur_Samples=20;

And use the following code:

texture{
 average texture_map{
#declare Sample_Counter=0;
#while (Sample_Counter<Blur_Samples)
[ 1 pigment{Some_Pigment}
    normal{bozo .2 scale .3 translate Random_Vector}
    finish{Some_Finish}
]
#declare Sample_Counter=Sample_Counter+1;
#end
}
}

This should work fine. What it does it average the
textures, and since pigment and finish are always the same,
those aren't changed, but for every sample POV-Ray
calculates a new reflection based on the normal-map,
since that one changes for every sample, you get
a lot of different reflections, which are averaged.

Note that averaging just normals won't work, as POV-Ray
will then average the normal_map, and won't calculate
reflections for those.

Ask if you have questions...

Tim


--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde
"jfmiller" <jfm### [at] hotmailcom> schrieb im Newsbeitrag
news:3d5f057c$1@news.povray.org...
> Hi all,
>
> I have read of about using texture_map with slightly different
> normals to make a reflection appear blury.  I've tried to replicate this
but
> I can't seem to get it to work.  Can someone post some source code or a
> tutorial on how this is done?
>
> Thanks
> JFMILLER
>
>
>


Post a reply to this message

From: Christopher James Huff
Subject: Re: Reflection bluring
Date: 18 Aug 2002 12:02:37
Message: <chrishuff-76F5DF.10493118082002@netplex.aussie.org>
In article <3d5f6ae2@news.povray.org>, "Tim Nikias" <tim### [at] gmxde> 
wrote:

> This should work fine. What it does it average the
> textures, and since pigment and finish are always the same,
> those aren't changed, but for every sample POV-Ray
> calculates a new reflection based on the normal-map,
> since that one changes for every sample, you get
> a lot of different reflections, which are averaged.

That will not work. Your code calculates one random vector and uses it 
for every texture sample. All the textures your code averages will be 
identical, it will just make it render slower.

#macro BlurryTexture(Pig, Fin, Norm, BlurSamps, Amt)
    texture {average
        texture_map {
            #local J = 0;
            #while(J < BlurSamps)
                [1 pigment {Pig}
                    finish {Fin}
                    normal {Norm
                        translate <rand(R), rand(R), rand(R)>*Amt
                    }
                ]
                #local J = J + 1;
            #end
        }
    }
#end

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: jfmiller
Subject: Re: Reflection bluring
Date: 18 Aug 2002 12:20:35
Message: <3d5fc953$1@news.povray.org>
Thankyou for all the help.

I got it working.  the final code is as follows:

#declare Test_Texture =
texture
  { average
    #local BlurSamples = 255;
    #local BlurAmount = .05;
    texture_map
    { #local Ind = 0;
      #local S = seed(9586);
      #while(Ind < BlurSamples)
        [1 pigment { color rgb <1,1,1> } // The pigment of the object here
           finish { MF } // The finish; should have reflection
           normal
           { bumps BlurAmount
             translate <rand(S),rand(S),rand(S)>*100
             scale 1000
           }
        ]
        #declare Ind = Ind+1;
      #end
    }
  }

My first attempts had used Gradent instead of boso and then only 5 hand
coded entries in the map.  Using Bozo and increasing the number of map
entries gave a satisfactory result.   I used 255 (max -1) for the sample
number because I wanted to see what it could do, but anything over 80 was
sufficient to avoid the problem of multiple ghosted images (my original
problem).  At 255 with a resolution setting of 1280X1024 it took ~28.5
minutes to render a very simple seen.  If anyone is intrested in the full
source code, or resulting image, just ask.

Once again, thanks for the help.

JFMILLER

"jfmiller" <jfm### [at] hotmailcom> wrote in message
news:3d5f057c$1@news.povray.org...
> Hi all,
>
> I have read of about using texture_map with slightly different
> normals to make a reflection appear blury.  I've tried to replicate this
but
> I can't seem to get it to work.  Can someone post some source code or a
> tutorial on how this is done?
>
> Thanks
> JFMILLER
>
>
>


Post a reply to this message

From: Tim Nikias
Subject: Re: Reflection bluring
Date: 18 Aug 2002 12:28:41
Message: <3d5fcb39@news.povray.org>
Oops, you're right! Well, I just typed the code
for the post, didn't actually check it...

Thanks.

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde
"Christopher James Huff" <chr### [at] maccom> schrieb im Newsbeitrag
news:chr### [at] netplexaussieorg...
> In article <3d5f6ae2@news.povray.org>, "Tim Nikias" <tim### [at] gmxde>
> wrote:
>
> > This should work fine. What it does it average the
> > textures, and since pigment and finish are always the same,
> > those aren't changed, but for every sample POV-Ray
> > calculates a new reflection based on the normal-map,
> > since that one changes for every sample, you get
> > a lot of different reflections, which are averaged.
>
> That will not work. Your code calculates one random vector and uses it
> for every texture sample. All the textures your code averages will be
> identical, it will just make it render slower.
>
> #macro BlurryTexture(Pig, Fin, Norm, BlurSamps, Amt)
>     texture {average
>         texture_map {
>             #local J = 0;
>             #while(J < BlurSamps)
>                 [1 pigment {Pig}
>                     finish {Fin}
>                     normal {Norm
>                         translate <rand(R), rand(R), rand(R)>*Amt
>                     }
>                 ]
>                 #local J = J + 1;
>             #end
>         }
>     }
> #end
>
> --
> Christopher James Huff <cja### [at] earthlinknet>
> http://home.earthlink.net/~cjameshuff/
> POV-Ray TAG: chr### [at] tagpovrayorg
> http://tag.povray.org/


Post a reply to this message

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