Masking a plane object (which has an animated texture offset)

Hello,
I have a plane with a material that has an animated texture offset, and I would like to mask out part of that plane.

  • I tried different shaders, but the invisible area seems to move along with the offset…
  • I tried with an additional camera (ortho) + culling mask, but the mask gets resized in different aspect ratios and it looks wrong…

Is there a way that I’m missing to clip the plane so the result will be something like the image below?

Imagine the black screen as the entire game view, and the Plane is just a normal plane with a repeating texture and animated offset… the Visible Area is what is actually being rendered, and the darker area of the plane is not being rendered at all. I made it darker here just for illustration purposes.

Thanks for any help and insights!

10804-unityissue.gif

You need a shader that uses one texture to display the image and uses one texture as an alpha. Below is an Unlit example. “Base” is used for the image you want to animate and BaseA is your alpha.

 Shader "Unlit/TransparentSeperateAlpha" 
    {
    	Properties 
    	{
    		_MainTex ("Base", 2D) = "white" {}
    		_MainTexA("BaseA", 2D) = "white" {}
    	}
    
    	SubShader 
    	{
    		Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
    		LOD 100
    	
    		ZWrite Off
    		Blend SrcAlpha OneMinusSrcAlpha 
    
    		Pass 
    		{
    			Lighting Off
    			SetTexture [_MainTex] 
    			{ 
    				Combine texture
    			}
    			SetTexture [_MainTexA]
    			{
    				Combine texture * previous
    			
    			}
    		}
    	}
    }