Skip to content

How To: Preparing Double Layer Cutout Textures

grondag edited this page Jun 15, 2019 · 7 revisions

Introduction

The Problem: You have a single, solid texture and you want to assign some part of it a different color or material property (usually emissive) in your model JSON, while leaving the rest of the texture unmodified.

Solution: A simple way to accomplish this is by splitting the texture into two separate cutout textures, so that transparent pixels in each texture are solid in the other.

This article explains how to do this task using GIMP version 2.8. If you use a different bitmap editor this article will probably still be useful to you but the details of each step will be different. If you have never used GIMP and want to try it, you should probably start here.

This article uses the Minecraft vanilla Redstone Ore texture for the illustrations below.

Step 1: Decompose Layers

Open your base texture in GIMP and decompose it into Red, Green, Blue and Alpha layers by choosing Colors/Components/Decompose... from the menu. You should have four layers that look something like this:

Step 2: Modify Alpha Mask

Modify the alpha layer to isolate the pixels you want to separate by making them black. Your alpha layer should now look something like this:

Step 3: Recompose First Texture

Recombine the layers into a new texture by choosing Colors/Components/Compose... from the menu. You should see a popup like the one pictured below. Make sure you are including the alpha layer.

Step 4: Export First Texture

Save your first texture as a PNG file by choosing File/Export As... from the menu. Important: Enable the "Save color values for translucent pixels" option as shown below to avoid bleeding or other artifacts where the two textures will meet.

Your saved texture should look something like the one below. The red bits in this example aren't visible because they are fully transparent, but the colors are still stored in the image.

Step 5: Invert Alpha Mask

In the decomposed image, invert the alpha layer by selecting it and choosing Colors/Invert from the menu. Your mask should now look like this:

Step 6: Compose and Export Second Texture

Repeat steps 3 and 4 to save the second, complimentary texture. It should look like the texture below.

Clone this wiki locally