Lightmapping help needed
Blitz3D Forums/Blitz3D Beginners Area/Lightmapping help needed
| ||
How exactly do I apply a lightmap and diffuse map to a mesh in Blitz3d? What I am trying to do: Create a spacestation that has a textured skin, and some baked in lighting to represent the windows, and spots on the station itself. The station slowly rotates in the scene and gets lit by 2 directional scene lights as it rotates. I tried adding the 2 textures to my mesh with: tex_Metal=LoadTexture("StationSkin.jpg") tex_Light=LoadTexture("theLightMap.jpg") TextureBlend tex_light, 3; additive seems to make it fullbright and not blend with the underlying texture. ;Also tried multiply and ended up with a nearly black unlit mesh. stationPivot = CreatePivot() theStation=LoadMesh("theStation.b3d", stationPivot) EntityTexture theSTation, tex_Metal EntityTexture theSTation, tex_Light,0,7 theLight=CreateLight(2) LightColor(theLight,100,100,100) PositionEntity theLight, 100, 100, 100 PointEntity theLight, theStation theLight2=CreateLight(2) LightColor(theLight2,2,2,5) PositionEntity theLight2,-100, -50, -100 PointEntity theLight2, theStation ghostcam.CameraRig = Create_GhostCam.cameraRig(); ; custom function I have to create a ghost camera While KeyHit(1) = False move_GhostCam(ghostCam); custom function I have to fly the camera around the scene. TurnEntity stationPivot, 0.0, 0.01, 0.0 UpdateWorld RenderWorld Flip Wend End But the station either ends up looking fullbright, or dark and unlit by the 2 scene lights. Any tips on lightmapping objects? What am I missing here? Thanks, |
| ||
try this: TextureCoords tex_Light,1 EntityTexture theSTation, tex_Light,0,1 |