public RenderTargetBlend(RenderTargetBlendDescription bRenderTargetBlend) { if (bRenderTargetBlend.BlendEnable) { SrcFactor = CtObjectGL.BlendFactor(bRenderTargetBlend.SourceBlend); DestFactor = CtObjectGL.BlendFactor(bRenderTargetBlend.DestinationBlend); EquationMode = CtObjectGL.BlendFunc(bRenderTargetBlend.BlendOperation); SrcFactorAlpha = CtObjectGL.BlendFactor(bRenderTargetBlend.SourceBlendAlpha); DestFactorAlpha = CtObjectGL.BlendFactor(bRenderTargetBlend.DestinationBlendAlpha); EquationModeAlpha = CtObjectGL.BlendFunc(bRenderTargetBlend.BlendOperationAlpha); } else { SrcFactor = BlendFactor.One; DestFactor = BlendFactor.Zero; EquationMode = BlendFunc.Add; SrcFactorAlpha = BlendFactor.One; DestFactorAlpha = BlendFactor.Zero; EquationModeAlpha = BlendFunc.Add; } Separate = SrcFactor != SrcFactorAlpha || DestFactor != DestFactorAlpha || EquationMode != EquationModeAlpha; }
public override void AlphaBlendFunc(BlendFunc srcFunc, BlendFunc dstFunc) { srcBlendFunc = blendFuncs[(int)srcFunc]; dstBlendFunc = blendFuncs[(int)dstFunc]; device.SetRenderState(RenderState.SourceBlend, (int)srcBlendFunc); device.SetRenderState(RenderState.DestinationBlend, (int)dstBlendFunc); }
public override void RGBAlphaBlendFunc(BlendFunc srcFuncRGB, BlendFunc dstFuncRGB, BlendFunc srcFuncAlpha, BlendFunc dstFuncAlpha) { srcBlendFunc = blendFuncs[(int)srcFuncRGB]; dstBlendFunc = blendFuncs[(int)dstFuncRGB]; srcBlendFuncAlpha = blendFuncs[(int)srcFuncAlpha]; dstBlendFuncAlpha = blendFuncs[(int)dstFuncAlpha]; device.SetRenderState(RenderState.SourceBlend, (int)srcBlendFunc); device.SetRenderState(RenderState.DestinationBlend, (int)dstBlendFunc); device.SetRenderState(RenderState.SourceBlendAlpha, (int)srcBlendFuncAlpha); device.SetRenderState(RenderState.DestinationBlendAlpha, (int)dstBlendFuncAlpha); }
public static void rasterize (BlendFunc bf, byte* src, byte* dest) { checkerboard(src, numPixels, 0x0); checkerboard(dest, numPixels, 0xFF); var rowSize = width * 3; for (var y = 0; y < height; y++) { bf(src, dest, width); src += rowSize; dest += rowSize; } }
public static void rasterize(BlendFunc bf, byte *src, byte *dest) { checkerboard(src, numPixels, 0x0); checkerboard(dest, numPixels, 0xFF); var rowSize = width * 3; for (var y = 0; y < height; y++) { bf(src, dest, width); src += rowSize; dest += rowSize; } }
public static All GetGLBlendEquationMode(BlendFunc func) { switch (func) { case BlendFunc.Add: return(All.FuncAdd); case BlendFunc.Subtract: return(All.FuncSubtract); case BlendFunc.ReverseSubtract: return(All.FuncReverseSubtract); default: throw new ArgumentException(nameof(func)); } }
public static BlendEquationMode ToGLBlendEquationMode(this BlendFunc value) { switch (value) { case BlendFunc.Add: return(BlendEquationMode.FuncAdd); case BlendFunc.Subtract: return(BlendEquationMode.FuncSubtract); case BlendFunc.ReverseSubtract: return(BlendEquationMode.FuncReverseSubtract); default: throw new NotSupportedException(); } }
public static SharpVulkan.BlendOperation GetVKBlendOp(BlendFunc func) { switch (func) { case BlendFunc.Add: return(SharpVulkan.BlendOperation.Add); case BlendFunc.Subtract: return(SharpVulkan.BlendOperation.Subtract); case BlendFunc.ReverseSubtract: return(SharpVulkan.BlendOperation.ReverseSubtract); default: throw new ArgumentException(nameof(func)); } }
private PICABlendFunc ConvertBlendFunc(BlendFunc factor) { switch (factor) { case BlendFunc.ConstantAlpha: return(PICABlendFunc.ConstantAlpha); case BlendFunc.ConstantColor: return(PICABlendFunc.ConstantColor); case BlendFunc.DestinationAlpha: return(PICABlendFunc.DestinationAlpha); case BlendFunc.DestinationColor: return(PICABlendFunc.DestinationColor); case BlendFunc.One: return(PICABlendFunc.One); case BlendFunc.OneMinusConstantAlpha: return(PICABlendFunc.OneMinusConstantAlpha); case BlendFunc.OneMinusConstantColor: return(PICABlendFunc.OneMinusConstantColor); case BlendFunc.OneMinusDestinationAlpha: return(PICABlendFunc.OneMinusDestinationAlpha); case BlendFunc.OneMinusDestinationColor: return(PICABlendFunc.OneMinusDestinationColor); case BlendFunc.OneMinusSourceAlpha: return(PICABlendFunc.OneMinusSourceAlpha); case BlendFunc.OneMinusSourceColor: return(PICABlendFunc.OneMinusSourceColor); case BlendFunc.SourceAlpha: return(PICABlendFunc.SourceAlpha); case BlendFunc.SourceColor: return(PICABlendFunc.SourceColor); case BlendFunc.SourceAlphaSaturate: return(PICABlendFunc.SourceAlphaSaturate); case BlendFunc.Zero: return(PICABlendFunc.Zero); default: return(PICABlendFunc.Zero); } }
/// <summary> Sets the alpha blend function that is used when alpha blending is enabled. </summary> public abstract void AlphaBlendFunc(BlendFunc srcFunc, BlendFunc dstFunc);
public static void SetBlendFunc(BlendFunc function) => setBlendFunc(function);
private void InitializeOpenGlBlendMode() { //These are copied from GameEngine2d. I only have a vague idea what they do. NoBlendFunc = new BlendFunc(BlendFuncMode.Add, BlendFuncFactor.One, BlendFuncFactor.One); NormalBlendFunc = new BlendFunc(BlendFuncMode.Add, BlendFuncFactor.SrcAlpha, BlendFuncFactor.OneMinusSrcAlpha); AdditiveBlendFunc = new BlendFunc(BlendFuncMode.Add, BlendFuncFactor.One, BlendFuncFactor.One); MultiplicativeBlendFunc = new BlendFunc(BlendFuncMode.Add, BlendFuncFactor.DstColor, BlendFuncFactor.Zero); PremultipliedAlphaBlendFunc = new BlendFunc(BlendFuncMode.Add, BlendFuncFactor.One, BlendFuncFactor.OneMinusSrcAlpha); }
public void BlendFunc(BlendFunc srcBlend, BlendFunc dstBlend) { GlBindings.BlendFunc(srcBlend, dstBlend); }
public override void RGBAlphaBlendFunc(BlendFunc srcFuncRGB, BlendFunc dstFuncRGB, BlendFunc srcFuncAlpha, BlendFunc dstFuncAlpha) { GL.BlendFuncSeparate(blendFuncs[(int)srcFuncRGB], blendFuncs[(int)dstFuncRGB], blendFuncs[(int)srcFuncAlpha], blendFuncs[(int)dstFuncAlpha]); }
private void SetBlendMode(BlendFunc blendFunc) { //Checking just as slow as setting? //if(!GraphicsContext.IsEnabled(EnableMode.Blend)) GraphicsContext.Enable(EnableMode.Blend); GraphicsContext.SetBlendFunc(blendFunc); SetRenderRequired(); }
public void Init() { quadShader = MakeShader(quadShaderVert, quadShaderFrag); inverseQuadShader = MakeShader(quadShaderVert, invertQuadShaderFrag); evenquadShader = MakeShader(quadShaderVert, evenQuadShaderFrag); int loc; int[] samplers = new int[12]; for (int i = 0; i < 12; i++) { samplers[i] = i; } GL.UseProgram(quadShader); for (int i = 0; i < 12; i++) { loc = GL.GetUniformLocation(quadShader, "textureSampler" + (i + 1)); GL.Uniform1(loc, i); } GL.UseProgram(inverseQuadShader); for (int i = 0; i < 12; i++) { loc = GL.GetUniformLocation(inverseQuadShader, "textureSampler" + (i + 1)); GL.Uniform1(loc, i); } GL.UseProgram(evenquadShader); for (int i = 0; i < 12; i++) { loc = GL.GetUniformLocation(evenquadShader, "textureSampler" + (i + 1)); GL.Uniform1(loc, i); } quadVertexbuff = new double[quadBufferLength * 8]; quadColorbuff = new float[quadBufferLength * 16]; quadUVbuff = new double[quadBufferLength * 8]; quadTexIDbuff = new float[quadBufferLength * 4]; GL.GenBuffers(1, out vertexBufferID); GL.GenBuffers(1, out colorBufferID); GL.GenBuffers(1, out uvBufferID); GL.GenBuffers(1, out texIDBufferID); for (uint i = 0; i < indexes.Length / 6; i++) { indexes[i * 6 + 0] = i * 4 + 0; indexes[i * 6 + 1] = i * 4 + 1; indexes[i * 6 + 2] = i * 4 + 3; indexes[i * 6 + 3] = i * 4 + 1; indexes[i * 6 + 4] = i * 4 + 3; indexes[i * 6 + 5] = i * 4 + 2; } GL.GenBuffers(1, out indexBufferId); GL.BindBuffer(BufferTarget.ElementArrayBuffer, indexBufferId); GL.BufferData( BufferTarget.ElementArrayBuffer, (IntPtr)(indexes.Length * 4), indexes, BufferUsageHint.StaticDraw); if (currScript != null) { try { LoadScript(currScript); } catch { currScript = null; lastScriptChangeTime = 0; } } CheckScript(); IO.renderQuad = RenderQuad; IO.renderShape = RenderShape; IO.forceFlush = () => FlushQuadBuffer(false); IO.selectTexShader = (s) => { if (currentShader != s) { FlushQuadBuffer(false); } if (s == TextureShaders.Normal) { GL.UseProgram(quadShader); } if (s == TextureShaders.Inverted) { GL.UseProgram(inverseQuadShader); } if (s == TextureShaders.Hybrid) { GL.UseProgram(evenquadShader); } currentShader = s; }; IO.setBlendFunc = (f) => { if (currentBlendFunc != f) { FlushQuadBuffer(false); } if (f == BlendFunc.Mix) { OpenTK.Graphics.OpenGL4.GL.BlendFuncSeparate(OpenTK.Graphics.OpenGL4.BlendingFactorSrc.SrcAlpha, OpenTK.Graphics.OpenGL4.BlendingFactorDest.OneMinusSrcAlpha, OpenTK.Graphics.OpenGL4.BlendingFactorSrc.One, OpenTK.Graphics.OpenGL4.BlendingFactorDest.One); } if (f == BlendFunc.Add) { OpenTK.Graphics.OpenGL4.GL.BlendFuncSeparate(OpenTK.Graphics.OpenGL4.BlendingFactorSrc.SrcAlpha, OpenTK.Graphics.OpenGL4.BlendingFactorDest.One, OpenTK.Graphics.OpenGL4.BlendingFactorSrc.One, OpenTK.Graphics.OpenGL4.BlendingFactorDest.One); } currentBlendFunc = f; }; IO.getTextSize = (Font f, string t) => { var bb = f.engine.GetBoundBox(t); return(bb.Width / (double)bb.Height / renderSettings.width * renderSettings.height); }; IO.renderText = (double left, double bottom, double height, Color4 color, Font f, string text) => { if (text.Contains("\n")) { throw new Exception("New line characters not allowed when rendering text (yet)"); } FlushQuadBuffer(false); var size = f.engine.GetBoundBox(text); Matrix4 transform = Matrix4.Identity; transform = Matrix4.Mult(transform, Matrix4.CreateScale(1.0f / renderSettings.width * renderSettings.height / f.fontPixelSize * (float)height, -1.0f / f.fontPixelSize * (float)height, 1.0f)); transform = Matrix4.Mult(transform, Matrix4.CreateTranslation((float)left * 2 - 1, (float)(bottom + height * 0.7) * 2 - 1, 0)); f.engine.Render(text, transform, color); if (currentShader == TextureShaders.Normal) { GL.UseProgram(quadShader); } if (currentShader == TextureShaders.Inverted) { GL.UseProgram(inverseQuadShader); } if (currentShader == TextureShaders.Hybrid) { GL.UseProgram(evenquadShader); } }; Initialized = true; Console.WriteLine("Initialised ScriptedRender"); }
/// <summary> /// Decodes a byte[] array into a ParticleSystem Object /// </summary> /// <param name="data">ParticleSystem object</param> /// <param name="pos">Start position for BitPacker</param> public ParticleSystem(byte[] data, int pos) { BlendFuncSource = BlendFunc.SourceAlpha; BlendFuncDest = BlendFunc.OneMinusSourceAlpha; MaxAge = 0.0f; StartAge = 0.0f; InnerAngle = 0.0f; OuterAngle = 0.0f; BurstRate = 0.0f; BurstRadius = 0.0f; BurstSpeedMin = 0.0f; BurstSpeedMax = 0.0f; AngularVelocity = Vector3.Zero; PartAcceleration = Vector3.Zero; Texture = UUID.Zero; Target = UUID.Zero; PartStartColor = ColorAlpha.Black; PartEndColor = ColorAlpha.Black; PartStartScaleX = 0.0f; PartStartScaleY = 0.0f; PartEndScaleX = 0.0f; PartEndScaleY = 0.0f; int size = data.Length - pos; var pack = new BitPacker(data, pos); if (size == LegacyDataBlockSize) { UnpackSystem(pack); UnpackLegacyData(pack); } else if (size > LegacyDataBlockSize && size <= MaxDataBlockSize) { int sysSize = pack.UnpackSignedBits(32); if (sysSize != SysDataSize) { return; // unkown particle system data size } UnpackSystem(pack); /*int dataSize = */ pack.UnpackSignedBits(32); UnpackLegacyData(pack); if ((PartDataFlags & ParticleDataFlags.DataGlow) == ParticleDataFlags.DataGlow) { if (pack.Data.Length - pack.BytePos < 2) { return; } uint glow = pack.UnpackUnsignedBits(8); PartStartGlow = glow / 255f; glow = pack.UnpackUnsignedBits(8); PartEndGlow = glow / 255f; } if ((PartDataFlags & ParticleDataFlags.DataBlend) == ParticleDataFlags.DataBlend) { if (pack.Data.Length - pack.BytePos < 2) { return; } BlendFuncSource = (BlendFunc)pack.UnpackUnsignedBits(8); BlendFuncDest = (BlendFunc)pack.UnpackUnsignedBits(8); } } }
private void CleanupOpenGlBlendMode() { NoBlendFunc = default(BlendFunc); NormalBlendFunc = default(BlendFunc); AdditiveBlendFunc = default(BlendFunc); MultiplicativeBlendFunc = default(BlendFunc); PremultipliedAlphaBlendFunc = default(BlendFunc); }
/// <summary> Sets the alpha and RGB blend functions that are used when blending is enabled. </summary> public abstract void RGBAlphaBlendFunc(BlendFunc srcFuncRGB, BlendFunc dstFuncRGB, BlendFunc srcFuncAlpha, BlendFunc dstFuncAlpha);
public void Init() { quadShader = MakeShader(quadShaderVert, quadShaderFrag); inverseQuadShader = MakeShader(quadShaderVert, invertQuadShaderFrag); evenquadShader = MakeShader(quadShaderVert, evenQuadShaderFrag); int loc; int[] samplers = new int[12]; for (int i = 0; i < 12; i++) { samplers[i] = i; } GL.UseProgram(quadShader); for (int i = 0; i < 12; i++) { loc = GL.GetUniformLocation(quadShader, "textureSampler" + (i + 1)); GL.Uniform1(loc, i); } GL.UseProgram(inverseQuadShader); for (int i = 0; i < 12; i++) { loc = GL.GetUniformLocation(inverseQuadShader, "textureSampler" + (i + 1)); GL.Uniform1(loc, i); } GL.UseProgram(evenquadShader); for (int i = 0; i < 12; i++) { loc = GL.GetUniformLocation(evenquadShader, "textureSampler" + (i + 1)); GL.Uniform1(loc, i); } quadVertexbuff = new double[quadBufferLength * 8]; quadColorbuff = new float[quadBufferLength * 16]; quadUVbuff = new double[quadBufferLength * 8]; quadTexIDbuff = new float[quadBufferLength * 4]; GL.GenBuffers(1, out vertexBufferID); GL.GenBuffers(1, out colorBufferID); GL.GenBuffers(1, out uvBufferID); GL.GenBuffers(1, out texIDBufferID); for (uint i = 0; i < indexes.Length / 6; i++) { indexes[i * 6 + 0] = i * 4 + 0; indexes[i * 6 + 1] = i * 4 + 1; indexes[i * 6 + 2] = i * 4 + 3; indexes[i * 6 + 3] = i * 4 + 1; indexes[i * 6 + 4] = i * 4 + 3; indexes[i * 6 + 5] = i * 4 + 2; } GL.GenBuffers(1, out indexBufferId); GL.BindBuffer(BufferTarget.ElementArrayBuffer, indexBufferId); GL.BufferData( BufferTarget.ElementArrayBuffer, (IntPtr)(indexes.Length * 4), indexes, BufferUsageHint.StaticDraw); if (currScript != null) { try { LoadScript(currScript); } catch { currScript = null; lastScriptChangeTime = 0; } } CheckScript(); IO.renderQuad = RenderQuad; IO.renderShape = RenderShape; IO.forceFlush = () => FlushQuadBuffer(false); IO.selectTexShader = (s) => { if (currentShader != s) { FlushQuadBuffer(false); } if (s == TextureShaders.Normal) { GL.UseProgram(quadShader); } if (s == TextureShaders.Inverted) { GL.UseProgram(inverseQuadShader); } if (s == TextureShaders.Hybrid) { GL.UseProgram(evenquadShader); } currentShader = s; }; IO.setBlendFunc += (f) => { if (currentBlendFunc != f) { FlushQuadBuffer(false); } if (f == BlendFunc.Mix) { OpenTK.Graphics.OpenGL4.GL.BlendFuncSeparate(OpenTK.Graphics.OpenGL4.BlendingFactorSrc.SrcAlpha, OpenTK.Graphics.OpenGL4.BlendingFactorDest.OneMinusSrcAlpha, OpenTK.Graphics.OpenGL4.BlendingFactorSrc.One, OpenTK.Graphics.OpenGL4.BlendingFactorDest.One); } if (f == BlendFunc.Add) { OpenTK.Graphics.OpenGL4.GL.BlendFuncSeparate(OpenTK.Graphics.OpenGL4.BlendingFactorSrc.SrcAlpha, OpenTK.Graphics.OpenGL4.BlendingFactorDest.One, OpenTK.Graphics.OpenGL4.BlendingFactorSrc.One, OpenTK.Graphics.OpenGL4.BlendingFactorDest.One); } currentBlendFunc = f; }; Initialized = true; Console.WriteLine("Initialised ScriptedRender"); }
private void Form1_Load(object sender, EventArgs e) { radioButton1.Checked = true; alphaTick = 0; alphaLabel.Text = "Alpha: " + alphaTick; func = BlendFunc.CPP; blendWindow.Text = "Blend Image"; originalWindow.Text = "Original Image"; finalWindow.Text = "Final Image"; }
private void radioButton3_CheckedChanged(object sender, EventArgs e) { func = BlendFunc.SSE; }
public override void AlphaBlendFunc(BlendFunc srcFunc, BlendFunc dstFunc) { GL.BlendFunc(blendFuncs[(int)srcFunc], blendFuncs[(int)dstFunc]); }
public static Scene MakeMultiTouchScene() { Trail <Vector2>[] touch = new Trail <Vector2> [Input2.Touch.MaxTouch]; Grid[] trail_polys = new Grid[Input2.Touch.MaxTouch]; for (int i = 0; i < touch.Length; ++i) { touch[i] = new Trail <Vector2>(16); } Vector2i grid_size = new Vector2i(20, 24); for (int i = 0; i < trail_polys.Length; ++i) { trail_polys[i] = new Grid(grid_size); } Vector2[] curve_points = new Vector2[grid_size.Y]; Vector2[] circle_points = new Vector2[grid_size.X]; for (int i = 0; i < circle_points.Length; ++i) { circle_points[i] = Vector2.Rotation(Math.TwicePi * (float)i / (float)(circle_points.Length - 1)); } List <Vector2> control_points = new List <Vector2>(); Vector4[] colors = { // Colors.Black, Colors.Red, Colors.Green, Colors.Yellow, Colors.Blue, Colors.Magenta, Colors.Cyan, Colors.White, Colors.Lime, Colors.LightBlue, Colors.Pink, Colors.Orange, Colors.LightCyan, Colors.Purple, }; var scene = new Scene(); { var info = new Label(); info.Camera = UICamera; info.Position = UICamera.CalcBounds().Point00; info.FontMap = UIFontMap; info.HeightScale = UICamera.GetPixelSize(); info.Text = "try touch the screen at multiple points at the same time"; scene.AddChild(info); } scene.OnExitEvents += () => { foreach (Grid grid in trail_polys) { grid.Dispose(); } trail_polys = null; }; scene.AdHocDraw += () => { BlendFunc blend_func = Director.Instance.GL.Context.GetBlendFunc(); DepthFunc depth_func = Director.Instance.GL.Context.GetDepthFunc(); for (int k = 0; k < touch.Length; ++k) { bool down = Input2.Touch.GetData(0)[k].Down; bool press = Input2.Touch.GetData(0)[k].Press; Vector2 p = Director.Instance.CurrentScene.GetTouchPos(k); if (!down) { continue; } // press means a new touch data has just been "created" // -> fill the whole trail to the new position if (press) { touch[k].Fill(p); } touch[k].Add(p); control_points.Clear(); control_points.Add(touch[k].At(0)); for (int i = 0; i < touch[k].Count; ++i) { control_points.Add(touch[k].At(i)); } { Vector4 start_color = colors[k]; Vector4 end_color = Math.SetAlpha(start_color, 0.0f); float start_radius = 2.0f; float end_radius = 1.8f; Grid grid = trail_polys[k]; for (int i = 0; i < curve_points.Length; ++i) { curve_points[i] = Curves.CatmullRom((float)i / (float)(curve_points.Length - 1), control_points, false); } for (int j = 0; j < grid.Size.Y; ++j) { float y = (float)j / (float)(grid.Size.Y - 1); for (int i = 0; i < grid.Size.X; ++i) { grid.TmpVertices[i + j * grid.Size.X] = new DrawHelpers.Vertex((curve_points[j] + circle_points[i] * Math.Lerp(start_radius, end_radius, y)).Xy01 , Math.Lerp(start_color, end_color, y)); } } grid.VertexBuffer.SetVertices(grid.TmpVertices, 0, 0, grid.NumVertices); Director.Instance.GL.SetBlendMode(BlendMode.Normal); Director.Instance.DrawHelpers.ShaderPush(); grid.Draw(); { Director.Instance.DrawHelpers.ImmBegin(DrawMode.TriangleFan, (uint)grid.Size.X); for (int i = 0; i < grid.Size.X; ++i) { Director.Instance.DrawHelpers.ImmVertex(new DrawHelpers.Vertex((curve_points[0] + circle_points[i] * start_radius).Xy01 , start_color)); } Director.Instance.DrawHelpers.ImmEnd(); } Director.Instance.DrawHelpers.ShaderPop(); } } // restore states Director.Instance.GL.Context.Disable(EnableMode.DepthTest); Director.Instance.GL.Context.SetDepthFunc(depth_func); Director.Instance.GL.Context.SetBlendFunc(blend_func); }; return(scene); }
public BlendMode(bool enabled, BlendFunc blend_func) { this.Enabled = enabled; this.BlendFunc = blend_func; }
public BlendMode( bool enabled, BlendFunc blend_func ) { Enabled = enabled; BlendFunc = blend_func; }
public void RenderFrame(FastList <Note> notes, double midiTime, int finalCompositeBuff) { CheckScript(); if (currScript == null || currScript.error) { return; } GL.Enable(EnableCap.Blend); GL.EnableClientState(ArrayCap.VertexArray); GL.EnableClientState(ArrayCap.ColorArray); GL.Enable(EnableCap.Texture2D); GL.EnableVertexAttribArray(0); GL.EnableVertexAttribArray(1); GL.EnableVertexAttribArray(2); GL.EnableVertexAttribArray(3); GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha); GL.BlendEquationSeparate(BlendEquationMode.FuncAdd, BlendEquationMode.Max); OpenTK.Graphics.OpenGL4.GL.BlendEquationSeparate(OpenTK.Graphics.OpenGL4.BlendEquationMode.FuncAdd, OpenTK.Graphics.OpenGL4.BlendEquationMode.FuncAdd); OpenTK.Graphics.OpenGL4.GL.BlendFuncSeparate(OpenTK.Graphics.OpenGL4.BlendingFactorSrc.SrcAlpha, OpenTK.Graphics.OpenGL4.BlendingFactorDest.OneMinusSrcAlpha, OpenTK.Graphics.OpenGL4.BlendingFactorSrc.One, OpenTK.Graphics.OpenGL4.BlendingFactorDest.One); GL.BindFramebuffer(FramebufferTarget.Framebuffer, finalCompositeBuff); GL.Viewport(0, 0, renderSettings.width, renderSettings.height); GL.Clear(ClearBufferMask.ColorBufferBit); #region Vars for (int i = 0; i < 12; i++) { activeTexIds[i] = -1; } currentShader = TextureShaders.Normal; currentBlendFunc = BlendFunc.Mix; #endregion GL.UseProgram(quadShader); currentShader = TextureShaders.Normal; var options = GetRenderOptions(midiTime); CopyScriptValues(); currScript.instance.Render((IEnumerable <Note>)notes, options); CopyScriptValues(); FlushQuadBuffer(false); OpenTK.Graphics.OpenGL4.GL.BlendEquationSeparate(OpenTK.Graphics.OpenGL4.BlendEquationMode.FuncAdd, OpenTK.Graphics.OpenGL4.BlendEquationMode.FuncAdd); GL.ActiveTexture(TextureUnit.Texture0); GL.Disable(EnableCap.Blend); GL.DisableClientState(ArrayCap.VertexArray); GL.DisableClientState(ArrayCap.ColorArray); GL.Disable(EnableCap.Texture2D); GL.DisableVertexAttribArray(0); GL.DisableVertexAttribArray(1); GL.DisableVertexAttribArray(2); GL.DisableVertexAttribArray(3); }
public override void AlphaBlendFunc(BlendFunc srcFunc, BlendFunc destFunc) { }