Artistic Experiments
  • Home
  • Reel
  • Shaders
    • Stylized Shaders
    • Lighting Techniques
    • Shader Effects
    • Cubemaps
    • Pixel Lit Shaders (Basic)
    • Vertex Lit Shaders (Basic)
    • Unlit Shaders (Basic)
  • Tools
  • WIP
  • Contact

CG Shaders - RGB Masking

12/11/2013

0 Comments

 
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 ;)
Picture

Maya CGFX File:

phongnormalmasked.cgfx
File Size: 13 kb
File Type: cgfx
Download File

Unity SHADER File:

phongnormalmasked.shader
File Size: 17 kb
File Type: shader
Download File

0 Comments



Leave a Reply.

    CG Shaders

    Shaders I've built as i teach myself CG. Feel free to download and use for whatever. If you like them you can buy me a beer or something.

    Archives

    December 2014
    April 2014
    March 2014
    February 2014
    January 2014
    December 2013
    November 2013

    Categories

    All

    RSS Feed

Powered by Create your own unique website with customizable templates.