Merging r6364 through r6379 from trunk to ogl-es branch
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6380 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@@ -93,7 +93,7 @@ private:
|
||||
|
||||
//! constructor
|
||||
CTRTextureGouraudAdd2::CTRTextureGouraudAdd2(CBurningVideoDriver* driver)
|
||||
: IBurningShader(driver)
|
||||
: IBurningShader(driver, EMT_TRANSPARENT_ADD_COLOR)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CTRTextureGouraudAdd2");
|
||||
@@ -128,7 +128,7 @@ void CTRTextureGouraudAdd2::fragmentShader()
|
||||
fp24 slopeW;
|
||||
#endif
|
||||
#ifdef IPOL_C0
|
||||
sVec4 slopeC;
|
||||
sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS];
|
||||
#endif
|
||||
#ifdef IPOL_T0
|
||||
sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES];
|
||||
@@ -153,7 +153,7 @@ void CTRTextureGouraudAdd2::fragmentShader()
|
||||
slopeW = (line.w[1] - line.w[0]) * invDeltaX;
|
||||
#endif
|
||||
#ifdef IPOL_C0
|
||||
slopeC = (line.c[1] - line.c[0]) * invDeltaX;
|
||||
slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX;
|
||||
#endif
|
||||
#ifdef IPOL_T0
|
||||
slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX;
|
||||
@@ -171,7 +171,7 @@ void CTRTextureGouraudAdd2::fragmentShader()
|
||||
line.w[0] += slopeW * subPixel;
|
||||
#endif
|
||||
#ifdef IPOL_C0
|
||||
line.c[0] += slopeC * subPixel;
|
||||
line.c[0][0] += slopeC[0] * subPixel;
|
||||
#endif
|
||||
#ifdef IPOL_T0
|
||||
line.t[0][0] += slopeT[0] * subPixel;
|
||||
@@ -257,7 +257,7 @@ void CTRTextureGouraudAdd2::fragmentShader()
|
||||
line.w[0] += slopeW;
|
||||
#endif
|
||||
#ifdef IPOL_C0
|
||||
line.c[0] += slopeC;
|
||||
line.c[0][0] += slopeC[0];
|
||||
#endif
|
||||
#ifdef IPOL_T0
|
||||
line.t[0][0] += slopeT[0];
|
||||
@@ -292,7 +292,7 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
temp[2] = b->Pos.x - a->Pos.x;
|
||||
temp[3] = ba;
|
||||
|
||||
scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1;
|
||||
scan.left = (temp[0] * temp[3] - temp[1] * temp[2]) < 0.f ? 1 : 0;
|
||||
scan.right = 1 - scan.left;
|
||||
|
||||
// calculate slopes for the major edge
|
||||
@@ -310,8 +310,8 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_C0
|
||||
scan.slopeC[0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0];
|
||||
scan.c[0] = a->Color[0];
|
||||
scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0];
|
||||
scan.c[0][0] = a->Color[0];
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_T0
|
||||
@@ -350,8 +350,8 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_C0
|
||||
scan.slopeC[1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1];
|
||||
scan.c[1] = a->Color[0];
|
||||
scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1];
|
||||
scan.c[0][1] = a->Color[0];
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_T0
|
||||
@@ -365,8 +365,8 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
// apply top-left fill convention, top part
|
||||
yStart = fill_convention_left( a->Pos.y );
|
||||
yEnd = fill_convention_right( b->Pos.y );
|
||||
yStart = fill_convention_top( a->Pos.y );
|
||||
yEnd = fill_convention_down( b->Pos.y );
|
||||
|
||||
#ifdef SUBTEXEL
|
||||
subPixel = ( (f32) yStart ) - a->Pos.y;
|
||||
@@ -386,8 +386,8 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_C0
|
||||
scan.c[0] += scan.slopeC[0] * subPixel;
|
||||
scan.c[1] += scan.slopeC[1] * subPixel;
|
||||
scan.c[0][0] += scan.slopeC[0][0] * subPixel;
|
||||
scan.c[0][1] += scan.slopeC[0][1] * subPixel;
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_T0
|
||||
@@ -419,8 +419,8 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_C0
|
||||
line.c[scan.left] = scan.c[0];
|
||||
line.c[scan.right] = scan.c[1];
|
||||
line.c[0][scan.left] = scan.c[0][0];
|
||||
line.c[0][scan.right] = scan.c[0][1];
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_T0
|
||||
@@ -434,7 +434,7 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
// render a scanline
|
||||
interlace_scanline fragmentShader();
|
||||
if_interlace_scanline fragmentShader();
|
||||
|
||||
scan.x[0] += scan.slopeX[0];
|
||||
scan.x[1] += scan.slopeX[1];
|
||||
@@ -450,8 +450,8 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_C0
|
||||
scan.c[0] += scan.slopeC[0];
|
||||
scan.c[1] += scan.slopeC[1];
|
||||
scan.c[0][0] += scan.slopeC[0][0];
|
||||
scan.c[0][1] += scan.slopeC[0][1];
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_T0
|
||||
@@ -483,7 +483,7 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0];
|
||||
#endif
|
||||
#ifdef IPOL_C0
|
||||
scan.c[0] = a->Color[0] + scan.slopeC[0] * temp[0];
|
||||
scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0];
|
||||
#endif
|
||||
#ifdef IPOL_T0
|
||||
scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0];
|
||||
@@ -509,8 +509,8 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_C0
|
||||
scan.slopeC[1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2];
|
||||
scan.c[1] = b->Color[0];
|
||||
scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2];
|
||||
scan.c[0][1] = b->Color[0];
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_T0
|
||||
@@ -524,8 +524,8 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
// apply top-left fill convention, top part
|
||||
yStart = fill_convention_left( b->Pos.y );
|
||||
yEnd = fill_convention_right( c->Pos.y );
|
||||
yStart = fill_convention_top( b->Pos.y );
|
||||
yEnd = fill_convention_down( c->Pos.y );
|
||||
|
||||
#ifdef SUBTEXEL
|
||||
|
||||
@@ -546,8 +546,8 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_C0
|
||||
scan.c[0] += scan.slopeC[0] * subPixel;
|
||||
scan.c[1] += scan.slopeC[1] * subPixel;
|
||||
scan.c[0][0] += scan.slopeC[0][0] * subPixel;
|
||||
scan.c[0][1] += scan.slopeC[0][1] * subPixel;
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_T0
|
||||
@@ -579,8 +579,8 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_C0
|
||||
line.c[scan.left] = scan.c[0];
|
||||
line.c[scan.right] = scan.c[1];
|
||||
line.c[0][scan.left] = scan.c[0][0];
|
||||
line.c[0][scan.right] = scan.c[0][1];
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_T0
|
||||
@@ -594,7 +594,7 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
// render a scanline
|
||||
interlace_scanline fragmentShader();
|
||||
if_interlace_scanline fragmentShader();
|
||||
|
||||
scan.x[0] += scan.slopeX[0];
|
||||
scan.x[1] += scan.slopeX[1];
|
||||
@@ -610,8 +610,8 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_C0
|
||||
scan.c[0] += scan.slopeC[0];
|
||||
scan.c[1] += scan.slopeC[1];
|
||||
scan.c[0][0] += scan.slopeC[0][0];
|
||||
scan.c[0][1] += scan.slopeC[0][1];
|
||||
#endif
|
||||
|
||||
#ifdef IPOL_T0
|
||||
|
Reference in New Issue
Block a user