1
0

burning v0.53

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6364 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
engineer_apple
2022-04-30 22:57:17 +00:00
parent 2d5673a1d4
commit 4fe6a16165
113 changed files with 4567 additions and 2853 deletions

View File

@@ -75,12 +75,7 @@
#endif
namespace irr
{
namespace video
{
burning_namespace_start
class CTRTextureGouraudAlphaNoZ : public IBurningShader
{
@@ -98,7 +93,7 @@ private:
// fragment shader
typedef void (CTRTextureGouraudAlphaNoZ::*tFragmentShader) ();
void fragment_linear();
void fragment_linear_test();
void fragment_linear_alpharef();
void fragment_point_noz();
tFragmentShader fragmentShader;
@@ -125,13 +120,13 @@ void CTRTextureGouraudAlphaNoZ::OnSetMaterial(const SBurningShaderMaterial& mate
#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff
AlphaRef = core::floor32(material.org.MaterialTypeParam * 256.f);
#else
AlphaRef = tofix(material.org.MaterialTypeParam, FIXPOINT_COLOR_MAX);
AlphaRef = tofix(material.org.MaterialTypeParam, FIX_POINT_COLOR_MAX);
#endif
//check triangle on w = 1.f instead..
#ifdef SOFTWARE_DRIVER_2_BILINEAR
if (material.Fallback_MaterialType == EMT_TRANSPARENT_ALPHA_CHANNEL_REF)
fragmentShader = &CTRTextureGouraudAlphaNoZ::fragment_linear_test;
fragmentShader = &CTRTextureGouraudAlphaNoZ::fragment_linear_alpharef;
else
if ( material.org.TextureLayer[0].BilinearFilter )
fragmentShader = &CTRTextureGouraudAlphaNoZ::fragment_linear;
@@ -262,7 +257,7 @@ void CTRTextureGouraudAlphaNoZ::fragment_linear()
#ifdef CMP_W
if ( line.w[0] >= z[i] )
#endif
scissor_test_x
if_scissor_test_x
{
#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff
@@ -326,7 +321,7 @@ void CTRTextureGouraudAlphaNoZ::fragment_linear()
r2 = r1 + imulFix ( a0, r0 - r1 );
g2 = g1 + imulFix ( a0, g0 - g1 );
b2 = b1 + imulFix ( a0, b0 - b1 );
dst[i] = fix4_to_sample( a0, r2, g2, b2 );
dst[i] = fix_to_sample( r2, g2, b2 );
#else
dst[i] = PixelBlend32 ( dst[i],
@@ -364,7 +359,7 @@ void CTRTextureGouraudAlphaNoZ::fragment_linear()
/*!
*/
void CTRTextureGouraudAlphaNoZ::fragment_linear_test()
void CTRTextureGouraudAlphaNoZ::fragment_linear_alpharef()
{
tVideoSample *dst;
@@ -482,7 +477,7 @@ void CTRTextureGouraudAlphaNoZ::fragment_linear_test()
#ifdef CMP_W
if (line.w[0] >= z[i])
#endif
scissor_test_x
if_scissor_test_x
{
#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff
@@ -546,7 +541,7 @@ void CTRTextureGouraudAlphaNoZ::fragment_linear_test()
r2 = r1 + imulFix(a0, r0 - r1);
g2 = g1 + imulFix(a0, g0 - g1);
b2 = b1 + imulFix(a0, b0 - b1);
dst[i] = fix4_to_sample(a0, r2, g2, b2);
dst[i] = fix_to_sample(r2, g2, b2);
#else
dst[i] = PixelBlend32(dst[i],
@@ -702,7 +697,7 @@ void CTRTextureGouraudAlphaNoZ::fragment_point_noz()
#ifdef CMP_W
// if (line.w[0] >= z[i])
#endif
scissor_test_x
if_scissor_test_x
{
#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff
@@ -766,7 +761,7 @@ void CTRTextureGouraudAlphaNoZ::fragment_point_noz()
r2 = r1 + imulFix(a0, r0 - r1);
g2 = g1 + imulFix(a0, g0 - g1);
b2 = b1 + imulFix(a0, b0 - b1);
dst[i] = fix4_to_sample(a0, r2, g2, b2);
dst[i] = fix_to_sample(r2, g2, b2);
#else
dst[i] = PixelBlend32(dst[i],
@@ -911,8 +906,8 @@ void CTRTextureGouraudAlphaNoZ::drawTriangle(const s4DVertex* burning_restrict a
#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;
@@ -990,8 +985,8 @@ void CTRTextureGouraudAlphaNoZ::drawTriangle(const s4DVertex* burning_restrict a
#endif
// render a scanline
interlace_scanline
scissor_test_y
if_interlace_scanline
if_scissor_test_y
(this->*fragmentShader) ();
scan.x[0] += scan.slopeX[0];
@@ -1096,8 +1091,8 @@ void CTRTextureGouraudAlphaNoZ::drawTriangle(const s4DVertex* burning_restrict a
#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
subPixel = ( (f32) yStart ) - b->Pos.y;
@@ -1175,8 +1170,8 @@ void CTRTextureGouraudAlphaNoZ::drawTriangle(const s4DVertex* burning_restrict a
#endif
// render a scanline
interlace_scanline
scissor_test_y
if_interlace_scanline
if_scissor_test_y
(this->*fragmentShader) ();
scan.x[0] += scan.slopeX[0];
@@ -1219,16 +1214,11 @@ void CTRTextureGouraudAlphaNoZ::drawTriangle(const s4DVertex* burning_restrict a
}
} // end namespace video
} // end namespace irr
burning_namespace_end
#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_
namespace irr
{
namespace video
{
burning_namespace_start
//! creates a flat triangle renderer
IBurningShader* createTRTextureGouraudAlphaNoZ(CBurningVideoDriver* driver)
@@ -1241,9 +1231,6 @@ IBurningShader* createTRTextureGouraudAlphaNoZ(CBurningVideoDriver* driver)
#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_
}
} // end namespace video
} // end namespace irr
burning_namespace_end