Quantcast
Channel: Latest Questions by Selzier
Viewing all articles
Browse latest Browse all 34

Shader: Mask Without a Texture?

$
0
0
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

Viewing all articles
Browse latest Browse all 34

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>