// current edge detection threshold /// <summary> /// Erstellt einen neuen Cel-Shading-Effekt für den angegebenen IGameScreen. /// </summary> public CelShadingEffect(IScreen screen) : base(screen) { /* Set our light direction for the cel-shader */ lightDirection = new Vector4 (0.0f, 0.0f, 1.0f, 1.0f); /* Load and initialize the cel-shader effect */ celShader = screen.LoadEffect ("CelShader"); RegisterEffect (celShader); celShader.Parameters ["LightDirection"].SetValue (lightDirection); celMap = screen.LoadTexture ("CelMap"); if (celMap == null) { celMap = ContentLoader.CreateTexture (screen.GraphicsDevice, Color.White); } celShader.Parameters ["Color"].SetValue (Color.Green.ToVector4 ()); celShader.Parameters ["CelMap"].SetValue (celMap); /* Load and initialize the outline shader effect */ outlineShader = screen.LoadEffect ("OutlineShader"); RegisterEffect (outlineShader); outlineShader.Parameters ["Thickness"].SetValue (outlineThickness); outlineShader.Parameters ["Threshold"].SetValue (outlineThreshold); outlineShader.Parameters ["ScreenSize"].SetValue (new Vector2 (screen.Viewport.Bounds.Width, screen.Viewport.Bounds.Height)); }