Shadow implementation problems

I am fully aware that batching would solve my problems, but I haven’t found a way to enable batching and also be able to separate the geometries from each other. For example, if I pick one geometrie I want to change the geometry color. Pretty basic, but if I would enable batching now I would lose this function. Or am I wrong?

You would just have to incorporate color into the mesh.

Instancing would have this same problem, by the way.

Both treat all of the objects as one mesh, basically.

I dont get why you cant batch…
I mean, you said you need to change the geometry or something, but what prevents you to change the geometry if they are only one mesh ??? If its because you really need to change color of an part of the mesh, I guess its possible changing the u/v map of that part into another part of your texture… I never done this thought…

Can you recommend a tutorial how to do this? I already tried to find something via google but only found some books which I would need to buy.

A mesh has many attribute buffers. Position is just one of them… as are texture coordinates. There is also a buffer for vertex color. I don’t know of any tutorials. When I ‘learned’ it, I just used existing custom mesh information and transferred them to the different vertex buffer type.

If you have small fixed set of colours you need to apply and don’t apply changes often, then you could use multiple batch nodes - one per colour. Less efficient than custom shader using per-vertex values but in some cases it could be enough while quite simple to implement.