unity shader瀑布

xiaoxiao2021-02-28  121

关于瀑布的shader,看了好多,都是比较复杂的,有个比较简单: 几个属性: MainTex 主贴图 xScrollSpeed yScrollSpeed _maskAlphaTex _cutout

透明的: Tags { “IgnoreProjector”=”True” “Queue”=”Transparent” “RenderType”=”Transparent” }

Blend SrcAlpha One ZWrite Off //ZTest NotEqual Cull Off

MainTex的uv进行变化 scrollValueX = ScrollSpeedX * _Time.y;

scrollValueY = ScrollSpeedY * _Time.y;

主贴图的o.uv.xy += frac(float2(_ScrollXSpeed, _ScrollYSpeed) * _Time.x); 阿尔法贴图的uv

frag里透明度为阿尔法贴图的r乘以cutout。 看起来挺简单,不过对美术的要求应该比较高

转载请注明原文地址: https://www.6miu.com/read-37995.html

最新回复(0)