Skip to content

Instantly share code, notes, and snippets.

@kirillrybin
Created January 6, 2014 23:06
Show Gist options
  • Save kirillrybin/8291572 to your computer and use it in GitHub Desktop.
Save kirillrybin/8291572 to your computer and use it in GitHub Desktop.
Shader for blending skyboxes in Unity3D via http://forum.unity3d.com/threads/213679-4in1-blending-skybox-HELP!
Shader "RenderFX/Skybox Blended" {
Properties {
_Tint ("Tint Color", Color) = (.5, .5, .5, .5)
_Blend ("Blend", Range(0.0,1.0)) = 0.5
_Skybox1 ("Skybox one", Cube) = ""
_Skybox2 ("Skybox two", Cube) = ""
}
SubShader {
Tags { "Queue" = "Background" }
Cull Off
Fog { Mode Off }
Lighting Off
Color [_Tint]
Pass {
SetTexture [_Skybox1] { combine texture }
SetTexture [_Skybox2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
SetTexture [_Skybox2] { combine previous +- primary, previous * primary }
}
}
Fallback "RenderFX/Skybox", 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment