Here’s something to make up for the simplicity of the last shader: RGB masking. This is a technique generally used to blend textures via vertex colors. The advantage is that you can use tileable textures to add detail to the material, but it doesn’t look like your textures are tiling. This is really useful for terrain. I’ve also used texture masks in the past to do basically the same thing. I also heard Unreal 4 uses this scheme to make texture masks for their multi-materials.Anyways, i included both texture and vertex masking in these. The Unity shader is set to use textures by default while the Maya version is set to use vertex colors. To change this, just comment out / uncomment the 3rd line (i think) of the pixel shader. You may have to connect the colors to the vertex color attribute in Maya. In the vertex data dropdown of the shader, right click vertex color and choose colorset1. If you are looking for a good vertex painting solution in Unity, i recommend VPaint. Mostly cuz my buddy Beck made it, but its not a bad tool either 😉

Maya CGFX File:

phongnormalmasked.cgfx
File Size: 6 kb
File Type: cgfx

Download File


Unity SHADER File:

phongnormalmasked.shader
File Size: 9 kb
File Type: shader

Download File


Leave a Reply

Your email address will not be published. Required fields are marked *