Sprite3DBlendingMode() is the powerful function, with their different effects can be created, provided one has the right images.
With a white spot and an addition mode you can brighten the background and it looks like light.
Here a very small example, with a texture and red light:
Code: Select all
InitSprite()
InitSprite3D()
InitNetwork()
Enumeration
#Window
#Background
#Light
EndEnumeration
OpenWindow(#Window, 0, 0, 800, 600, "Screen", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(#Window), 0, 0, WindowWidth(#Window), WindowHeight(#Window), 0, 0, 0)
ReceiveHTTPFile("http://data.unionbytes.de/sand.jpg", GetTemporaryDirectory()+"sand.jpg")
UseJPEGImageDecoder()
LoadSprite(#Background, GetTemporaryDirectory()+"sand.jpg", #PB_Sprite_Texture)
CreateSprite3D(#Background, #Background)
CreateSprite(#Light, 256, 256, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(#Light))
For r = 127 To 0 Step -1
Circle(128, 128, r, RGB(255-r*2, 0,0))
Next
StopDrawing()
CreateSprite3D(#Light, #Light)
Repeat
ClearScreen(0)
Start3D()
Sprite3DBlendingMode(5,6)
DisplaySprite3D(#Background, 100, 100)
DisplaySprite3D(#Light, 400, 50, 255)
Sprite3DBlendingMode(5,2)
DisplaySprite3D(#Light, 150, 150, 128+Sin(ElapsedMilliseconds()/100)*32)
Stop3D()
FlipBuffers()
Until WindowEvent() = #PB_Event_CloseWindow