Categories
Common talks Unity3D

Small but useful Unity3D shader for Augmented Reality

Sometimes when you do Augmented reality apps, you need hide parts of 3D which pass behind user body or head. Easiest way to make this – use hidden 3d mannequin or 3d head with special shader which cull all pixel data behind it.

358b2eefaa239355f0d5718942baf63c

I just wrote small one for Unity3D.

Shader "Custom/CullMaterial" {
	Properties {
		_MainTex ("Base (RGB)", 2D) = "white" {}
	}
	 SubShader {
	 Tags { "Queue" = "Background-1" }
        Pass {
            Material {
                Diffuse (1,1,1,1)
            }
            Lighting On
            ColorMask 0
        }
    }
	FallBack "Diffuse"
}

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.