Problem with Fastlib shadows

Blitz3D Forums/Blitz3D Userlibs/Problem with Fastlib shadows

Vorderman(Posted 2009) [#1]
I'm using Fastlib's shadows system to add shadows to my game, but I've encountered an oddity that seemingly means I have 2 lights in the world.

In ShadowsSimple.bb or ShadowsMultiple.bb there is the following code:

	If ShadowLightDefault=0 Then
		ShadowLightDefault = CreateLight()
	EndIf


This is creating a default light.

However in my main program I am setting up shadows as follows using a light and camera that I already have in my gameworld:
FirstShadow.Shadow = CreateShadow( UI\SHADOW_QUALITY )
ShadowRange FirstShadow, 50
ShadowPower FirstShadow, 0.6
ShadowColor FirstShadow, 180, 200, 255
FirstShadowTexture = ShadowTexture(FirstShadow)
ShadowLight FirstShadow , GAMEDATA\light1
EntityTexture GAMEDATA\Terrain , FirstShadowTexture , 0, 1
EntityTexture GAMEDATA\ground , FirstShadowTexture , 0, 1
CreateShadowCaster firstshadow , GAMEDATA\vehicle1\SHADOWMESH
UpdateShadows GAMEDATA\camera1


So it appears that although I'm setting my game's light as the shadowcaster, the auto-created light still exists, meaning that my gameworld is twice as bright as it should be, which had me confused for about 2 hours looking for the bug in my code.

It also appears that another camera is created by the shadow system, meaning I have 2 cameras in the world. Whether this causes any slowdown I don't know.

Mikhail, can you explain what I should do about this extra light? To delete it I seem to need to modify much of your shadow code so everytime you update Fastlibs it will break my game again.


OJay(Posted 2009) [#2]
update your shadows~.bb includes...the createlight() calls where replaced by createpivot() in version 1.14, which should fix your problem...


Vorderman(Posted 2009) [#3]
Thanks, I'll give that a try.


Vorderman(Posted 2009) [#4]
Yeah, that works great, thanks OJay.

Tried out the new Fastlib rays post-process also -




Mike0101(Posted 2009) [#5]
Cool, one of the best fastlib effect. I'm using too.


Rroff(Posted 2009) [#6]
Looks great.