Page 1 of 1

Camera range

Posted: Fri Dec 17, 2021 2:28 pm
by Ampli
Hello again!
When I use modulative shadows then camerarange() is ignored. Is there something I can do, or do I have missed something?
I dont want to choose between shadows and camera range.

/Mikael

Re: Camera range

Posted: Fri Dec 17, 2021 7:48 pm
by Ampli
Issue example:

Code: Select all

InitEngine3D()
InitSprite()
InitKeyboard()

winID = OpenWindow(#PB_Any, 0, 0, 1024, 768, "Test")
OpenWindowedScreen(WindowID(winID), 0, 0, 1024, 768)
WorldShadows(#PB_Shadow_Modulative, -1, #Gray)

CreateCube(1, 0.5)
CreateEntity(1,MeshID(1), #PB_Material_None)

CreatePlane(0,50,50,50,50,50,50)
CreateEntity(0,MeshID(0),#PB_Material_None)

For i = 0 To 70
	CopyEntity(1, 2 + i)
	MoveEntity(2 + i, 0, 0, -i + 2, 1)
Next

CreateCamera(1, 0, 0, 100, 100)
MoveCamera(1, 0, 2, -3)
CameraRange(1, 0, 10) ; <-- kaputt when using #PB_Shadow_Modulative =(

CreateLight(1, #White)
MoveLight(1, 5, 10, -10)
LightAttenuation(1, 200, 0.99)

Repeat
	ExamineKeyboard()
	RenderWorld()
	Delay(1)
Until KeyboardPushed(#PB_Key_Escape) Or WindowEvent() = #PB_Event_CloseWindow
/Mikael

Re: Camera range

Posted: Sat Dec 18, 2021 2:01 pm
by MrBean
the same for me CameraRange does not work with shadow
this is reported here:
https://www.purebasic.fr/english/viewtopic.php?t=59876

Re: Camera range

Posted: Tue Dec 21, 2021 10:11 am
by MrBean
the above example should have FlipBuffers() after RenderWorld()
else nothing will display if we choose opengl as a subsystem
what works is:
#PB_Shadow_TextureAdditive and #PB_Shadow_TextureModulative

Re: Camera range

Posted: Wed Dec 22, 2021 2:45 pm
by Ampli
I don't get it to work so I check how far entitys are from the player instead. Not the best but it will work for me.

Thanks