Change vertexData to all object using a shader

Hi there,

I’m developing a custom shader and everything works fine. However, I have multiple objects using that shader and I would like to change vertexData parameters to all of them whithout looping though all my object since it could be quite resource demanding. Is there a way to do that?

Thanks

Hi.

What is the nature of the shader and / or data? Are the vertex data constant, or at least in sync for all such objects on any given frame? (Those are the only situations where I see this making sense.) Are you actually running up against performance problems?

At the moment we don’t have the ability to reserve a block of uniforms associated with a shader. If you can spare a texture–i.e. your effect is either a generator or filter, not a composite–you might be able to encode your data in the pixels, and it would be common to all objects using the effect, though that’s a bit more work to maintain.

Thank you for your quick response!

Yes the data is in sync for all my objects, basically it is a position on the screen. Since it is updated quite often I don’t want to store it in another texture as I’m afraid it would require too much extra work (what do you think?). For now I will stick with my loop based solution and I’ll consider other solutions in case I have performance drops.

Thanks again

Hi.

What is the nature of the shader and / or data? Are the vertex data constant, or at least in sync for all such objects on any given frame? (Those are the only situations where I see this making sense.) Are you actually running up against performance problems?

At the moment we don’t have the ability to reserve a block of uniforms associated with a shader. If you can spare a texture–i.e. your effect is either a generator or filter, not a composite–you might be able to encode your data in the pixels, and it would be common to all objects using the effect, though that’s a bit more work to maintain.

Thank you for your quick response!

Yes the data is in sync for all my objects, basically it is a position on the screen. Since it is updated quite often I don’t want to store it in another texture as I’m afraid it would require too much extra work (what do you think?). For now I will stick with my loop based solution and I’ll consider other solutions in case I have performance drops.

Thanks again