protected override async Task LoadContent() { await base.LoadContent(); customEffect = EffectSystem.LoadEffect("CustomEffect"); quad = new PrimitiveQuad(GraphicsDevice, customEffect); }
public override void Start() { base.Start(); paradoxTexture = Asset.Load <Texture>("LogoParadox"); customEffect = EffectSystem.LoadEffect("Effect").WaitForResult(); quad = new PrimitiveQuad(GraphicsDevice, customEffect); // set fixed parameters once quad.Parameters.Set(EffectKeys.Center, new Vector2(0.5f, 0.5f)); quad.Parameters.Set(EffectKeys.Frequency, 40); quad.Parameters.Set(EffectKeys.Spread, 0.5f); quad.Parameters.Set(EffectKeys.Amplitude, 0.015f); quad.Parameters.Set(EffectKeys.InvAspectRatio, GraphicsDevice.BackBuffer.Height / (float)GraphicsDevice.BackBuffer.Width); // NOTE: Linear-Wrap sampling is not available for non-square non-power-of-two textures on opengl es 2.0 samplingState = SamplerState.New(GraphicsDevice, new SamplerStateDescription(TextureFilter.Linear, TextureAddressMode.Clamp)); // Add Effect rendering to the end of the pipeline var scene = SceneSystem.SceneInstance.Scene; var compositor = ((SceneGraphicsCompositorLayers)scene.Settings.GraphicsCompositor); renderer = new SceneDelegateRenderer(RenderQuad); compositor.Master.Renderers.Add(renderer); }