Lightmaps, bumpmaps and oojimeflops

Blitz3D Forums/Blitz3D Beginners Area/Lightmaps, bumpmaps and oojimeflops

Just say I create a terrain, or a mesh.

Then I texture that mesh.

How do I lightmap it. What is a lightmap (I assume the following:

it's an additional texture, that enhances/diminishes the colour of the material texture slightly to give the effect of lighting.)

And what's bumpmapping? I assume this is adding an effect to the texture to give it the impression of contours and embossing to emphasize the detail

How do I lightmap it. What is a lightmap (I assume the following:

it's an additional texture, that enhances/diminishes the colour of the material texture slightly to give the effect of lighting.)



Right, that's what it is. It's a texture on another texture layer, above the base texture which is usually applied with Mod 2x blending ( because mod 2x blending allows you to both brighten and darken the base texture. colors above 128,128,128 lighten and colors below darken. ) You generally apply EntityFX flag 1 ( full bright ) which will disable realtime lighting on the object. ( You're already lit it, so you don't want the effect ruined by having it affected by realtime lights as well. )

The short answer to how you do it is to buy Gile[s] which generates fantastic lightmaps and applies them for you. There are other lightmappers, and if you're looking for a free way of creating lightmaps, perhaps JFK's Slim Shady would suit you.

http://www.blitzbasic.com/toolbox/toolbox.php?cat=4

And what's bumpmapping? I assume this is adding an effect to the texture to give it the impression of contours and embossing to emphasize the detail


Basically, yeah. A traditional bump map ( which Blitz cannot use ) is highest at a pixel which is 255,255,255 and lowest on a pixel which is 0,0,0. Blitz has no support for these. All it does have support for is for dot 3 normal maps, but without shaders, these have a big drawback. Essentially you have to color your faces to reflect the angle between the light and the surface so that the bumps will be accurate. On a static entity, you can do this will entity colors and vertex colors ( but I guess it gets kinda slow doing it with vertex colors on lots of geometry ) and you can't really do it on animated objects because Blitz doesn't keep track of animated entities.

Thanks, Syb - nearly lost me when you mentioned shaders and things, but I think I've got it.

Just curious on the Lightmapping, though. Surely if you had a lightmapped mesh representing a castle, and within the castle you placed sprites to appear that torches were burning at the correct places to match the ligtmap you used. Now, the player character carries a lantern of his own. This would need to light the mesh as he runs past, so Fullbright would stop this wouldnt it?

Yes, indeed fullbright would stop that. But it's better that way. The best way to simulate local dynamic lights like torches are via decals ( sprites aligned to and overlaid onto a wall ) to brighten them. Halo was working on something like this so you'll probably find some interesting discussion ( and a fair amount of bickering ;) ) in one of those threads.

Don't worry too much about shaders. They just allow you to adjust vertex ( and pixel ) colors much faster than you can otherwise.

Thanks loads - really helps!

Il get my asbestos suit and check halo's threads too!