Let's say I have swordy1, he's wearing blue. He's in a spritebatch.
If I attach a per vertex attribute to color his clothes from blue to orange, will swordy2 also have orange clothes (same spritebatch)?
Can I attach different attributes for the shader to use on different instances of swordy unit, based on the index returned from SpriteBatch:add?
So in a spritebatch, can I have 10 orange swordys, 20 blue swordys, 5 red swordys for example?
I'm looking at https://love2d.org/wiki/SpriteBatch:attachAttribute
Coloring sprites with a per-vertex attribute in a spritebatch
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Party member
- Posts: 234
- Joined: Mon Aug 29, 2016 8:51 am
Re: Coloring sprites with a per-vertex attribute in a spritebatch
It's a per vertex attribute, so yes, you can use different values for quads in the same batch.
-
- Party member
- Posts: 234
- Joined: Mon Aug 29, 2016 8:51 am
Re: Coloring sprites with a per-vertex attribute in a spritebatch
That's great. But I have no idea how to uses meshes or shaders. I have no idea how to code this.
Who is online
Users browsing this forum: Google [Bot] and 237 guests