b3dGetFPS

Returns current frames per second (FPS) of rendering. Takes no parameters. Returns current FPS as Int (frames rendered in last second).

3D Graphics

Parameters & Returns

Parameters

This function takes no parameters.

Returns

Int

Quick Summary

Returns current frames per second (FPS) of rendering. Takes no parameters. Returns current FPS as Int (frames rendered in last second).

Technical Exegesis...

Returns current frames per second (FPS) of rendering. Takes no parameters. Returns current FPS as Int representing frames rendered in last second (typical values 30-60 for capped frame rate, 60-300+ for uncapped high-performance, 1-30 for slow performance). Calculates FPS from DirectX 12 rendering system timing.

Example

Example.bam
; Display FPS on screen
Repeat
    fps = b3dGetFPS()
    BBR_Text(10, 10, "FPS: " + fps)

    b3dRenderWorld()
    BBR_Flip()
Until BBR_GetKey(1)

; Adaptive quality based on FPS
If b3dGetFPS() < 30 Then
    ; Reduce shadow quality
    b3dLightShadowMaxDistance(sun, 100.0)
ElseIf b3dGetFPS() > 55 Then
    ; Increase shadow quality
    b3dLightShadowMaxDistance(sun, 200.0)
EndIf

; FPS logging for profiling
If MilliSecs() Mod 1000 < 20 Then  ; Every second
    Print "FPS: " + b3dGetFPS()
EndIf