Archive 17/01/2023.

Selective alpha color in 2d sprite?

Hevedy

How set the alpha by color in a 2d sprite or tiles ?

codingmonkey
  1. open image with gimp and edit it )
  2. texture.getData() and go with “for” on each rgba color if rgb==userAlpha then a=0 then put back this data.
  3. write custom shader ( if (rgb==userAlpha) discard ) for sprites and assign it for sprite.
    (but i’m not see any methods to manage with shader/matarials or something like that for sprites)
Hevedy

[quote=“codingmonkey”]1. open image with gimp and edit it )
2. texture.getData() and go with “for” on each rgba color if rgb==userAlpha then a=0 then put back this data.
3. write custom shader ( if (rgb==userAlpha) discard ) for sprites and assign it for sprite.
(but i’m not see any methods to manage with shader/matarials or something like that for sprites)[/quote]

Then don’t have, thanks.