POV-Ray : Newsgroups : povray.newusers : Using images as diffuse maps Server Time
1 Nov 2024 09:22:31 EDT (-0400)
  Using images as diffuse maps (Message 1 to 6 of 6)  
From: ZainAnak
Subject: Using images as diffuse maps
Date: 4 Dec 2005 13:15:00
Message: <web.4393311ed86e519e4114da700@news.povray.org>
Hey all- related to my earlier question on washed out colors is one about
diffuse coloration.  Say I have an asphalt runway in an airport scene.
Here is a photograph example:

http://www.pdkairport.org/Runway%20Incursions/Runway%20Incusion%20Hazard%201%20w%20text.JPG

Well, for certain technical reasons, it's much easier for me to use image
maps for the whole runway than to model out the white painted parts, dark
asphalt parts, etc.  The problem is, when it comes time to light with
sunlight, I can't keep the darks dark and the whites white.  It's usually
one or the other.  I started playing with diffuse values, which, sure
enough, lightened and darkened, but uniformly.  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.  It may be a very easy thing to do in
Pov, it may be more difficult- I have no idea.  Your thoughts and advice
are much appreciated!

-ZA


Post a reply to this message

From: Eero Ahonen
Subject: Re: Using images as diffuse maps
Date: 4 Dec 2005 13:51:54
Message: <43933aca$1@news.povray.org>
ZainAnak wrote:
>
> Well, for certain technical reasons, it's much easier for me to use image
> maps for the whole runway than to model out the white painted parts, dark
> asphalt parts, etc.  The problem is, when it comes time to light with
> sunlight, I can't keep the darks dark and the whites white.  It's usually
>

One way to try could be modeling the dark asphalt with eg. a box, then
model the white parts with using the photo to create a heightfield,
translating or intersectioning it to raise eg 0.01 over the asphalt and
be visible of that part.

One other way (which should be preferred IMO) would be creating the
looping parts with a macro.

-- 
Eero "Aero" Ahonen
   http://www.zbxt.net
      aer### [at] removethiszbxtnetinvalid


Post a reply to this message

From: ZainAnak
Subject: Re: Using images as diffuse maps
Date: 4 Dec 2005 14:05:01
Message: <web.43933dc52b6244e84114da700@news.povray.org>
Neither are really a viable option for me- I'm using Pov to take in models
and textures made with a 3D program and do batch rendering.  I'm not hand
modeling the geometry, or doing much "custom" work per object- this is
straight model + texture here, no fancy intersections, etc.  The model and
texture need to remain as is.  So, back to my question- how do I use the
image map texture to modulate the diffuse color?

Eero Ahonen <aer### [at] removethiszbxtnetinvalid> wrote:
> ZainAnak wrote:
> >
> > Well, for certain technical reasons, it's much easier for me to use image
> > maps for the whole runway than to model out the white painted parts, dark
> > asphalt parts, etc.  The problem is, when it comes time to light with
> > sunlight, I can't keep the darks dark and the whites white.  It's usually
> >
>
> One way to try could be modeling the dark asphalt with eg. a box, then
> model the white parts with using the photo to create a heightfield,
> translating or intersectioning it to raise eg 0.01 over the asphalt and
> be visible of that part.
>
> One other way (which should be preferred IMO) would be creating the
> looping parts with a macro.
>
> --
> Eero "Aero" Ahonen
>    http://www.zbxt.net
>       aer### [at] removethiszbxtnetinvalid


Post a reply to this message

From: Ard
Subject: Re: Using images as diffuse maps
Date: 4 Dec 2005 17:45:01
Message: <web.4393707c2b6244e8ed802ab30@news.povray.org>
> Hey all- related to my earlier question on washed out colors is one about
> diffuse coloration.  Say I have an asphalt runway in an airport scene.

> Well, for certain technical reasons, it's much easier for me to use image
> maps for the whole runway than to model out the white painted parts, dark
> asphalt parts, etc.

If you were just rendering the white paint, it would be simple: threshold
the image to a bitmap so that the paint was white, everything else was
black or transparent, and use a real texture for the asphalt.  You'd need
to use a PNG image map with transparency (easy to automate with NetPBM), or
tell POV that it should treat black as transparent.

However that won't work with your tri-state (so to speak) images, since the
bulk of your asphalt is grey, and probably different grey in each of your
images.  Two image maps?  One for paint, one for dark asphalt?  Again,
NetPNM can automate that.

I was going to suggest you ensure your ambient light is zero, but you've
already asserted that in another post.  If I were you, I'd make sure that
the blacks in my images maps were rgb 0.  Even 0.05 is boosted to a low
grey when it gets a bit of light on it and gamma kicks in.

Just for a test, try setting your display_gamma to 1.0.  That will darken
everything else in your scene, but if your image maps come right then it
may indicate where the problem lies.


Post a reply to this message

From: Tom York
Subject: Re: Using images as diffuse maps
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

From: ZainAnak
Subject: Re: Using images as diffuse maps
Date: 9 Dec 2005 10:20:01
Message: <web.4399a0792b6244e8947aaf140@news.povray.org>
Now that is cool!!!   Thanks so much for that neat little trick.


Post a reply to this message

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