Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Change vertexData to all object using a shader
Started by damiano.massarelli Oct 28 2017 10:12 AM

2 replies to this topic
shader vertexdata
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

damiano.massarelli

[GLOBAL: userInfoPane.html]
damiano.massarelli
  • Observer

  • 5 posts
  • Corona SDK

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



[TOPIC: post.html]
#2

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 848 posts
  • Corona SDK

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.



[TOPIC: post.html]
#3

damiano.massarelli

[GLOBAL: userInfoPane.html]
damiano.massarelli
  • Observer

  • 5 posts
  • Corona SDK

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




[topic_controls]
[/topic_controls]