- Home /
Set shader builtin matrices by script
Is it possible to set built-in matrices like UNITY_MATRIX_MVP or else? I cant use custom matrices, because i need to use surface shaders. Following code doesnt work:
commandBuffer.SetGlobalMatrix ("UNITY_MATRIX_VP", _matrix);
Comment
You can't overwrite built-in matrices. If you want to use a custom projection matrix, then you need to write a custom shader. Can you explain "I cant use custom matrices, because i need to use surface shaders."? You never need to use surface shaders - they're just templates that automate some of the lighting calculations for you.
I mean that i want use custom matrix for any shader, such as Standard or else. I just want to draw Renderer without camera, but with Graphics.ExecuteCommandBuffer.