Пример #1
0
        private void PrepareShaderProgram()
        {
            if (program != null)
            {
                return;
            }

            // TODO: We need to tweak shadow quality settings
            var lightSourceAvailable = lightSource != null;
            var spec = new CommonMaterialProgramSpec {
                SkinEnabled           = skinEnabled,
                DiffuseTextureEnabled = diffuseTexture != null,
                FogMode                  = FogMode,
                ProcessLightning         = ProcessLightning,
                RecieveShadows           = RecieveShadows,
                ShadowMapSize            = lightSourceAvailable ? lightSource.ShadowMapSize : IntVector2.Zero,
                SmoothShadows            = true,
                HighQualitySmoothShadows = lightSourceAvailable && lightSource.ShadowMapQuality > ShadowMapTextureQuality.Medium
            };

            if (programCache.TryGetValue(spec, out program))
            {
                return;
            }
            program            = new CommonMaterialProgram(spec);
            programCache[spec] = program;
        }
Пример #2
0
        private void PrepareShaderProgram()
        {
            if (program != null)
            {
                return;
            }
            var spec = new CommonMaterialProgramSpec {
                SkinEnabled           = skinEnabled,
                DiffuseTextureEnabled = diffuseTexture != null,
                FogMode = FogMode
            };

            if (programCache.TryGetValue(spec, out program))
            {
                return;
            }
            program            = new CommonMaterialProgram(spec);
            programCache[spec] = program;
        }
Пример #3
0
 public void Invalidate()
 {
     program = null;
 }