Unity Spain
Post Antiguos => General (Antiguo) => Mensaje iniciado por: diego en Septiembre 01, 2015, 09:33:26 PM
Hola comunidad !! Quisiera saber como puedo hacer que la desintegracion de mi shader se mueva con respecto a la textura. Tengo esa duda desde hace 2 dias y aun no puedo solucionarlo.Aqui les posteo el codigo y si me pueden hechar una mano les estaria super agradecido.Desde ya muchas gracias !Shader "Custom/Holograma" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_ScrollXSpeed ("X Scroll Speed", Range (0, 10)) = 2
_ScrollYSpeed ("Y Scroll Speed", Range (0,10)) = 2
_SliceGuide ("Slice Guide (RGB)", 2D) = "white" {}
_SliceAmount ("Slice Amount", Range(0.0, 1.0)) = 0.5
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Standard fullforwardshadows
#pragma target 4.0 sampler2D _MainTex;
float _ScrollXSpeed;
float _ScrollYSpeed;
struct Input {
float2 uv_MainTex;
float2 uv_SliceGuide;
float _SliceAmount;
}; sampler2D _SliceGuide;
float _SliceAmount;
float4 _Color; void surf (Input IN, inout SurfaceOutputStandard o) {
float2 scrolledUV = IN.uv_MainTex;
float xScrollValue = _ScrollXSpeed * _Time;
float yScrollValue = _ScrollYSpeed * _Time;
scrolledUV += float2 (xScrollValue,yScrollValue);
clip(tex2D (_SliceGuide, IN.uv_SliceGuide).rgb - _SliceAmount);
fixed4 c = tex2D (_MainTex, fixed2 (scrolledUV )) * _Color;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
Pusiste el post donde no va.