Matlab function to create stacked texture maps for Unity
I’ve been experimenting with different materials and shaders in Unity recently. One problem is that especially if you want use the same texture for the same large object you get these nasty tiling effects:
Luckily, I found this obscure shader on Unity’s GitHub page, which is amazing but it asked for something called a map texture, which took me ages to figure out.
Essentially what you need to do is to use grayscale images of your metallic, ambient occlusion, detail mask and smoothness map and plug them into one RGBA image (more information), which is illustrated below:
I’ve spent hours trying to do this in GIMP but I failed so I quickly cooked up a function in MATLAB called createStackedTexture.m (GitHub repository).
Example how to use the function
|
|
Code for the function
|
|