T2D and the OpenGL Blending Model
by Smaug · 04/17/2005 (7:35 pm) · 2 comments
OpenGL blending is both pretty simple and rather complicated. T2D adds some complexity to this, though it is effectively just passing through the commands to OpenGL.
Everything in T2D is rendered as textured triangles. When GL is rendering a triangle/line/etc, it converts the object into a bunch of things called "fragments". An OpenGL fragment is the set of state information that, when combined, computes the source pixel color.
So, what is this state? Well, in the case of a single-textured triangle, it is the texel color (filtered with bilinear filtering) at the pixel being rendered into. However, it is also the interpolated per-fragment color passed in by the user when they rendered a triangle. These two colors are combined via a simple operation to produce the source pixel color.
T2D has this thing called the "BlendColor". A bit of a misnomer, as it has nothing to do with blending directly. Instead, it is the per-fragment color I spoke of earlier. T2D passes in a single color value for the entire triangle, so each point along the triangle has the same per-fragment interpolated color. The so-called "BlendColor".
The default operation that T2D does between the "BlendColor" and the texel color is multiply. That is, a 4-component multiply operation. Now, colors (at this stage in the pipe) are numbers between 0.0 and 1.0. Multiplication is standard floating-point multiplication (though hardware doesn
Everything in T2D is rendered as textured triangles. When GL is rendering a triangle/line/etc, it converts the object into a bunch of things called "fragments". An OpenGL fragment is the set of state information that, when combined, computes the source pixel color.
So, what is this state? Well, in the case of a single-textured triangle, it is the texel color (filtered with bilinear filtering) at the pixel being rendered into. However, it is also the interpolated per-fragment color passed in by the user when they rendered a triangle. These two colors are combined via a simple operation to produce the source pixel color.
T2D has this thing called the "BlendColor". A bit of a misnomer, as it has nothing to do with blending directly. Instead, it is the per-fragment color I spoke of earlier. T2D passes in a single color value for the entire triangle, so each point along the triangle has the same per-fragment interpolated color. The so-called "BlendColor".
The default operation that T2D does between the "BlendColor" and the texel color is multiply. That is, a 4-component multiply operation. Now, colors (at this stage in the pipe) are numbers between 0.0 and 1.0. Multiplication is standard floating-point multiplication (though hardware doesn
Torque Owner Josh Williams
Default Studio Name