I'm thinking that I might have to do something extra with the texture, but that's just a guess.
Code: Select all
;*******************Press Escape To Exit**********************
#CameraSpeed=1
If InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()
OpenWindow(0, 0, 0, 1000, 800, "Texture Additive Test", #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 1000, 800, 0, 0, 0)
Define.d KeyX, KeyY, MouseX, MouseY
CreateTexture(0, 32, 32)
StartDrawing(TextureOutput(0))
Box(0, 0, 32, 32 ,RGB(150,150,150))
StopDrawing()
CreateMaterial(0, TextureID(0))
CreateCube(0,50)
CreatePlane(1, 1000, 1000, 10, 10, 10, 10)
CreateEntity(0, MeshID(0), MaterialID(0),0,0,0)
CreateEntity(1,MeshID(1),MaterialID(0), 0, -100, 0)
CreateLight(0, RGB(0, 55, 155), 200, 400 , 1000)
CreateCamera(0, 0, 0, 100, 100)
;CameraLocate(0, 0, 0, 400)
MoveCamera(0,0,0,400,#PB_Absolute)
WorldShadows(#PB_Shadow_TextureAdditive , 0, 0, 512)
;WorldShadows(#PB_Shadow_Additive , 0, 0)
Repeat
If ExamineMouse()
MouseX = -MouseDeltaX() * #CameraSpeed * 0.05
MouseY = -MouseDeltaY() * #CameraSpeed * 0.05
EndIf
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
KeyX = -#CameraSpeed
ElseIf KeyboardPushed(#PB_Key_Right)
KeyX = #CameraSpeed
Else
KeyX = 0
EndIf
If KeyboardPushed(#PB_Key_Up)
KeyY = -#CameraSpeed
ElseIf KeyboardPushed(#PB_Key_Down)
KeyY = #CameraSpeed
Else
KeyY = 0
EndIf
EndIf
RotateEntity(0, MouseY, MouseX, 0, #PB_Relative)
MoveCamera (0, KeyX, 0, KeyY)
RenderWorld()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
Else
MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
End

