here is a code. The code should display the issue that only one pair of shadows is working correct at the "same" time (Modulative and Additive or TexureAdditive). But in fact, I don´t see any shadow. What is the Problem with this code? I can´t see my issue...
Code: Select all
EnableExplicit
Define.i cube, light, cam, ground, cube_mesh, ground_mesh
InitEngine3D()
InitSprite()
InitKeyboard()
OpenScreen(1920, 1080, 32, "Test_0", #PB_Screen_SmartSynchronization)
cam = CreateCamera(#PB_Any, 0, 0, 100, 100)
MoveCamera(cam, 0, 20, 0, #PB_Absolute)
CameraLookAt(cam, 10, 0, 10)
;WorldShadows(#PB_Shadow_TextureAdditive, 100, RGB(255 * 0.2, 255 * 0.2, 255 * 0.2), 4096)
WorldShadows(#PB_Shadow_TextureAdditive, 100, RGB(0, 0, 0), 4096)
light = CreateLight(#PB_Any, RGB(255, 255, 255), 20, 10, 20, #PB_Light_Directional)
LightDirection(light, 0.4, -1, 0.2)
AmbientColor(RGB(85,85,85))
cube_mesh = CreateCube(#PB_Any, 2)
BuildMeshShadowVolume(cube_mesh)
cube = CreateEntity(#PB_Any, MeshID(cube_mesh), 0, 10, 1, 10)
ground_mesh = CreatePlane(#PB_Any, 20, 20, 1, 1, 1, 1)
BuildMeshShadowVolume(ground_mesh)
ground = CreateEntity(#PB_Any, MeshID(ground_mesh), 0, 10, 0, 10)
Repeat
ClearScreen(RGB(0, 0, 0))
ExamineKeyboard()
RenderWorld()
FlipBuffers()
Until KeyboardReleased(#PB_Key_Escape)
End
