Overview of Glsl How To Properly Blend Colors Across Two Triangles And Remove

Given the same four colors and the same size rectangle, is there a way to render this so the edge between the two triangles isn't so apparent? Maybe more vertices, or a different blending function? I'm not sure exactly what the colors should be at each pixel; I just want to know how to get rid of the diagonal smear.

I'm drawing two triangles : the bottom left, and the top right. I think I would get similar results using OpenGL instead of WebGL. Given the same four colors and the same size rectangle, is there a way to render this so the edge between the two triangles isn't so apparent? Maybe more vertices, or a different blending function?
Key Details About Glsl How To Properly Blend Colors Across Two Triangles And Remove

The four vertices were assigned red, green, blue and white colours as vertex attributes and the fragment shader had those colours interpolated across the triangles as expected. This leads to the ugly visual artefact on the diagonal where the two triangles meet.
As I understand it, the interpolation will only be happening across each triangle , and so where the two triangles meet the interpolation doesn't cross the boundary. How could you, generally in any rendering api, have the colours smoothly interpolated over all four corners for a nice colour wheel affect without having this hard line?

Color Mixing
Learn to use the mix function for color blending and understand the concept and application of linear interpolation. To blend between two colors you don't need to do the math yourself — GLSL has mix.
The demo shows all blend modes switchable via a drop down. For this, there is an additional 'all' glsl function that can be required to import all blend mode functions at once and specify which one to use via an integer.

Blend Mode Reference
This page is a complete reference for all 25 blend modes implemented in glsl - blend . For each mode it records the integer constant, require path, exported GLSL function name, the corresponding modes.js key, the per-channel formula, and a brief description of the visual effect.
The demo shows all blend modes switchable via a drop down. For this, there is an additional 'all' glsl function that can be required to import all blend mode functions at once and specify which one to use via an integer.

Key Details About Glsl How To Properly Blend Colors Across Two Triangles And Remove
Blending Advanced-OpenGL/Blending Blending in OpenGL is commonly known as the technique to implement transparency within objects. Transparency is all about objects (or parts of them) not having a solid color , but having a combination of colors from the object itself and any other object behind it with varying intensity. A colored glass window is a transparent object; the glass has a color of ...







