• 在渲染时把一个平面抠个洞


    http://answers.unity3d.com/questions/590800/how-to-cullrender-to-through-a-window.html

    使用DepthMask

    Shader "NexgenDragon/DepthMask" {
        SubShader {
            // Render the mask after regular geometry, but before masked geometry and
            // transparent things.

            Tags{ "Queue" = "Geometry-1" }

            // Don't draw in the RGBA channels; just the depth buffer

            ZWrite On
            ColorMask 0

            // Do nothing specific in the pass:

            Pass {

                CGPROGRAM
                #pragma vertex vert
                #pragma fragment frag

                #include "UnityCG.cginc"
                
                struct appdata_t
                {
                    float4 vertex : POSITION;
                };

                struct v2f
                {
                    float4 vertex : SV_POSITION;
                };

                v2f vert(appdata_t v)
                {
                    v2f o;
                    o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
                    return o;
                }

                half4 frag(v2f i) : SV_Target
                {
                    return 0;
                }

                ENDCG
            }
        }
    }

  • 相关阅读:
    BZOJ4987 Tree
    BZOJ4817 [SDOI2017]树点涂色
    BZOJ4811: [YNOI2017] 由乃的OJ
    BSGS算法
    codeforces914G Sum the Fibonacci
    NOI2018网络同步赛游记
    雅礼集训 2017 Day2 水箱 可并堆
    CTSC&APIO2018游记
    51Nod 有限背包计数问题 题解报告
    CTSC2016&&APIO2016游记
  • 原文地址:https://www.cnblogs.com/lilei9110/p/7058316.html
Copyright © 2020-2023  润新知