POV-Ray : Newsgroups : povray.binaries.images : glossy metallic reflection Server Time
5 Nov 2024 10:19:58 EST (-0500)
  glossy metallic reflection (Message 1 to 10 of 16)  
Goto Latest 10 Messages Next 6 Messages >>>
From: nemesis
Subject: glossy metallic reflection
Date: 6 Nov 2006 11:50:01
Message: <web.454f674dce679533976a8750@news.povray.org>
hi, guys.  I hope to contribute a bit more to the discussion of getting good
glossy reflective metal textures in povray.

I've made several tests, starting from a basic shiny metal texture and also
using Warp's FAQ method and Jaime Vives Piqueres' micronormals and finally
a little discovery i made by simply changing the used normal pattern:  wood
rather than the usual bumps, crackle, facets or granite one would usually
think about.  This came from the observation that "brushed" metal bears
several scratches throughout its surface.  I tried to emulate that with a


My solution is slightly faster than Jaime's because of less normal_map
entries, i guess.

Here are the textures, from fastest to slowest to render:

#declare f_reflective_metal = finish {
 ambient .2 diffuse .2
 specular 1.5 roughness .02 brilliance 2
 reflection { .6 metallic 1 } metallic
}
#declare f_metal_shiny = f_reflective_metal

// basic shiny metal
#declare t_shiny_metal =
texture {
 pigment { rgb .8 }
 finish { f_metal_shiny }
}

/* straight from warp's method from the povray FAQ */
#local BlurAmount = .2; // Amount of blurring
#local BlurSamples = 10*4; // How many rays to shoot

#declare t_metal_glossy_warp =
  texture
  { average texture_map
    { #local Ind = 0;
      #local S = seed(0);
      #while(Ind < BlurSamples)
        [1 // The pigment of the object:
           pigment { rgb .7 }
           // The surface finish:
           finish { f_metal_shiny }
           // This is the actual trick:
           normal
           { bumps BlurAmount
             translate <rand(S),rand(S),rand(S)>*10 //200
             scale 1000
           }
        ]
        #declare Ind = Ind+1;
      #end
    }
  }

#declare t_metal_glossy_warp_lesser =
  texture
  { average texture_map
    { #local Ind = 0;
      #local S = seed(0);
      #while(Ind < BlurSamples)
        [1 // The pigment of the object:
           pigment { rgb .7 }
           // The surface finish:
           finish { f_metal_shiny }
           // This is the actual trick:
           normal
           { bumps BlurAmount
             translate <rand(S),rand(S),rand(S)>*10/200
             scale 1000
           }
        ]
        #declare Ind = Ind+1;
      #end
    }
  }

// *************************
// *** Jaime Vives Piqueres' micronormals ***
// *************************
// + microsurface normal
#local p_jvp_micro2=
pigment{
 crackle turbulence 1
 color_map{
  [0.00 rgb .7]
  [0.01 rgb .7]
  [0.02 rgb 1]
  [1.00 rgb 1]
 }
 scale 5
}
#local p_jvp_micro1=
pigment{
 cells
 turbulence .5
 color_map{
  [0.0 rgb .9]
  [1.0 rgb 1]
 }
 scale .01
}
// + average all the normals
#local p_jvp_brushed_new=
pigment{
 average turbulence 0
 pigment_map{
  [0.0 p_jvp_micro1]
  [0.1 p_jvp_micro1 rotate 45*x]
  [0.2 p_jvp_micro1 rotate -45*x]
  [0.3 p_jvp_micro2]
  [0.4 p_jvp_micro1 rotate 45*y]
  [0.5 p_jvp_micro1 rotate -45*y]
  [0.6 p_jvp_micro1 rotate 90*z]
  [0.7 p_jvp_micro2 rotate 45]
  [0.8 p_jvp_micro1 rotate 45*z]
  [0.9 p_jvp_micro1 rotate 90*y]
  [1.0 p_jvp_micro1 rotate -45*z]
 }
 scale .1
}

#declare n_jvp_micronormals = normal { pigment_pattern{p_jvp_brushed_new} .4
}
#declare t_jvp_micronormal_glossy_metal = texture {
 pigment { rgb .7 }
 normal { n_jvp_micronormals scale .5 }
 finish { f_reflective_metal }
}
#declare t_metal_glossy_jvp = t_jvp_micronormal_glossy_metal


/**
 * a mix of warp's method and Jaime Vives Piqueres micronormals.
 * But with a completely unrelated and surprising pattern...
**/
#macro m_metal_glossy( BlurAmount, BlurSamples )
texture { average
 texture_map {
  #local Ind = 0;
  #local S = seed(0);
  #while(Ind < BlurSamples)
   [1 // The pigment of the object:
      pigment { rgb .78 }
      // The surface finish:
      finish { f_reflective_metal }
      // This is the actual trick:
      normal { wood ramp_wave
    rotate rand(S)*30 turbulence .6
    bump_size -BlurAmount
        translate <rand(S),rand(S),rand(S)>*.02
        scale .002
        //scale 1000
      }
   ]
   #declare Ind = Ind+1;
  #end
 }
}
#end

#declare t_glossy_brushed_metal = m_metal_glossy( .2, 1*4 )
#declare t_metal_brushed_glossy = t_glossy_brushed_metal
#declare t_metal_glossy = t_glossy_brushed_metal
#declare t_metal_glossy_weak = m_metal_glossy( .1, 1*4 )


// test scene

camera { location -5*z look_at y+2*x rotate <20,0,0> angle 40 }

light_source { 4-8*z 1.3 }
light_source { 4-6*x 1.3 }

plane { y, 0 pigment { checker rgb 1 rgb 0 } finish { ambient .3 diffuse .4
} }

sphere { y-7*z, 1 rotate -y*40
 pigment { rgb y }
 finish { ambient 0 diffuse .6 phong .7 brilliance .5 }
}

#local n0 = normal { facets coords .04 bump_size .9 turbulence .0 scale
9*(z+x) scale .04 }

box { -.5,.5 rotate y*20 translate .5*y+1.3*x scale 2 rotate -y*20
        //texture { t_shiny_metal }
        //texture { t_metal_glossy_warp }
        //texture { t_metal_glossy_warp_lesser }
        //texture { t_metal_glossy }
        texture { t_metal_glossy_weak }
        //texture { t_metal_glossy_jvp scale .04 }
}


Shown are the test scenes renders.  Getting as reference the basic shiny
metal with no distortions, it can be seen that Warp's method (using huge
normals) distorts too much the reflected environment.  I made a few changes
to values in order to prevent too much of it.  OTOH, Warp's method is the
fastest and the only one that looks ok without antialiasing.  Jaime's in
particular, seem to need quite a lot.  I suggest +AM2 +A0.08 +J1.0 on the
command-line.  Mine and Jaime's get this.
Jaime's seem to need yet more AA or a smaller scale, i don't know... his
reference picture looks a lot better:
http://www.ignorancia.org/uploads/experiments/micronormals/micro.jpg

Although not seen here, spherical surfaces get somewhat weird at the
equatorial area near the borders of the shape with Warp's or Jaime's, but
do just fine with the wood pattern.


Post a reply to this message


Attachments:
Download 'basic_shiny.jpg' (60 KB)

Preview of image 'basic_shiny.jpg'
basic_shiny.jpg


 

From: nemesis
Subject: Re: glossy metallic reflection
Date: 6 Nov 2006 11:55:00
Message: <web.454f6801b8175aee3976a8750@news.povray.org>
well, what a shame.  the web interface to the news just let attach one image
at a time.  oh well...


Post a reply to this message


Attachments:
Download 'glossy_metal_warp.jpg' (48 KB)

Preview of image 'glossy_metal_warp.jpg'
glossy_metal_warp.jpg


 

From: nemesis
Subject: Re: glossy metallic reflection
Date: 6 Nov 2006 11:55:00
Message: <web.454f6841b8175aee3976a8750@news.povray.org>
this is warp's slightly modified:


Post a reply to this message


Attachments:
Download 'glossy_metal_warp_changed.jpg' (47 KB)

Preview of image 'glossy_metal_warp_changed.jpg'
glossy_metal_warp_changed.jpg


 

From: nemesis
Subject: Re: glossy metallic reflection
Date: 6 Nov 2006 12:00:00
Message: <web.454f6901b8175aee3976a8750@news.povray.org>
this is Jaime's rendered at the same supersampling antialias setting and
resolution as later images.  It certainly feels the need of a stronger
setting...


Post a reply to this message


Attachments:
Download 'glossy_jaime.jpg' (52 KB)

Preview of image 'glossy_jaime.jpg'
glossy_jaime.jpg


 

From: nemesis
Subject: Re: glossy metallic reflection
Date: 6 Nov 2006 12:00:00
Message: <web.454f693cb8175aee3976a8750@news.povray.org>
this is mine, the weaker version:


Post a reply to this message


Attachments:
Download 'glossy_wood_weak.jpg' (41 KB)

Preview of image 'glossy_wood_weak.jpg'
glossy_wood_weak.jpg


 

From: Smws
Subject: Re: glossy metallic reflection
Date: 6 Nov 2006 19:30:01
Message: <web.454fd35fb8175aeeda53d9e40@news.povray.org>
"nemesis" <nam### [at] gmailcom> wrote:
> this is mine, the weaker version:

Aha! Really nice, and just in time for me, I was wrestling with this very
problem.  I have the most trouble when the blurred surface is concave (as
on my spoon) and it reflects itself... or I think that's slowing it down.

I will be trying these for sure.

-Stefan


Post a reply to this message

From: jute
Subject: Re: glossy metallic reflection
Date: 7 Nov 2006 03:30:00
Message: <web.455043f9b8175aeef43b014e0@news.povray.org>
"nemesis" <nam### [at] gmailcom> wrote:
> hi, guys.  I hope to contribute a bit more to the discussion of getting good
> glossy reflective metal textures in povray.
>

Marvellous work!   Thank you very much for sharing.

--
jute


Post a reply to this message

From: nemesis
Subject: Re: glossy metallic reflection
Date: 7 Nov 2006 05:05:00
Message: <web.455059e0b8175aeef2ff13290@news.povray.org>
"jute" <nomail@nomail> wrote:
> Marvellous work!   Thank you very much for sharing.

thanks!  It was just a quick hack around Warp and Jaime methods.  Using the
wood pattern surprised me so much that i had to share... probably, patterns
like marble or gradient and a bit of turbulence may produce similar
results...


Post a reply to this message

From: Thomas de Groot
Subject: Re: glossy metallic reflection
Date: 7 Nov 2006 07:46:54
Message: <4550803e$1@news.povray.org>
Nice work, nemesis! Very useful.

Thomas


Post a reply to this message

From: nemesis
Subject: Re: glossy metallic reflection
Date: 7 Nov 2006 08:55:01
Message: <web.45508fa3b8175aeef2ff13290@news.povray.org>
I think previously i did not do Warp's method justice:  it does produce nice
blurred reflections without the graininess that accompanies micronormals.
So here's a better render of it with the given supersampling setting and
doubling BlurSamples and lowering BlurAmount to .04

in the end, i guess it depends on the type of reflective metal you're trying
to achieve...


Post a reply to this message


Attachments:
Download 'glossy_warp_better.jpg' (37 KB)

Preview of image 'glossy_warp_better.jpg'
glossy_warp_better.jpg


 

Goto Latest 10 Messages Next 6 Messages >>>

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