Skip to content

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

License

Notifications You must be signed in to change notification settings

hengtek/unity-texture-packer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unity-texture-packer License Donate

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

screenshot

Example in 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.

License 📝

MIT. See LICENSE for details.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 90.5%
  • ShaderLab 9.5%