Example #1
0
        public void LoadTestShader_ShouldDrawAllRed()
        {
            testRenderImage.BeginDrawing();


            GLSLShader currshader = resources.GetShader("RedShader");

            currshader.SetParameter("TextureUnit0", testsprite.Texture);
            currshader.setAsCurrentShader();
            testsprite.Draw();
            testRenderImage.EndDrawing();
            currshader.ResetCurrentShader();
            testRenderImage.Blit(0, 0, 1280, 720, Color.White, BlitterSizeMode.Crop);

            resources.GetSprite("flashlight_mask").Draw();
        }
        public override void ProcessImage(RenderImage image)
        {
            var OstafLikesTheCock = new RenderImage(image.Height, image.Height);

            CluwneLib.CurrentRenderTarget = OstafLikesTheCock;

            image.Blit(0, 0, image.Height, image.Height, Color.White, BlitterSizeMode.Crop);
            CluwneLib.CurrentRenderTarget = image;
            CluwneLib.CurrentShader       = _shader;
            _shader.SetParameter("SceneTexture", OstafLikesTheCock);
            _shader.setDuration((Math.Abs(_duration)));
            OstafLikesTheCock.Blit(0, 0, image.Height, image.Height, Color.White, BlitterSizeMode.Crop);

            CluwneLib.CurrentRenderTarget = null;
            CluwneLib.CurrentShader       = null;
            OstafLikesTheCock.Dispose();
        }
        public override void ProcessImage(RenderImage image)
        {
            var OstafLikesTheCock = new RenderImage("CockLoverOstaf", image.Height, image.Height);

            OstafLikesTheCock.BeginDrawing();
            image.Blit(0, 0, image.Height, image.Height, SFML.Graphics.Color.White, BlitterSizeMode.Crop);
            OstafLikesTheCock.EndDrawing();

            image.BeginDrawing();
            _shader.setAsCurrentShader();
            _shader.SetParameter("SceneTexture", OstafLikesTheCock);
            _shader.setDuration((Math.Abs(_duration)));
            OstafLikesTheCock.Blit(0, 0, image.Height, image.Height, SFML.Graphics.Color.White, BlitterSizeMode.Crop);
            image.EndDrawing();

            _shader.ResetCurrentShader();
            OstafLikesTheCock.Dispose();
        }
Example #4
0
        public override void Draw(double deltaTime)
        {
            RenderTexture rt = RenderTexture;

            if (rt == null)
            {
                if (Camera == null)
                {
                    return;
                }
                else
                {
                    rt = Camera.TargetTexture;
                }
            }
            if (!rt.Loaded)
            {
                return;
            }

            renderTexture.Bind(Color4.White);
            ccShader.UseShader();
            ccShader.SetParameter(loc_resolution, MMW.RenderResolution.ToVector2().Inverse());
            ccShader.SetParameter(loc_mvp, ref orthoMatrix, false);
            ccShader.SetParameter(loc_con, Contrast);
            ccShader.SetParameter(loc_sat, Saturation);
            ccShader.SetParameter(loc_brt, Brightness);
            ccShader.SetParameter(TextureUnit.Texture0, rt.ColorDst0);
            Drawer.DrawTextureMesh();
            ccShader.UnuseShader();

            rt.Bind();
            Drawer.DrawTexture(renderTexture.ColorDst0);

            GL.BindTexture(TextureTarget.Texture2D, 0);
        }