Ok, thanks guys. Can someone post what the error is? Might help a little...?
Here is a screenshot from a simple lighting system I'm starting for a future project 100 'lights' at a pretty decent framerate, although I think I can improve on the framerate still and I'll never be using that many lights in one scene! EDIT: Got the framerate up to nearly 300fps for the same scene now!
I've updated the shaders in the original project and added a sepia tone shader (not used in the project):
DOWNLOAD
My new engine using this system has a simple main file that looks like this:
#include "baxslashengine.agc"
gosub init_baxslash
RunGame()
The example shown above looks like this in my game file:
init_game:
// create sprites
bg = LoadImage("bg.png")
bgSpr = CreateSprite(bg)
SetSpriteSize(bgSpr, DeviceWidth, DeviceHeight)
SetSpritePosition(bgSpr, 0, 0)
AddSceneSprite(bgSpr)
// Add light
global lightID as integer
lightID = AddLight(lightImage.basic, 0, 0, 10, 255, 255, 200, 100, 0.8)
return
function UpdateGame()
SetLightPosition(lightID, GetPointerX(), GetPointerY(), light[lightID].z)
if GetPointerPressed()>0
lightID = AddLight(lightImage.basic, GetPointerX(), GetPointerY(), 10, 255, 255, 200, 100, 0.8)
endif
endfunction
The engine takes care of the rest. I'm looking forward to adding some clever tricks I have been desperate to come up with once I got this shader working. watch this space...