I have a shader working that has a sampler2D for a mask. Black is hidden and white areas are visible:
void surf(Input IN, inout SurfaceOutput o) { float2 newuv = TRANSFORM_TEX(IN.uv_ArmUpper, _MainTex); fixed4 MainColor = tex2D(_MainTex, newuv); fixed4 ArmUpperColor = tex2D(_ArmUpper, IN.uv_ArmUpper); fixed4 MaskColor = tex2D(_MaskTex, IN.uv_MaskTex); o.Albedo = ArmUpperColor * MaskColor.rgb + MainColor.rgb * (1 - MaskColor.rgb); }
The mask is perfect square. It begins at 0,0 and ends at 256,256 (Full image is 512x512):
![alt text][1]
**How can I avoid using this image and send in the data 0,0 - 256,256 as a "Mask" parameter ?**
[1]: /storage/temp/173288-simplemask.jpg
void surf(Input IN, inout SurfaceOutput o) { float2 newuv = TRANSFORM_TEX(IN.uv_ArmUpper, _MainTex); fixed4 MainColor = tex2D(_MainTex, newuv); fixed4 ArmUpperColor = tex2D(_ArmUpper, IN.uv_ArmUpper); fixed4 MaskColor = tex2D(_MaskTex, IN.uv_MaskTex); o.Albedo = ArmUpperColor * MaskColor.rgb + MainColor.rgb * (1 - MaskColor.rgb); }
The mask is perfect square. It begins at 0,0 and ends at 256,256 (Full image is 512x512):
![alt text][1]
**How can I avoid using this image and send in the data 0,0 - 256,256 as a "Mask" parameter ?**
[1]: /storage/temp/173288-simplemask.jpg