-
-
Save mmoczkowski/ebebb35cbe616846e54b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shader created with Shader Forge v1.13 | |
// Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/ | |
// Note: Manually altering this data may prevent you from opening it in Shader Forge | |
/*SF_DATA;ver:1.13;sub:START;pass:START;ps:flbk:,lico:1,lgpr:1,nrmq:1,nrsp:0,limd:0,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,rprd:False,enco:False,rmgx:True,rpth:0,hqsc:True,hqlp:False,tesm:0,bsrc:3,bdst:7,culm:0,dpts:2,wrdp:False,dith:0,ufog:True,aust:True,igpj:True,qofs:0,qpre:3,rntp:2,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,ofsf:0,ofsu:0,f2p0:False;n:type:ShaderForge.SFN_Final,id:6883,x:32719,y:32712,varname:node_6883,prsc:2|emission-4332-OUT,alpha-9471-OUT;n:type:ShaderForge.SFN_Tex2d,id:952,x:31988,y:32756,ptovrint:False,ptlb:MainTex,ptin:_MainTex,varname:node_952,prsc:2,tex:5d65dee50a4f94e679fd0b38b6801474,ntxv:0,isnm:False;n:type:ShaderForge.SFN_Tex2d,id:9394,x:31988,y:32979,ptovrint:False,ptlb:ScanLines,ptin:_ScanLines,varname:node_9394,prsc:2,tex:657080aefcce44b59ae660613b1b089a,ntxv:0,isnm:False|UVIN-2412-OUT;n:type:ShaderForge.SFN_Blend,id:9781,x:32248,y:32931,varname:node_9781,prsc:2,blmd:12,clmp:True|SRC-952-RGB,DST-9394-RGB;n:type:ShaderForge.SFN_Time,id:4885,x:31281,y:32815,varname:node_4885,prsc:2;n:type:ShaderForge.SFN_TexCoord,id:3818,x:31559,y:33060,varname:node_3818,prsc:2,uv:0;n:type:ShaderForge.SFN_Multiply,id:2174,x:31559,y:32898,varname:node_2174,prsc:2|A-4885-T,B-3971-XYZ;n:type:ShaderForge.SFN_Add,id:2412,x:31814,y:32979,varname:node_2412,prsc:2|A-2174-OUT,B-3818-UVOUT;n:type:ShaderForge.SFN_Vector4Property,id:3971,x:31281,y:32968,ptovrint:False,ptlb:ScanlineSpeed,ptin:_ScanlineSpeed,varname:node_3971,prsc:2,glob:False,v1:1,v2:1,v3:0,v4:0;n:type:ShaderForge.SFN_Color,id:8931,x:32248,y:32702,ptovrint:False,ptlb:Color,ptin:_Color,varname:node_8931,prsc:2,glob:False,c1:1,c2:1,c3:1,c4:1;n:type:ShaderForge.SFN_Multiply,id:4332,x:32530,y:32812,varname:node_4332,prsc:2|A-8931-RGB,B-9781-OUT;n:type:ShaderForge.SFN_Multiply,id:9471,x:32530,y:32971,varname:node_9471,prsc:2|A-8931-A,B-952-A;proporder:952-9394-8931-3971;pass:END;sub:END;*/ | |
Shader "Custom/UI" { | |
Properties { | |
_MainTex ("MainTex", 2D) = "white" {} | |
_ScanLines ("ScanLines", 2D) = "white" {} | |
_Color ("Color", Color) = (1,1,1,1) | |
_ScanlineSpeed ("ScanlineSpeed", Vector) = (1,1,0,0) | |
[HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 | |
_StencilComp ("Stencil Comparison", Float) = 8 | |
_Stencil ("Stencil ID", Float) = 0 | |
_StencilOp ("Stencil Operation", Float) = 0 | |
_StencilWriteMask ("Stencil Write Mask", Float) = 255 | |
_StencilReadMask ("Stencil Read Mask", Float) = 255 | |
_ColorMask ("Color Mask", Float) = 15 | |
} | |
SubShader { | |
Tags { | |
"IgnoreProjector"="True" | |
"Queue"="Transparent" | |
"RenderType"="Transparent" | |
} | |
Stencil | |
{ | |
Ref [_Stencil] | |
Comp [_StencilComp] | |
Pass [_StencilOp] | |
ReadMask [_StencilReadMask] | |
WriteMask [_StencilWriteMask] | |
} | |
Pass { | |
Name "FORWARD" | |
Tags { | |
"LightMode"="ForwardBase" | |
} | |
Blend SrcAlpha OneMinusSrcAlpha | |
ZWrite Off | |
ColorMask [_ColorMask] | |
CGPROGRAM | |
#pragma vertex vert | |
#pragma fragment frag | |
#define UNITY_PASS_FORWARDBASE | |
#include "UnityCG.cginc" | |
#pragma multi_compile_fwdbase | |
#pragma multi_compile_fog | |
#pragma exclude_renderers gles3 metal d3d11_9x xbox360 xboxone ps3 ps4 psp2 | |
#pragma target 3.0 | |
uniform float4 _TimeEditor; | |
uniform sampler2D _MainTex; uniform float4 _MainTex_ST; | |
uniform sampler2D _ScanLines; uniform float4 _ScanLines_ST; | |
uniform float4 _ScanlineSpeed; | |
float4 _Color; | |
struct VertexInput { | |
float4 vertex : POSITION; | |
float2 texcoord0 : TEXCOORD0; | |
}; | |
struct VertexOutput { | |
float4 pos : SV_POSITION; | |
float2 uv0 : TEXCOORD0; | |
UNITY_FOG_COORDS(1) | |
}; | |
VertexOutput vert (VertexInput v) { | |
VertexOutput o = (VertexOutput)0; | |
o.uv0 = v.texcoord0; | |
o.pos = mul(UNITY_MATRIX_MVP, v.vertex); | |
UNITY_TRANSFER_FOG(o,o.pos); | |
return o; | |
} | |
float4 frag(VertexOutput i) : COLOR { | |
/////// Vectors: | |
////// Lighting: | |
////// Emissive: | |
float4 _MainTex_var = tex2D(_MainTex,TRANSFORM_TEX(i.uv0, _MainTex)); | |
float4 node_4885 = _Time + _TimeEditor; | |
float3 node_2412 = ((node_4885.g*_ScanlineSpeed.rgb)+float3(i.uv0,0.0)); | |
float4 _ScanLines_var = tex2D(_ScanLines,TRANSFORM_TEX(node_2412, _ScanLines)); | |
float3 emissive = (_Color.rgb*saturate((_MainTex_var.rgb > 0.5 ? (1.0-(1.0-2.0*(_MainTex_var.rgb-0.5))*(1.0-_ScanLines_var.rgb)) : (2.0*_MainTex_var.rgb*_ScanLines_var.rgb)) )); | |
float3 finalColor = emissive; | |
fixed4 finalRGBA = fixed4(finalColor,(_Color.a*_MainTex_var.a)); | |
UNITY_APPLY_FOG(i.fogCoord, finalRGBA); | |
return finalRGBA; | |
} | |
ENDCG | |
} | |
} | |
FallBack "Diffuse" | |
CustomEditor "ShaderForgeMaterialInspector" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment