Hey guys!
I can't seem to find any command for the built in Ogre3D in the PB manual nor in the forum regarding triangle count in the rendered scene. I would like to get the number of triangles rendered by the active camera. Is there any way to do that?
Thanks!
Scene/World statistics -> triangle count...
Re: Scene/World statistics -> triangle count...
krix, in Pb5.50++ there is Engine3DStatus(#PB_Engine3D_NbRenderedTriangles )
look the Docs for Engine3DStatus
here the cube rendered triangles is displayed in the WindowTitle, so run the program as windowed
look the Docs for Engine3DStatus
here the cube rendered triangles is displayed in the WindowTitle, so run the program as windowed
Code: Select all
#CameraSpeed = 5
IncludeFile #PB_Compiler_Home + "examples/3d/Screen3DRequester.pb"
Define.f KeyX, KeyY, MouseX, MouseY
If InitEngine3D()
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem)
InitSprite()
InitKeyboard()
InitMouse()
If Screen3DRequester()
CreateMaterial(0, LoadTexture(0, "White.jpg"))
SetMaterialColor(0, #PB_Material_AmbientColor, #PB_Material_AmbientColors)
MaterialShadingMode(0, #PB_Material_Wireframe)
MaterialCullingMode(0, #PB_Material_NoCulling)
CreateCube(0, 1)
CreateEntity(0, MeshID(0), MaterialID(0))
ScaleEntity(0, 400, 200, 400)
CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 0, 0, 1000, #PB_Absolute)
CreateLight(0, RGB(255,255,255), 300, 600, -100)
AmbientColor(RGB(255, 255, 255))
Repeat
Screen3DEvents()
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, 0.5, 0.5, 0.5, #PB_Relative)
RotateCamera(0, MouseY, MouseX, 0, #PB_Relative)
MoveCamera (0, KeyX, 0, KeyY)
RenderWorld()
Screen3DStats()
FlipBuffers()
SetWindowTitle(0, "FPS = "+Str(Engine3DStatus(#PB_Engine3D_CurrentFPS ))+" rendered triangles = "+Str(Engine3DStatus(#PB_Engine3D_NbRenderedTriangles )))
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
EndIf
Else
MessageRequester("Error", "The 3D Engine can't be initialized", 0)
EndIf
End
Re: Scene/World statistics -> triangle count...
I don't know how I missed that. Thanks applePi!