Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Debug/Espejo"
- {
- Properties
- {
- _MainTex ("", 2D) = "white" {}
- _colorBase ("color Base", Color) = (1,1,1,1)
- _colorEspejo ("color Espejo", Color) = (1,1,1,1)
- [HideInInspector] _ReflectionTex ("", 2D) = "white" {}
- }
- SubShader
- {
- Tags { "RenderType"="Opaque" }
- LOD 100
- Pass {
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #include "UnityCG.cginc"
- struct v2f
- {
- float2 uv : TEXCOORD0;
- float4 espejo : TEXCOORD1;
- float4 pos : SV_POSITION;
- };
- float4 _MainTex_ST;
- fixed4 _colorBase;
- fixed4 _colorEspejo;
- v2f vert(float4 pos : POSITION, float2 uv : TEXCOORD0)
- {
- v2f o;
- o.pos = UnityObjectToClipPos (pos);
- o.uv = TRANSFORM_TEX(uv, _MainTex);
- o.espejo = ComputeScreenPos (o.pos);
- return o;
- }
- sampler2D _MainTex;
- sampler2D _ReflectionTex;
- fixed4 frag(v2f i) : SV_Target
- {
- return (tex2D(_MainTex, i.uv) * _colorBase * _colorBase.a) + (tex2Dproj(_ReflectionTex, UNITY_PROJ_COORD(i.espejo)) * _colorEspejo * _colorEspejo.a);
- }
- ENDCG
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement