代码之家  ›  专栏  ›  技术社区  ›  Haerang Lee

它是如何在Unity StandardSurfaceshader中使用自定义照明功能的

  •  0
  • Haerang Lee  · 技术社区  · 3 年前

    我做了一个自定义的照明函数,返回float4(0,0,0,1),并希望最终的颜色是黑色,但事实并非如此。 gameObject仍然是彩色的

    自定义照明功能不起任何作用,就好像它不起作用一样

    为什么自定义照明功能的返回值不影响最终颜色?

    void surf (Input IN, inout SurfaceOutput o)
            {
                float3 screenUV = IN.screenPos.xyz/ IN.screenPos.w;
                o.Emission = float3(screenUV.rg,0);
            }   
    
            float4 LightingSimple(SurfaceOutput s, float3 lightDir, float atten)
            {
                return float4(0,0,0,1);
            }
    

    0 回复  |  直到 3 年前