Hi guys:
I’m maintaining a vertex shader encapsulated in a custom material class (inherited from ShaderMaterial but now from MeshStandardMaterial).
At some point into the shader I need the inverse of projectionMatrix which is already computed in camera.projectionMatrixInverse but camera is not accessible from a material class, nor onBeforeCompile callback.
So is there a way to pass the already-computed “projectionMatrixInverse” to the shader so that no GLSL “inverse()” function need to be used?
(I would not like overload the vertex shader with stuff that can be computed outside and passed as uniform)
SO: javascript - How to convert coordinate from NDC to camera space in vertex shader? - Stack Overflow
Thanks