- Home /
Addition to Standard Shader stopping it from batching?
I added the following code to the start of the Standard Shader:
Pass
{
ZTest Always
ColorMask 0
ZWrite On
}
This is designed to clear the z-buffer behind this object - enabling me to have control over which objects render in which order. The problem is it gives me issues with batching. If I drop a ton of cubes into the scene with a material with the regular Standard Shader then it's a fixed number of draw calls - no matter how many cubes I have. The second I add that excerpt to the shader, that scheme breaks! Adding more cubes adds more draw calls, is something wrong or is that a necessity with this snippet of code?
Your answer
Follow this Question
Related Questions
A Cg shader semantic problem 2 Answers
Shader - What is float3.xy? 1 Answer
Surface shader changing z value 0 Answers
Shader inverts uv map only once, how to fix it? 0 Answers
How to adapt this shader into a transparent one (alpha blend) 0 Answers