Camera-aware material updates extracted from SceneManager.
Two helpers:
updateMaterialsForCurrentCamera — push the drawing-buffer
size, near-cull margin and pixel ratio into the global
materialManager. The projection itself (FOV, ortho zoom,
ortho/perspective kind) is 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, near-cull margin and pixel ratio into the global materialManager. The projection itself (FOV, ortho zoom, ortho/perspective kind) is 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.