- Home /
Question by
CrazyDef · Aug 26, 2013 at 06:39 AM ·
shaderbatchingvertexshader
Why is batching breaking my shader?
Hi,
I have a shader which works when batching is disabled, but doesn't when it is.
My best guess is I think the objects are being transformed into oblivion, but I can't be 100% certain.
The objects in question are generated at runtime, with dynamic meshes. If I pause the game, I can see they're generated in the world correctly, and, of course, if I disable batching everything works as expected.
In my Update function for each object, I'm just moving them in the scene, and re-orientating them to look at the camera:
void Update()
{
transform.position = Move();
transform.LookAt( Camera.main.transform );
}
As far as transformations are concerned, my vertex shader is merely doing the following:
output.pos = mul( UNITY_MATRIX_MVP, input.pos );
Does anyone have any idea what I am doing wrong?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613113001im_/https://answers.unity.com/themes/thub/images/avi.jpg)