- Reworked credits display to be more efficient and easy to edit. - Renamed the Wood shader to a more appropriate and genericised name. - Reorganised static Wanted posters into their own folder.
72 lines
2.1 KiB
Plaintext
72 lines
2.1 KiB
Plaintext
Shader "Carmen/Crook Portrait"
|
|
{
|
|
Properties
|
|
{
|
|
_MainTex ("Portrait", 2D) = "white" {}
|
|
_Text ("Portrait Text", 2D) = "white" {}
|
|
_TextAlpha ("Portrait Text Alpha", 2D) = "white" {}
|
|
}
|
|
SubShader
|
|
{
|
|
Tags { "RenderType" = "Opaque" }
|
|
LOD 200
|
|
|
|
CGPROGRAM
|
|
#pragma surface surf Standard
|
|
//#pragma vertex vert
|
|
//#pragma fragment frag
|
|
|
|
UNITY_DECLARE_TEX2D(_MainTex);
|
|
UNITY_DECLARE_TEX2D(_Text);
|
|
UNITY_DECLARE_TEX2D(_TextAlpha);
|
|
|
|
|
|
// struct Data
|
|
// {
|
|
// float4 vertex : POSITION;
|
|
// float2 uv : TEXCOORD0;
|
|
// };
|
|
|
|
// struct Vert2Frag
|
|
// {
|
|
// float4 position : SV_POSITION;
|
|
// float2 uv : TEXCOORD0;
|
|
// };
|
|
|
|
struct Input
|
|
{
|
|
float2 uv_MainTex;
|
|
float2 uv_Text;
|
|
float2 uv_TextAlpha;
|
|
};
|
|
|
|
|
|
// Vert2Frag vert(inout Data v)
|
|
// {
|
|
// Vert2Frag o;
|
|
// o.position = UnityObjectToClipPos(v.vertex);
|
|
// o.uv = v.uv;
|
|
// return o;
|
|
// }
|
|
|
|
// fixed4 frag(Vert2Frag i) : SV_TARGET
|
|
// {
|
|
// return UNITY_SAMPLE_TEX2D(_MainTex, i.uv);
|
|
// }
|
|
|
|
void surf (Input IN, inout SurfaceOutputStandard o)
|
|
{
|
|
float3 MainColour = UNITY_SAMPLE_TEX2D(_MainTex, IN.uv_MainTex);
|
|
float Text = UNITY_SAMPLE_TEX2D(_Text, IN.uv_MainTex).r;
|
|
float TextAlpha = UNITY_SAMPLE_TEX2D(_TextAlpha, IN.uv_MainTex).r;
|
|
|
|
float3 TextColourMix = lerp(float3(1.0, 1.0, 1.0), float3(0.0, 0.0, 0.0), TextAlpha - Text);
|
|
float3 ImageMix = lerp(MainColour, TextColourMix, TextAlpha);
|
|
|
|
o.Albedo = ImageMix;//lerp(MainColour, float3(0.0, 0.0, 0.0), TextAlpha - Text);
|
|
//o.Albedo = UNITY_SAMPLE_TEX2D(_Text, IN.uv_MainTex).r;
|
|
}
|
|
ENDCG
|
|
}
|
|
Fallback "Diffuse"
|
|
} |