Beispiel #1
0
        protected override void SetShadowValues(Shader shader, string name, ref int shadowMapUnit)
        {
            shader.SetBool(name + ".shadowsEnabled", ShadowsEnabled);

            if (!ShadowsEnabled)
            {
                return;
            }

            shader.SetMat4(name + ".lightSpace", LightSpace);
            shader.SetInt("shadowCube", shadowMapUnit + 8);
            ShadowMap.BindToUnit(shadowMapUnit + 8);
            shadowMapUnit += 1;
        }
Beispiel #2
0
        protected virtual void SetShadowValues(Shader shader, string name, ref int shadowMapUnit)
        {
            shader.SetBool(name + ".shadowsEnabled", ShadowsEnabled);

            if (!ShadowsEnabled)
            {
                return;
            }

            shader.SetMat4(name + ".lightSpace", LightSpace);
            shader.SetInt(name + ".shadowIndex", shadowMapUnit);
            shader.SetInt("shadowMaps[" + shadowMapUnit + "]", shadowMapUnit + 8);
            ShadowMap.BindToUnit(shadowMapUnit + 8);
            shadowMapUnit += 1;
        }