This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// world, view, projection matrices | |
var world = obj.transform.localToWorldMatrix; | |
var view = cam.worldToCameraMatrix; | |
var proj = cam.projectionMatrix; | |
// the actual projection matrix used in shaders | |
// is actually massaged a bit to work across all platforms | |
// (different Z value ranges etc.) | |
var gpuProj = GL.GetGPUProjectionMatrix (proj, false); | |
var gpuMV = view * world; // UNITY_MATRIX_MV |