[Ok] Additive Shadows distorted with OpenGL
Posted: Sun May 05, 2013 3:03 am
Run the following code (you will need cube50.mesh file):
Using OpenGL subsystem additive shadows are distorted if compared to DirectX counterpart (see screen print).

Please feel free to move this to bug forum once and if confirmed.
Running on the latest official nVidia drivers here.
Code: Select all
CompilerIf Subsystem("OpenGL")
Debug "Compiling with the OpenGL subsystem"
If InitEngine3D(#PB_Engine3D_DebugOutput)
Add3DArchive(".\",#PB_3DArchive_FileSystem)
InitSprite()
InitKeyboard()
InitMouse()
AntialiasingMode(#PB_AntialiasingMode_x2)
If OpenWindow(0, 0, 0, 800, 600, "PureBasic (OpenGL vs DirectX)", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0)
AmbientColor(RGB(32, 32, 32))
WorldShadows(#PB_Shadow_Additive,100,0,2048)
CreateCamera(0, 0, 0, 100, 100)
CreateCube(0,10)
CreateEntity(0,MeshID(0),0)
CreateLight(1,RGB(255,0,0),0,0,0)
CreateSphere(1,5)
CreateEntity(1,MeshID(1),0,0,0,0)
AttachEntityObject(1,"",LightID(1))
EntityRenderMode(1,0)
LoadMesh(2,"cube50.mesh")
TransformMesh(2,0,0,0,1.0,1.0,1.0,0,0,0)
NormalizeMesh(2)
CreateEntity(2,MeshID(2),0,0,0,0)
EntityRenderMode(2,0)
CreateLight(2,RGB(0,255,0),0,0,0)
CreateSphere(3,5)
CreateEntity(3,MeshID(3),0,0,0,0)
AttachEntityObject(3,"",LightID(2))
EntityRenderMode(3,0)
MoveCamera(0,0,0,90)
Repeat
ExamineKeyboard()
ExamineMouse()
MoveEntity(1, (10.0 * Cos(ElapsedMilliseconds() / 300)), 15, (10.0 * Sin(ElapsedMilliseconds() / 300)), #PB_Absolute)
MoveEntity(3, (10.0 * Cos(ElapsedMilliseconds() /1000)), -15, (10.0 * Sin(ElapsedMilliseconds() /1000)), #PB_Absolute)
RotateEntity(0,1.0,0,1.0,#PB_Relative)
;RotateEntity(2,1.0,0,1.0,#PB_Relative)
RenderWorld()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or WindowEvent() = #PB_Event_CloseWindow
EndIf
EndIf
CompilerElse
CompilerError "Please compile with the OpenGL subsystem"
CompilerEndIf
End

Please feel free to move this to bug forum once and if confirmed.
Running on the latest official nVidia drivers here.

