Skip to content

Instantly share code, notes, and snippets.

@flarb
Created February 16, 2012 09:42
Show Gist options
  • Save flarb/1843677 to your computer and use it in GitHub Desktop.
Save flarb/1843677 to your computer and use it in GitHub Desktop.
Mobile Ambient Diffuse Detail shader for Unity3D - just a simple one line change.
Shader "Mobile/Ambient Diffuse Detail" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_Detail ("Detail (RGB)", 2D) = "gray" {}
}
SubShader {
Pass{
Material{
Diffuse [_Color]
Ambient [_Color]
}
Lighting On
Fog { Mode Off }
SetTexture [_MainTex] { combine texture * primary Double, texture * primary}
SetTexture [_Detail] { combine previous * texture Double, previous}
}
}
FallBack "VertexLit", 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment