Can you use Per Instance Uniforms on the Standard Material

Godot Version

Godot Engine v4.4.1.stable mono

Question

Hi,

Just wondering, is there a way to use Per Instance Uniforms on any parameters in the Standard Shader? I’d like to vary the colour of instances in my scene and that sounds like a nice efficient way of doing that. It seems like it might be limited to custom shader though?
Has anyone had any experience with that?

Here’s a little article on it from a while back.
https://godotengine.org/article/godot-40-gets-global-and-instance-shader-uniforms/

Thanks!
Pete

In this particular case you can mess with the self_modulate color of things in the scene to do that without the shaders.

1 Like

Hey thanks, that sounds right but I cant find that as a property in the Standard Material.
Oh I should mention this is for 3d objects not sprites, sorry! :confused:

Ah, in that case you can reach into the materials and set albedo_color or the like, but that’s not going to help if the models are textured. Vertex colors or lighting might do it?

To actually do it in a shader, you’d probably (?) need to do your own shaders? I have a kind of a plan for this that kind of does what palettes used to do back in the day, but I haven’t tried it yet; I’m going to need to ask my artist for some customized textures to make it work.

Yeah it seems like there’s a way to set it up if you make your own shaders and mark them as - instance uniform vec4 my_color : hint_color;
I think I’d just prefer to stick to the Standard Material at the moment though I’m not great at custom shader code.
I’ll find a work around, just thought it might be a handy thing to get my head around.