POV-Ray : Newsgroups : povray.newusers : Using images as diffuse maps : Re: Using images as diffuse maps Server Time
29 Jul 2024 12:24:02 EDT (-0400)
  Re: Using images as diffuse maps  
From: Tom York
Date: 6 Dec 2005 05:20:01
Message: <web.439565182b6244e87ddd02610@news.povray.org>
"ZainAnak" <nomail@nomail> wrote:

> I realized pretty quickly that if I could feed in my image map into Pov's
> diffuse calculations, nearly every pixel in my scene would get appropriate
> diffusion, courtesy of the texture I've already designed.

So you would like to have the diffuse property of the finish {} block
modulated by your texture? There is no distinct "finish_map" feature, as I
learned a while ago in a similar situation. However, as I was told, you can
still get the effect you want with a texture map. I was first shown this
technique in the context of specular mapping, which I find can make a big
contribution to realism in many cases. You can modulate multiple finish
properties at once in this way.

For mapping the diffuse values, you would use something like:

#declare RunwayPigment = pigment {
  image_map {
    png "runway.png" ....
  }
}

#declare DarkRunwaySurface = texture {
  pigment { RunwayPigment }

  finish {
    diffuse 0.1
    ....
  }
}

#declare LightRunwaySurface = texture {
  pigment { RunwayPigment }

  finish {
    diffuse 0.7
    ....
  }
}

#declare RunwayFinalTexture = texture {
  pigment_pattern { RunwayPigment }
  texture_map {
    [0.0 DarkRunwaySurface ]
    [1.0 LightRunwaySurface ]
  }
}

The "diffuse 0.1" and "diffuse 0.7" were picked arbitrarily as the minimum
and maximum diffuse illumination values for the texture; adjust them to
your needs. Intensities in your image map lying between the minimum and the
maximum will produce interpolated mixtures of DarkRunwaySurface and
LightRunwaySurface, so you do not need to specify a distinct texture for
every shade in your image map.


Post a reply to this message

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