POV-Ray : Newsgroups : povray.binaries.images : Don't neglect your chrome sphere! : Re: Don't neglect your chrome sphere! Server Time
24 Apr 2024 08:59:26 EDT (-0400)
  Re: Don't neglect your chrome sphere!  
From: Cousin Ricky
Date: 22 Dec 2022 22:33:42
Message: <63a52196@news.povray.org>
On 2022-12-19 11:25 (-4), Bill Pragnell wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
>> On 2022-12-18 10:52 (-4), Bill Pragnell wrote:
>>> I might have tried to make the
>>> rust texture more finely grained, and disconnected from the patch shapes.
>>
>> I'd love to do that, but I haven't yet worked out how to warp a texture
>> map without having the constituent textures warped as well.
> 
> You could declare the chrome/buckled/rust pattern up front, then apply the
> texture map at point of use. That way the warp gets applied before the map. Like
> this:
> 
> #declare RustFn = function
> { pigment
>   { bozo
>     color_map { [0 rgb 0] [1 rgb 1] }
>     turbulence 0.7
>     scale 0.2
>   }
> }
> 
> [snip]

Thanks!  Here's the updated texture:

----------[BEGIN CODE EXCERPT]---------
#include "rc3metal.inc" // https://github.com/CousinRicky/POV-RC3Metal

#declare c_Chrome = rgb <0.50, 0.51, 0.55>;
#declare c_Rust1 = rgb <0.17, 0.07, 0.06>;
#declare c_Rust2 = rgb <0.30, 0.08, 0.05>;
#declare c_Rust3 = rgb <0.60, 0.22, 0.04>;

#declare RC3M_Diffuse = [your #default diffuse value];
#declare RC3M_Ambient = [your #default ambient value];
RC3Metal_Set_highlight (0)
#declare t_Chrome = RC3Metal_Texture (c_Chrome, 1.0, 0.5)
#declare t_Buckled_chrome = texture
{ RC3Metal (c_Chrome, 0.5, 0.5)
  normal { bumps 0.3 scale 0.1 }
}
#declare t_Rust = texture
{ pigment
  { bozo color_map
  }
  normal
  { agate 0.8
    warp { turbulence 0.5 octaves 4 lambda 2.7 omega 0.9 }
    scale 0.8
  }
}
#declare t_Chrome_transition = texture
{ bozo texture_map
  { [0.43 t_Chrome]
    [0.53 t_Buckled_chrome]
  }
  warp { turbulence 0.7 }
}
#declare fn_Rust = function
{ pigment
  { bozo
    color_map { [0 rgb 0] [1 rgb 1] }
    warp { turbulence 0.7 }
  }
}
#declare t_Rusted_chrome = texture
{ function { fn_Rust (x, y, z).x }
  texture_map
  { [0.53 t_Chrome_transition]
    [0.53 t_Rust]
  }
  scale 0.2
}
-----------[END CODE EXCERPT]----------


Post a reply to this message


Attachments:
Download 'rusty_ball-2022-1080.jpg' (378 KB)

Preview of image 'rusty_ball-2022-1080.jpg'
rusty_ball-2022-1080.jpg


 

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