- Home /
Two pass shader works in editor but not in iPad?
Here it is: http://pastebin.com/EWSn8t2m
It's really just Diffuse Detail shader with the detail being rendered over the diffuse instead of multiplied with the diffuse. The second layer (detail layer) needs to have an editable opacity so that it can fade away.
I'm still slightly new to .shader still and I don't know the limits to creating them to iOS. Please help, and thanks in advance! :)
NOTE: The probably could have actually been one of the other coders scripts messing with the material and the problem could NOT be the .shader, I just want to know for sure my shader is good before I sift through thousands of lines of code.
Answer by SSauerGFG · Aug 20, 2012 at 11:48 PM
Just realized that paste bin will expire, so heres a snippet of it:
Shader "Custom/Diffuse Detail Opacity" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_Opacity ("Opacity Mod", Range(0,1)) = 1
_Detail ("Detail (RGB)", 2D) = "gray" {}
}
SubShader {
Pass{
Material{
Diffuse [_Color]
}
Lighting On
Fog { Mode Off }
SetTexture [_MainTex] { combine texture * primary Double, texture * primary }
}
Pass{
Blend SrcAlpha OneMinusSrcAlpha
SetTexture [_Detail] { ConstantColor(0,0,0,[_Opacity] )
combine texture, texture * constant}
}
}
FallBack "VertexLit", 2
}
Your answer
Follow this Question
Related Questions
transparent mode does not work at alpha=255 1 Answer
radial opacity shader 0 Answers
add alpha variables to a customised diffuse detail shader 0 Answers
Toon shader and alphas 0 Answers
GrayscaleEffect shader broken in 3.5? 0 Answers