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.
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.
FPS calculation: measures time between frames (deltaTime = currentTime - previousTime), calculates FPS = 1000 / deltaTime (milliseconds to frames per second), typically averaged over last second (smooths out frame-to-frame variance, provides stable readable value). FPS indicators: 60 FPS = smooth gameplay (16.67ms per frame, typical target for games), 30 FPS = acceptable (33.33ms per frame, minimum for playable), < 20 FPS = poor performance (frame drops noticeable, gameplay affected).
Use cases: (1) Performance monitoring (display FPS on screen for debugging), (2) Performance profiling (log FPS to identify slow areas), (3) Adaptive quality (reduce graphics settings if FPS drops below threshold), (4) Benchmarking (measure performance across different hardware). Common patterns: display FPS (fps = b3dGetFPS, BBR_Text 10, 10, "FPS: " + fps), adaptive quality (if b3dGetFPS < 30 then reduceShadowQuality), logging (Print "FPS: " + b3dGetFPS).
FPS vs frame time: FPS = frames per second (higher is better, non-linear scale, 60 to 120 FPS less noticeable than 30 to 60), frame time = milliseconds per frame (lower is better, linear scale, 16.67ms = 60 FPS, 8.33ms = 120 FPS, 33.33ms = 30 FPS), frame time more useful for profiling (consistent scale, easier to measure improvements). VSync impact: VSync caps FPS to monitor refresh rate (typically 60 Hz = 60 FPS max, prevents screen tearing, stable FPS), VSync off allows unlimited FPS (100-300+ FPS possible, may cause tearing, useful for testing max performance).
Performance targets: 60 FPS standard (smooth gameplay, 16.67ms budget per frame), 30 FPS minimum (acceptable for slower-paced games, 33.33ms budget), 120+ FPS high-end (competitive gaming, VR, requires 8.33ms or less). Frame rate limits: b3dSetMaxFPS limits maximum FPS (caps frame rate to reduce power usage, stabilize frame timing), b3dGetMaxFPS reads current limit.
Related: b3dSetMaxFPS sets maximum FPS cap, b3dGetMaxFPS reads current FPS cap, b3dRenderWorld renders frame (called once per frame, FPS measures how many times per second this completes).
Example
Example.bam
; Display FPS on screenRepeat
fps = b3dGetFPS()
BBR_Text(10, 10, "FPS: " + fps)
b3dRenderWorld()
BBR_Flip()
Until BBR_GetKey(1)
; Adaptive quality based on FPSIf b3dGetFPS() < 30Then ; Reduce shadow quality
b3dLightShadowMaxDistance(sun, 100.0)
ElseIf b3dGetFPS() > 55Then ; Increase shadow quality
b3dLightShadowMaxDistance(sun, 200.0)
EndIf; FPS logging for profilingIf MilliSecs() Mod 1000 < 20Then ; Every second
Print "FPS: " + b3dGetFPS()
EndIf