AR平面阴影

来源:互联网 发布:淘宝如何回复买家评价 编辑:程序博客网 时间:2024/05/16 12:22
Shader "FX/Matte Shadow" {Properties {    _Color ("Main Color", Color) = (1,1,1,1)    _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}    _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5}SubShader {    Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}    LOD 200    Blend Zero SrcColorCGPROGRAM#pragma surface surf ShadowOnly alphatest:_Cutofffixed4 _Color;struct Input {    float2 uv_MainTex;};inline fixed4 LightingShadowOnly (SurfaceOutput s, fixed3 lightDir, fixed atten){    fixed4 c;    c.rgb = s.Albedo*atten;    c.a = s.Alpha;    return c;}void surf (Input IN, inout SurfaceOutput o) {    fixed4 c = _Color;     o.Albedo = c.rgb;    o.Alpha = 1;}ENDCG}Fallback "Transparent/Cutout/VertexLit"}

使用 Matte Shadow 制作材质球,再将它拖拽到透明的平面上,就得到了阴影效果。

0 0
原创粉丝点击