Home > database >  How to create a Sprite Color Mask in Unity
How to create a Sprite Color Mask in Unity

Time:09-11

I'm trying to use the Among Us Spritesheets to get crewmates in Unity. The spritesheet looks like this: Shader Graph for Among Us Color Mask

"Secondary" and "Primary" are color properties.

Hope this helps somebody!

CodePudding user response:

If you want to have multiple info stored in a single image, it's common practice to use the channels: Red, Green, Blue. Horizon Zero Dawn for example uses that technique to make the environment effects as efficient as possible.

Here it looks like blue and red are used as a polaceholder to mark an area. So in unity's shader graph, when you use this image in a SampleTexture2D node you can use a Split node to get the different channels of the image to isolate the parts you want to color in.

Then just multiply the different channels by the color you want, add them together and use that as the base color.

Edit: Or use the "Replace Color Node" I just learned about.

  • Related