Skip to main content
GameDev.net gamedev.net
🔒 Locked

Lightmap from heightmap

Started by IDispatch Apr 14, 2002 at 5:35 AM 3 replies 650+ views
Original Post
IDispatch
IDispatch
Hi, Can I generate a lightmap from a heightmap ... is it easy.. i thought I can use some effects from Adobe or some paiting program to generate one? Thanks in advance, IDispatch [edited by - idispatch on April 14, 2002 7:29:48 AM]
TerranFury
TerranFury
In Adobe Photoshop, load the grayscale heightmap, and the go to Filter->Render->Lighting Effects. Set the Light Type to Directional (since the sun is for our purposes infinitely distant) and increase the ambiance. Finally comes the important part: Set the texture channel to either Red, Green, or Blue (since it's grayscale they're all the same) and adjust the slider between Flat and Mountainous to taste. Finally, go to Filter->Other->HighPass and use a radius of about 9.8. The point here is to keep the high-frequency lighting information and remove the low-frequency hightmap. If your heightmap is just random noise (very high frequency) then this simply won't work.

By using this technique you essentially just use bump mapping on the terrain. If you want shadows or have to deal with high frequency terrains, then you'll have to write your own simple lightmap raytracer (not as hard as it sounds) or use a program like TerraGen to do it for you.

[edited by - TerranFury on April 14, 2002 9:55:28 AM]
IDispatch
IDispatch
thx i''ll try it now... btw wt does this "High Pass" filter do.
TerranFury
TerranFury
It''s the inverse of Gaussian Blur. Gaussian Blur removes small details, leaving only the average gradient. High Pass removes that low-frequency gradiant, leaving only the high-frequency details.
Heretik
Heretik
High pass filter may be used when you have a texture which is tiled a lot and when the repeativness (correct english ?) gives an ugly and unnatural result.

They''ve got a tutorial on gamasutra.com about it, with some example picture to illustrate
Heretik at bender77@caramail.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.