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:
@@ -75,12 +75,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace video
|
||||
{
|
||||
burning_namespace_start
|
||||
|
||||
class CTRTextureGouraudAlphaNoZ : public IBurningShader
|
||||
{
|
||||
@@ -91,14 +86,14 @@ public:
|
||||
|
||||
//! draws an indexed triangle list
|
||||
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;
|
||||
virtual void OnSetMaterialBurning(const SBurningShaderMaterial& material) IRR_OVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
// fragment shader
|
||||
typedef void (CTRTextureGouraudAlphaNoZ::*tFragmentShader) ();
|
||||
void fragment_linear();
|
||||
void fragment_linear_test();
|
||||
void fragment_linear_alpharef();
|
||||
void fragment_point_noz();
|
||||
|
||||
tFragmentShader fragmentShader;
|
||||
@@ -108,7 +103,7 @@ private:
|
||||
|
||||
//! constructor
|
||||
CTRTextureGouraudAlphaNoZ::CTRTextureGouraudAlphaNoZ(CBurningVideoDriver* driver)
|
||||
: IBurningShader(driver)
|
||||
: IBurningShader(driver, EMT_TRANSPARENT_ALPHA_CHANNEL)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CTRTextureGouraudAlphaNoZ");
|
||||
@@ -120,18 +115,18 @@ CTRTextureGouraudAlphaNoZ::CTRTextureGouraudAlphaNoZ(CBurningVideoDriver* driver
|
||||
|
||||
/*!
|
||||
*/
|
||||
void CTRTextureGouraudAlphaNoZ::OnSetMaterial(const SBurningShaderMaterial& material)
|
||||
void CTRTextureGouraudAlphaNoZ::OnSetMaterialBurning(const SBurningShaderMaterial& material)
|
||||
{
|
||||
#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;
|
||||
if (material.org.MaterialType == EMT_TRANSPARENT_ALPHA_CHANNEL_REF)
|
||||
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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user