- Home /
animation shader problem
I code the shader with CG. I want to animate textures from one to another using time.
float3 Mask = tex2D(_MaskMap,i.uv);
float3 CurrentColor = tex2D(_EntryTexture,i.uv);
float3 DestiantionColor = tex2D(_DestinationTexture, i.uv);
float animateColor = _Time.x/256;
if(Mask.r == animateColor && Mask.g == animateColor && Mask.b == animateColor)
{
CurrentColor = DestiantionColor;
}
return float4(CurrentColor,1);
this is my pixel shader.
Mask is texture that made of color RGB(0,0,0) ~ RGB(255,255,255)
The mechanism is that first, read mask and change texture color from currentColor to DestinationColor.
this runs RGB(0,0,0) ~ RGB(255,255,255)
The things I dont know is _Time's value(sec Unit? ms Unit?). and if statement( if(Mask.r == 192/256) : this is not work. ).
I need your help T.T
Comment
Your answer
Follow this Question
Related Questions
Animate Toon Water on Plane? 0 Answers
scroll texture from center to nearest edge 1 Answer
3D Mesh Deformer in Unity3D 2 Answers
What is wrong with my shader? 1 Answer
Rendering a G-Buffer for a cubemap 0 Answers