POV-Ray : Newsgroups : povray.off-topic : Question about OpenGL and lightmaps : Re: Question about OpenGL and lightmaps Server Time
29 Jul 2024 20:27:01 EDT (-0400)
  Re: Question about OpenGL and lightmaps  
From: Slime
Date: 19 May 2011 23:02:24
Message: <4dd5d9c0@news.povray.org>
>    Light mapping is a common efficient method for lighting static 
scenes, especially in older 3D games. I had always assumed that light 
maps could both make the underlying texture darker *and* brighter (from 
complete black to completely overexposed white where the lighting is the 
strongest, and then of course an unmodified texture in between the two 
extremes).


If you write your own shader, you can simply take the light map texture, 
multiply it by the texture, and multiply the result by 2 or whatever 
constant you want, thus essentially scaling the brightness to any range. 
(You'll start to run into precision issues with high values if you're 
not using HDR textures, of course.)

You seem to know of a way to render two textures at once, multiplying 
them together. I wasn't aware of that feature, so I'm not sure if I'm 
just misunderstanding. If you do have a way to do that, you can simply 
use vertex colors of rgb(2,2,2), and make sure you have vertex color 
clamping turned off (with glClampColorARB I think). Even if you can't 
render the light map and the texture at the same time, this trick might 
still be useful for a different solution.

  - Slime


Post a reply to this message

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