Shader instance uniform problem
Shader instance uniform problem
Hi, I've been playing around with Godot to learn some game development skills, but I've run into a problem. I'm trying to display some 2d "cards" on the screen, and their texture is being generated by a shader. However, each card looks exactly the same, where I'd like some variation between the cards.
So I passed a seed value into my shader using:
instance uniform float seed;
And in my GDScript code:
func _ready() -> void: color_rect.material.set_shader_parameter("seed", randf() )
I've also tried:
func _ready() -> void: color_rect.set_instance_shader_parameter("seed", randf() )
Nothing breaks, but each of my cards are still identical, as if the seed value is the same for all three cards. From what I've read, the 'instance' keyword should let me pass a unique seed value for each object using the shader, right?