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:
engineer_apple
2020-11-10 18:49:39 +00:00
parent 6805226b5b
commit 5cb28ea357
59 changed files with 2115 additions and 1848 deletions

View File

@ -698,7 +698,7 @@ REALINLINE void CBurningShader_Raster_Reference::scanline2()
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] );
const f32 subPixel = ( (f32) pShader.xStart ) - line.x[0];
// store slopes in endpoint, and correct first pixel
@ -722,8 +722,8 @@ REALINLINE void CBurningShader_Raster_Reference::scanline2()
}
SOFTWARE_DRIVER_2_CLIPCHECK_REF;
pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) );
pShader.z = (fp24*) ( (u8*) DepthBuffer->lock() + ( line.y * DepthBuffer->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) );
pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) );
pShader.z = (fp24*) ( (u8*) DepthBuffer->lock() + ( line.y * DepthBuffer->getPitch() ) + ( pShader.xStart << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) );
for ( pShader.i = 0; pShader.i <= pShader.dx; ++pShader.i )
{
@ -764,10 +764,10 @@ REALINLINE void CBurningShader_Raster_Reference::scanline ()
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] );
// search z-buffer for first not occulled pixel
pShader.z = (fp24*) ( (u8*) DepthBuffer->lock() + ( line.y * DepthBuffer->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) );
pShader.z = (fp24*) ( (u8*) DepthBuffer->lock() + ( line.y * DepthBuffer->getPitch() ) + ( pShader.xStart << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) );
// subTexel
const f32 subPixel = ( (f32) pShader.xStart ) - line.x[0];
@ -807,7 +807,7 @@ REALINLINE void CBurningShader_Raster_Reference::scanline ()
line.w[0] = a;
line.w[1] = b;
pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) );
pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) );
a = (f32) pShader.i + subPixel;
@ -863,9 +863,9 @@ void CBurningShader_Raster_Reference::drawTriangle(const s4DVertex* burning_rest
// calculate delta y of the edges
scan.invDeltaY[0] = reciprocal_zero2( c->Pos.y - a->Pos.y );
scan.invDeltaY[1] = reciprocal_zero2( b->Pos.y - a->Pos.y );
scan.invDeltaY[2] = reciprocal_zero2( c->Pos.y - b->Pos.y );
scan.invDeltaY[0] = fill_step_y( c->Pos.y - a->Pos.y );
scan.invDeltaY[1] = fill_step_y( b->Pos.y - a->Pos.y );
scan.invDeltaY[2] = fill_step_y( c->Pos.y - b->Pos.y );
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
return;
@ -959,7 +959,7 @@ void CBurningShader_Raster_Reference::drawTriangle(const s4DVertex* burning_rest
}
// 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.w[scan.left] = scan.w[0];
@ -1076,7 +1076,7 @@ void CBurningShader_Raster_Reference::drawTriangle(const s4DVertex* burning_rest
}
// 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.w[scan.left] = scan.w[0];