zoukankan      html  css  js  c++  java
  • 在渲染时把一个平面抠个洞

    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
            }
        }
    }

  • 相关阅读:
    从sql查询结果集中查询
    tsql中with用法
    tsql 2005 ROW_NUMBER
    基于对象的C#
    逍遥游
    Creating Custom Solutions for Document Collaboration
    Word template
    Jquery :nthchild 选择用法
    .net 转换任意类型不报错
    Dom 中同级元素 选择第几个的另类方法
  • 原文地址:https://www.cnblogs.com/lilei9110/p/7058316.html
Copyright © 2011-2022 走看看