POV-Ray : Newsgroups : povray.general : re-texturing only part of an object? : Re: re-texturing only part of an object? Server Time
1 Aug 2024 14:35:55 EDT (-0400)
  Re: re-texturing only part of an object?  
From: Kenneth
Date: 16 Jan 2006 22:15:00
Message: <web.43cc606fdf8284dcdd0484f30@news.povray.org>
"gonzo" <rgo### [at] lansetcom> wrote:

>
> If the top is completely flat then a slope pattern with only a narrow range
> at the top should work.  Assuming the Ice & White textures are already
> defined...

Actually, I've found that the slope pattern does EXACTLY what I wanted! Oh,
I should have tried that first.  :-[   SO much easier than differencing
shapes, etc.

Here's my code for the two textures, one following the other:

// 1st texture, the overall ice...
texture{my_main_ice_texture  etc....}

// 2nd texture...the white fades quickly to transparent as the letters'
// surface normals approach a horizontal direction

texture{
 pigment{
  slope{<0,-1,0>}
  color_map{
    [0.0 rgb 1]
    [0.45 rgb 1]
    [0.55 rgbt 1]
    [1.0 rgbt 1]
    }
 finish{
  ambient 0
  diffuse 1
  }
 }

It's important to set ambient to 0 for this, otherwise its ambient color
will mix with the first texture's color. (Luckily, none of the letter's top
surfaces are in shadow, so ambient 0 is OK.)

The slope pattern doesn't seem to work exactly the way the docs describe it,
though; but that's a question I'll post elsewhere.

I had actually worked with the slope pattern months ago (making a sort of
topogrphic map out of a heightfield, coloring it depending on the surface
normals.)  But just didn't make the mental connection to my letter usage.
Most embarassing.

Thanks for waking up the 'ol brain cells!

Ken


Post a reply to this message

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