Dynamic Lights in .bsp map

A forum to store posts deemed exceptionally wise and useful
Post Reply
monsterguden
Posts: 8
Joined: Tue Jan 29, 2008 12:19 pm

Dynamic Lights in .bsp map

Post by monsterguden »

Hi everyone!

I just want to make a simple tutorial over how to use dynamic lights in a .bsp map instead of the pre-rendered lightmaps that is included in bsp. I know this code aint pretty, but its the only way i managed to get it working correctly!

First of all, you need to set the ambient light in the editor so you got full light all over the map or add A LOT of lights to it ;) (No shadows at all!)

When you load the map, you need to set:
(mapnode is the ISceneNode that contains the level)

Code: Select all

mapNode->setMaterialFlag(EMF_LIGHTNING, true);
mapNode->SetMaterialType(EMT_LIGHTMAP_LIGHTING);
Then your up and running, nothing difficult at all but i took me 8 hours to get this working (searching at forums, trial&error and waiting for answers on diffrent threads). I hope this will save you from all that work!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, what about the hints we gave about testing the material type and only replacing those which are really lightmaps? No you'll loose transparent parts, have lightmaps where you only had solid maps (also without the lightmap) etc.
Post Reply