Shader to randomly rotate euler.z?

I’m wondering, is it possible to write a vertex shader which could rotate the euler.z of a statically placed decorative model randomly? I could send the rotational value to the shader then. I am wondering because I’m trying to add some ground detail to my game such as foliage, etc. However, if I set the euler.z in the script for the object my draw calls go from ~33 to ~42. This obviously is going to add a lot of overhead. If I leave the rotation constant then adding some foliage only adds 1 draw call so it’s manageable.

EDIT: Screenshot to show the repetition I’m trying to solve:

Try using the position as a sample for random rotation inside of the vp?

To be honest, I don’t see why a position chsnge wouldn’t break batching but a rotation change would since they’re both just part of the transform. Sounds like a bug to me

2 Likes