Burningsvideo 0.52
- scissor for 2D - downscaled internal rendertargets,interlaced drawing - supertuxkart gui ok git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6154 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@@ -87,22 +87,6 @@ namespace video
|
||||
virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_;
|
||||
virtual void OnSetMaterial(const SBurningShaderMaterial& material) _IRR_OVERRIDE_;
|
||||
|
||||
#if defined(PATCH_SUPERTUX_8_0_1)
|
||||
|
||||
virtual void setZCompareFunc(u32 func)
|
||||
{
|
||||
depth_func = (E_COMPARISON_FUNC)func;
|
||||
}
|
||||
virtual void setParam(u32 index, f32 value)
|
||||
{
|
||||
SBurningShaderMaterial material;
|
||||
material.org.ZBuffer = depth_func;
|
||||
material.org.MaterialTypeParam = value;
|
||||
OnSetMaterial(material);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
private:
|
||||
// fragment shader
|
||||
typedef void (CTRTextureBlend::*tFragmentShader) ();
|
||||
@@ -269,7 +253,7 @@ void CTRTextureBlend::fragment_dst_color_src_alpha ()
|
||||
return;
|
||||
|
||||
// slopes
|
||||
const f32 invDeltaX = reciprocal_zero2( line.x[1] - line.x[0] );
|
||||
const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] );
|
||||
|
||||
#ifdef IPOL_Z
|
||||
slopeZ = (line.z[1] - line.z[0]) * invDeltaX;
|
||||
@@ -325,7 +309,7 @@ void CTRTextureBlend::fragment_dst_color_src_alpha ()
|
||||
{
|
||||
default:
|
||||
case ECFN_LESSEQUAL:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] >= z[i] )
|
||||
@@ -368,7 +352,7 @@ void CTRTextureBlend::fragment_dst_color_src_alpha ()
|
||||
break;
|
||||
|
||||
case 2:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] == z[i] )
|
||||
@@ -454,7 +438,7 @@ void CTRTextureBlend::fragment_src_color_src_alpha ()
|
||||
return;
|
||||
|
||||
// slopes
|
||||
const f32 invDeltaX = reciprocal_zero2( line.x[1] - line.x[0] );
|
||||
const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] );
|
||||
|
||||
#ifdef IPOL_Z
|
||||
slopeZ = (line.z[1] - line.z[0]) * invDeltaX;
|
||||
@@ -514,7 +498,7 @@ void CTRTextureBlend::fragment_src_color_src_alpha ()
|
||||
{
|
||||
default:
|
||||
case ECFN_LESSEQUAL:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] >= z[i] )
|
||||
@@ -561,7 +545,7 @@ void CTRTextureBlend::fragment_src_color_src_alpha ()
|
||||
break;
|
||||
|
||||
case 2:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] == z[i] )
|
||||
@@ -649,7 +633,7 @@ void CTRTextureBlend::fragment_one_one_minus_src_alpha()
|
||||
return;
|
||||
|
||||
// slopes
|
||||
const f32 invDeltaX = reciprocal_zero2 ( line.x[1] - line.x[0] );
|
||||
const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] );
|
||||
|
||||
#ifdef IPOL_Z
|
||||
slopeZ = (line.z[1] - line.z[0]) * invDeltaX;
|
||||
@@ -707,7 +691,7 @@ void CTRTextureBlend::fragment_one_one_minus_src_alpha()
|
||||
{
|
||||
default:
|
||||
case ECFN_LESSEQUAL:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] >= z[i] )
|
||||
@@ -757,7 +741,7 @@ void CTRTextureBlend::fragment_one_one_minus_src_alpha()
|
||||
break;
|
||||
|
||||
case 2:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] == z[i] )
|
||||
@@ -850,7 +834,7 @@ void CTRTextureBlend::fragment_one_minus_dst_alpha_one ()
|
||||
return;
|
||||
|
||||
// slopes
|
||||
const f32 invDeltaX = reciprocal_zero2( line.x[1] - line.x[0] );
|
||||
const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] );
|
||||
|
||||
#ifdef IPOL_Z
|
||||
slopeZ = (line.z[1] - line.z[0]) * invDeltaX;
|
||||
@@ -908,7 +892,7 @@ void CTRTextureBlend::fragment_one_minus_dst_alpha_one ()
|
||||
{
|
||||
default:
|
||||
case ECFN_LESSEQUAL:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] >= z[i] )
|
||||
@@ -957,7 +941,7 @@ void CTRTextureBlend::fragment_one_minus_dst_alpha_one ()
|
||||
break;
|
||||
|
||||
case 2:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] == z[i] )
|
||||
@@ -1050,7 +1034,7 @@ void CTRTextureBlend::fragment_src_alpha_one ()
|
||||
return;
|
||||
|
||||
// slopes
|
||||
const f32 invDeltaX = reciprocal_zero2( line.x[1] - line.x[0] );
|
||||
const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] );
|
||||
|
||||
#ifdef IPOL_Z
|
||||
slopeZ = (line.z[1] - line.z[0]) * invDeltaX;
|
||||
@@ -1108,7 +1092,7 @@ void CTRTextureBlend::fragment_src_alpha_one ()
|
||||
{
|
||||
default:
|
||||
case ECFN_LESSEQUAL:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] >= z[i] )
|
||||
@@ -1174,7 +1158,7 @@ void CTRTextureBlend::fragment_src_alpha_one ()
|
||||
break;
|
||||
|
||||
case 2:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] == z[i] )
|
||||
@@ -1280,7 +1264,7 @@ void CTRTextureBlend::fragment_src_alpha_one_minus_src_alpha()
|
||||
return;
|
||||
|
||||
// slopes
|
||||
const f32 invDeltaX = reciprocal_zero2(line.x[1] - line.x[0]);
|
||||
const f32 invDeltaX = fill_step_x(line.x[1] - line.x[0]);
|
||||
|
||||
#ifdef IPOL_Z
|
||||
slopeZ = (line.z[1] - line.z[0]) * invDeltaX;
|
||||
@@ -1337,7 +1321,7 @@ void CTRTextureBlend::fragment_src_alpha_one_minus_src_alpha()
|
||||
{
|
||||
default:
|
||||
case ECFN_LESSEQUAL:
|
||||
for (i = 0; i <= dx; ++i)
|
||||
for (i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if (line.w[0] >= z[i])
|
||||
@@ -1434,7 +1418,7 @@ void CTRTextureBlend::fragment_dst_color_one_minus_dst_alpha ()
|
||||
return;
|
||||
|
||||
// slopes
|
||||
const f32 invDeltaX = reciprocal_zero2( line.x[1] - line.x[0] );
|
||||
const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] );
|
||||
|
||||
#ifdef IPOL_Z
|
||||
slopeZ = (line.z[1] - line.z[0]) * invDeltaX;
|
||||
@@ -1492,7 +1476,7 @@ void CTRTextureBlend::fragment_dst_color_one_minus_dst_alpha ()
|
||||
{
|
||||
default:
|
||||
case ECFN_LESSEQUAL:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] >= z[i] )
|
||||
@@ -1541,7 +1525,7 @@ void CTRTextureBlend::fragment_dst_color_one_minus_dst_alpha ()
|
||||
break;
|
||||
|
||||
case 2:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] == z[i] )
|
||||
@@ -1633,7 +1617,7 @@ void CTRTextureBlend::fragment_dst_color_zero ()
|
||||
return;
|
||||
|
||||
// slopes
|
||||
const f32 invDeltaX = reciprocal_zero2( line.x[1] - line.x[0] );
|
||||
const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] );
|
||||
|
||||
#ifdef IPOL_Z
|
||||
slopeZ = (line.z[1] - line.z[0]) * invDeltaX;
|
||||
@@ -1691,7 +1675,7 @@ void CTRTextureBlend::fragment_dst_color_zero ()
|
||||
{
|
||||
default:
|
||||
case ECFN_LESSEQUAL:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] >= z[i] )
|
||||
@@ -1739,7 +1723,7 @@ void CTRTextureBlend::fragment_dst_color_zero ()
|
||||
break;
|
||||
|
||||
case 2:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] == z[i] )
|
||||
@@ -1830,7 +1814,7 @@ void CTRTextureBlend::fragment_dst_color_one ()
|
||||
return;
|
||||
|
||||
// slopes
|
||||
const f32 invDeltaX = reciprocal_zero2( line.x[1] - line.x[0] );
|
||||
const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] );
|
||||
|
||||
#ifdef IPOL_Z
|
||||
slopeZ = (line.z[1] - line.z[0]) * invDeltaX;
|
||||
@@ -1888,7 +1872,7 @@ void CTRTextureBlend::fragment_dst_color_one ()
|
||||
{
|
||||
default:
|
||||
case ECFN_LESSEQUAL:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] >= z[i] )
|
||||
@@ -1937,7 +1921,7 @@ void CTRTextureBlend::fragment_dst_color_one ()
|
||||
break;
|
||||
|
||||
case 2:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] == z[i] )
|
||||
@@ -2030,7 +2014,7 @@ void CTRTextureBlend::fragment_zero_one_minus_scr_color ()
|
||||
return;
|
||||
|
||||
// slopes
|
||||
const f32 invDeltaX = reciprocal_zero2( line.x[1] - line.x[0] );
|
||||
const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] );
|
||||
|
||||
#ifdef IPOL_Z
|
||||
slopeZ = (line.z[1] - line.z[0]) * invDeltaX;
|
||||
@@ -2088,7 +2072,7 @@ void CTRTextureBlend::fragment_zero_one_minus_scr_color ()
|
||||
{
|
||||
default:
|
||||
case ECFN_LESSEQUAL:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] >= z[i] )
|
||||
@@ -2137,7 +2121,7 @@ void CTRTextureBlend::fragment_zero_one_minus_scr_color ()
|
||||
break;
|
||||
|
||||
case 2:
|
||||
for ( i = 0; i <= dx; ++i )
|
||||
for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)
|
||||
{
|
||||
#ifdef CMP_W
|
||||
if ( line.w[0] == z[i] )
|
||||
@@ -2202,9 +2186,9 @@ void CTRTextureBlend::drawTriangle(const s4DVertex* burning_restrict a, const s4
|
||||
const f32 ba = b->Pos.y - a->Pos.y;
|
||||
const f32 cb = c->Pos.y - b->Pos.y;
|
||||
// calculate delta y of the edges
|
||||
scan.invDeltaY[0] = reciprocal_zero( ca );
|
||||
scan.invDeltaY[1] = reciprocal_zero( ba );
|
||||
scan.invDeltaY[2] = reciprocal_zero( cb );
|
||||
scan.invDeltaY[0] = fill_step_y( ca );
|
||||
scan.invDeltaY[1] = fill_step_y( ba );
|
||||
scan.invDeltaY[2] = fill_step_y( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
@@ -2328,7 +2312,7 @@ void CTRTextureBlend::drawTriangle(const s4DVertex* burning_restrict a, const s4
|
||||
#endif
|
||||
|
||||
// rasterize the edge scanlines
|
||||
for( line.y = yStart; line.y <= yEnd; ++line.y)
|
||||
for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y)
|
||||
{
|
||||
line.x[scan.left] = scan.x[0];
|
||||
line.x[scan.right] = scan.x[1];
|
||||
@@ -2359,7 +2343,7 @@ void CTRTextureBlend::drawTriangle(const s4DVertex* burning_restrict a, const s4
|
||||
#endif
|
||||
|
||||
// render a scanline
|
||||
(this->*fragmentShader) ();
|
||||
interlace_scanline (this->*fragmentShader) ();
|
||||
|
||||
scan.x[0] += scan.slopeX[0];
|
||||
scan.x[1] += scan.slopeX[1];
|
||||
@@ -2453,7 +2437,6 @@ void CTRTextureBlend::drawTriangle(const s4DVertex* burning_restrict a, const s4
|
||||
yEnd = fill_convention_right( c->Pos.y );
|
||||
|
||||
#ifdef SUBTEXEL
|
||||
|
||||
subPixel = ( (f32) yStart ) - b->Pos.y;
|
||||
|
||||
// correct to pixel center
|
||||
@@ -2488,7 +2471,7 @@ void CTRTextureBlend::drawTriangle(const s4DVertex* burning_restrict a, const s4
|
||||
#endif
|
||||
|
||||
// rasterize the edge scanlines
|
||||
for( line.y = yStart; line.y <= yEnd; ++line.y)
|
||||
for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y)
|
||||
{
|
||||
line.x[scan.left] = scan.x[0];
|
||||
line.x[scan.right] = scan.x[1];
|
||||
@@ -2519,7 +2502,7 @@ void CTRTextureBlend::drawTriangle(const s4DVertex* burning_restrict a, const s4
|
||||
#endif
|
||||
|
||||
// render a scanline
|
||||
(this->*fragmentShader) ();
|
||||
interlace_scanline (this->*fragmentShader) ();
|
||||
|
||||
scan.x[0] += scan.slopeX[0];
|
||||
scan.x[1] += scan.slopeX[1];
|
||||
|
Reference in New Issue
Block a user