Camera-aware material updates extracted from SceneManager.
Two helpers:
updateMaterialsForCurrentCamera — push the drawing-buffer
size, projection kind (orthographic or not), near-cull margin
and pixel ratio into the global materialManager. The
projection terms themselves (FOV, ortho zoom) are read in
shader from the projection matrix. Called on resize, camera
swap, and FOV change.
adjustFOV — mutate camera.fov with clamping, refresh the
projection matrix, and push the new value into materials.
No-op for orthographic cameras.
Both helpers are pure with respect to SceneManager — they read
everything they need from the supplied ctx.
Camera-aware material updates extracted from SceneManager.
Two helpers:
updateMaterialsForCurrentCamera— push the drawing-buffer size, projection kind (orthographic or not), near-cull margin and pixel ratio into the global materialManager. The projection terms themselves (FOV, ortho zoom) are read in shader from the projection matrix. Called on resize, camera swap, and FOV change.adjustFOV— mutatecamera.fovwith clamping, refresh the projection matrix, and push the new value into materials. No-op for orthographic cameras.Both helpers are pure with respect to SceneManager — they read everything they need from the supplied ctx.