What type of lighting are you after?
You can get lovely, ultra fast multiple per pixel lights using cubic lighting.(They can be colored and all done in a single pass.)
Here's the code I used in cryo for cubic lighting...I'm switching to vivid, so feel free to use it.
Function actorsAlpha(alpha#,actorType)
For a.actor=Each actor
If a\aType=actorType
EntityAlpha a\id,alpha
If alpha=0 And a\did<>0 HideEntity a\did
If alpha>0 And a\did<>0 ShowEntity a\did
EndIf
Next
End Function
Function updateCubicLighting()
actorsAlpha(0,aSoldier)
actorsAlpha(0,aWeapon)
HideEntity lev\id
;TextureBlend lev\lightmap,1
For a.actor =Each actor
If a\cmap<>0
If a\waist<>0
renderCubeFrom(a\cmap,a\waist,Handle(a),False)
Else
renderCubeFrom(a\cmap,A\id,Handle(a),False)
EndIf
EndIf
Next
;TextureBlend lev\lightmap,5
;renderCubeFrom(lev\cmap,lev\id)
ShowEntity lev\id
actorsAlpha(1,aSoldier)
actorsAlpha(1,aWeapon)
For l.light =Each light
HideEntity l\id
Next
End Function
Function renderCubeFrom(tex,id,lid,reflection=False)
;HideEntity lev\id
HideEntity eng\cpiv
For l.light =Each light
If reflection=1
End
Else
ShowEntity l\id
PointEntity l\id,id
TurnEntity l\id,90,0,0
;PointEntity l\id,id
;TurnEntity l\id,90,0,0
td#=EntityDistance(id,l\id)
If td>4100 td=4100
ad#=td/4100.
If ad>1 ad=1
If ad<0 ad=0
ad=1.-ad
If ad>0
; x#=EntityX(id,True)
; y#=EntityY(id,True)
; z#=EntityZ(id,True)
; lx#=EntityX(l\id,True)
; ly#=EntityY(l\id,True)
; lz#=EntityZ(l\id,True)
; hit=LinePick(lx,ly,lz,x-lx,y-ly,z-lz,0.1)
; If hit=lev\id
; l\as[lid]=l\as[lid]*0.80
; If l\noFade=True l\as[lid]=0
; Else
If l\as[lid]<1 l\as[lid]=l\as[lid]+0.05
If l\noFade=True l\as[lid]=1
; EndIf
EndIf
EndIf
EntityAlpha l\id,ad*l\as[lid]
Next
ShowEntity eng\cpiv
updateCubeMap(tex,EntityX(id,True),EntityY(id,True),EntityZ(id,True),cubicRes)
End Function
Function UpdateCubeMap(tex,x#,y#,z#,size)
HideEntity eng\cam\id
Local cam=CreateCamera()
CameraRange cam,1,100000
CameraViewport cam,0,0,TextureWidth(tex),TextureHeight(tex)
PositionEntity cam,x,y,z
TurnEntity cam,0,90,0
RenderWorld
;RenderWorld
;RenderWorld
SetCubeFace tex,0
CopyRect 0,0,size,size,0,0,BackBuffer(),TextureBuffer(tex)
TurnEntity cam,0,-90,0
RenderWorld
;RenderWorld
;RenderWorld
SetCubeFace tex,1
CopyRect 0,0,size,size,0,0,BackBuffer(),TextureBuffer(tex)
TurnEntity cam,0,-90,0
RenderWorld
;RenderWorld
;RenderWorld
SetCubeFace tex,2
CopyRect 0,0,size,size,0,0,BackBuffer(),TextureBuffer(tex)
TurnEntity cam,0,-90,0
RenderWorld
;RenderWorld
;RenderWorld
SetCubeFace tex,3
CopyRect 0,0,size,size,0,0,BackBuffer(),TextureBuffer(tex)
TurnEntity cam,0,-180,0
TurnEntity cam,90,0,0
RenderWorld
;RenderWorld
;RenderWorld
SetCubeFace tex,5
CopyRect 0,0,size,size,0,0,BackBuffer(),TextureBuffer(tex)
TurnEntity cam,180,0,0
RenderWorld
;RenderWorld
;RenderWorld
SetCubeFace tex,4
CopyRect 0,0,size,size,0,0,BackBuffer(),TextureBuffer(tex)
FreeEntity cam
Return tex
ShowEntity eng\cam\id
End Function
the stuff commented out may be of use..been a while since I touched this. but it works as is.(Well it well once integrated;p)
At the light positions, they are not blitz lights, but instead a quad textured with a light. This is rendered onto the player's cubic light map, then projected on. You change the color of these quads to mimic differant light colors. Increase the size of the quad to represent light strength.
fade the light colors to represent fall off.
The actual texture..imagine you were looking directly at a light. a lens flare-ish image.
Use cubemode 2 for normal smooth lighting, cube mode 1 for shiny metalic lighting.
Tangent mapping your other option..but overall, not a realistic one for real-world use in blitz3d.