/unity-texture-packer

:hammer: Utility to combine color channels from different textures into a single output.

Primary LanguageC#MIT LicenseMIT

unity-texture-packer License Donate

Utility to merge different texture channels into a final texture output.

screenshot

Usage

From Code:

TextureInput texInput00 = new TextureInput();
TextureInput texInput01 = new TextureInput();

texInput00.texture = Resources.Load<Texture2D>("input00");
texInput01.texture = Resources.Load<Texture2D>("input01");

var texChanInRed = new TextureChannelInput(TextureChannel.ChannelRed, true);
var texChanInBlue = new TextureChannelInput(TextureChannel.ChannelBlue, true);

// Input Red into Output Red
texInput00.SetChannelInput(TextureChannel.ChannelRed, texChanInRed);
// Input Green into Output Blue
texInput00.SetChannelInput(TextureChannel.ChannelGreen, texChanInBlue);

// Input Green into Output Green
var texChanInGreen =  new TextureChannelInput(TextureChannel.ChannelGreen, true);
texInput01.SetChannelInput(TextureChannel.ChannelGreen, texChanInGreen);

TexturePacker texPacker = new TexturePacker();

texPacker.Add(texInput00);
texPacker.Add(texInput01);

Texture2D texMerged = texPacker.Create();

Note

This is still under development and may be buggy.