Multiple computeshader textures in a scene

Godot Version



With Godot 4.2 i seen the new example about water simulation with a compute shader. I tried to use it in a small game I’m working on, however i do have multiple water meshes in the scene, and only the last water place in the mesh will have correct results… they seem somehow to all share the same texture.

I checked that the RIDs of all textures are all unique and different as the instances of shader and pipeline.

what i am doing wrong? perhaps is something still not supposed to actually work?

to reproduce it in a simple test case, open godot-demo-projects/compute/texture/ and drag a new water_plane.tscn in the main scene: interacting with the mouse, the 2 planes will have the same texture.

Not sure if you still need it, but maybe it is helpful for others. I searched for a solution to a similar problem with my own compute shader and it was quite simple in the end: make a duplicate of the shader material in the script with subresources=true: “self.material = self.material.duplicate(true)”.