Commit 201ce2c1 authored by engineer_apple's avatar engineer_apple

-------------------------------------------

Changes in version 1.4 (... 13.11.2007)
- Fixed somed CQuake3ShaderSceneNode problems.
- Changed BurningsVideo internal Vertex Format. version changed to 0.39
- SceneManager:
   Removed the seperate rendering states for quake3 Shader Scene Nodes.
   Nodes are now solid or transparent. ( but still more states are needed )


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1046 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 95e75a63
...@@ -34,6 +34,9 @@ namespace scene ...@@ -34,6 +34,9 @@ namespace scene
//! Show Bounding Boxes of all MeshBuffers //! Show Bounding Boxes of all MeshBuffers
EDS_BBOX_BUFFERS = 32, EDS_BBOX_BUFFERS = 32,
//! EDS_BBOX | EDS_BBOX_BUFFERS
EDS_BBOX_ALL = EDS_BBOX | EDS_BBOX_BUFFERS,
//! Show all debug infos //! Show all debug infos
EDS_FULL = 0xffffffff EDS_FULL = 0xffffffff
}; };
......
...@@ -31,8 +31,8 @@ namespace quake3 ...@@ -31,8 +31,8 @@ namespace quake3
// we are not using gamma, so quake3 is very dark. // we are not using gamma, so quake3 is very dark.
// define the standard multiplication for lightmaps and vertex colors // define the standard multiplication for lightmaps and vertex colors
const video::E_MATERIAL_TYPE defaultLightMap = video::EMT_LIGHTMAP_M2; const video::E_MATERIAL_TYPE defaultMaterialType = video::EMT_LIGHTMAP_M4;
const video::E_MODULATE_FUNC defaultModulate = video::EMFN_MODULATE_2X; const video::E_MODULATE_FUNC defaultModulate = video::EMFN_MODULATE_4X;
// some useful typedefs // some useful typedefs
typedef core::array< core::stringc > tStringList; typedef core::array< core::stringc > tStringList;
...@@ -132,16 +132,24 @@ namespace quake3 ...@@ -132,16 +132,24 @@ namespace quake3
} }
/*
Maps Quake3 Blend to Irrlicht Material
*/
struct SBlendFunc struct SBlendFunc
{ {
SBlendFunc () : type ( video::EMT_SOLID ), param ( 0.f ) {} SBlendFunc ()
: type ( video::EMT_SOLID ), param ( 0.f ), modulate ( defaultModulate ),
isTransparent ( 0 ) {}
video::E_MATERIAL_TYPE type; video::E_MATERIAL_TYPE type;
video::E_MODULATE_FUNC modulate;
bool isTransparent;
f32 param; f32 param;
}; };
// parses the content of Variable cull // parses the content of Variable cull
inline bool getBackfaceCulling ( const core::stringc &string ) inline bool isDisabled ( const core::stringc &string )
{ {
if ( string.size() == 0 ) if ( string.size() == 0 )
return true; return true;
...@@ -183,7 +191,6 @@ namespace quake3 ...@@ -183,7 +191,6 @@ namespace quake3
} }
// parses the content of Variable blendfunc,alphafunc // parses the content of Variable blendfunc,alphafunc
inline static void getBlendFunc ( const core::stringc &string, SBlendFunc &blendfunc ) inline static void getBlendFunc ( const core::stringc &string, SBlendFunc &blendfunc )
{ {
...@@ -231,12 +238,14 @@ namespace quake3 ...@@ -231,12 +238,14 @@ namespace quake3
// gl_one gl_zero // gl_one gl_zero
case video::EBF_ZERO: case video::EBF_ZERO:
blendfunc.type = video::EMT_SOLID; blendfunc.type = video::EMT_SOLID;
blendfunc.isTransparent = false;
resolved = 1; resolved = 1;
break; break;
// gl_one gl_one // gl_one gl_one
case video::EBF_ONE: case video::EBF_ONE:
blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR; blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR;
blendfunc.isTransparent = true;
resolved = 1; resolved = 1;
break; break;
} break; } break;
...@@ -248,6 +257,7 @@ namespace quake3 ...@@ -248,6 +257,7 @@ namespace quake3
case video::EBF_ONE_MINUS_SRC_ALPHA: case video::EBF_ONE_MINUS_SRC_ALPHA:
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL; blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
blendfunc.param = 1.f / 255.f; blendfunc.param = 1.f / 255.f;
blendfunc.isTransparent = true;
resolved = 1; resolved = 1;
break; break;
} break; } break;
...@@ -255,30 +265,35 @@ namespace quake3 ...@@ -255,30 +265,35 @@ namespace quake3
case 11: case 11:
// add // add
blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR; blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR;
blendfunc.isTransparent = true;
resolved = 1; resolved = 1;
break; break;
case 12: case 12:
// filter = gl_dst_color gl_zero // filter = gl_dst_color gl_zero
blendfunc.type = video::EMT_ONETEXTURE_BLEND; blendfunc.type = video::EMT_ONETEXTURE_BLEND;
blendfunc.param = video::pack_texureBlendFunc ( video::EBF_DST_COLOR, video::EBF_ZERO, defaultModulate ); blendfunc.param = video::pack_texureBlendFunc ( video::EBF_DST_COLOR, video::EBF_ZERO, defaultModulate );
blendfunc.isTransparent = false;
resolved = 1; resolved = 1;
break; break;
case 13: case 13:
// blend // blend
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL; blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
blendfunc.param = 1.f / 255.f; blendfunc.param = 1.f / 255.f;
blendfunc.isTransparent = true;
resolved = 1; resolved = 1;
break; break;
case 14: case 14:
// alphafunc ge128 // alphafunc ge128
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
blendfunc.param = 0.5f; blendfunc.param = 0.5f;
blendfunc.isTransparent = true;
resolved = 1; resolved = 1;
break; break;
case 15: case 15:
// alphafunc gt0 // alphafunc gt0
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
blendfunc.param = 1.f / 255.f; blendfunc.param = 1.f / 255.f;
blendfunc.isTransparent = true;
resolved = 1; resolved = 1;
break; break;
} }
...@@ -290,14 +305,24 @@ namespace quake3 ...@@ -290,14 +305,24 @@ namespace quake3
blendfunc.param = video::pack_texureBlendFunc ( blendfunc.param = video::pack_texureBlendFunc (
(video::E_BLEND_FACTOR) srcFact, (video::E_BLEND_FACTOR) srcFact,
(video::E_BLEND_FACTOR) dstFact, (video::E_BLEND_FACTOR) dstFact,
defaultModulate); blendfunc.modulate);
if (srcFact == video::EBF_SRC_COLOR && dstFact == video::EBF_ZERO)
{
blendfunc.isTransparent = 0;
}
else
{
blendfunc.isTransparent = true;
}
} }
} }
struct SModifierFunction struct SModifierFunction
{ {
SModifierFunction () SModifierFunction ()
: masterfunc0 ( 0 ), masterfunc1(0), func ( 0 ), : masterfunc0 ( -2 ), masterfunc1(0), func ( 0 ),
tcgen( 8 ), base ( 0 ), amp ( 1 ), phase ( 0 ), freq ( 1 ), wave(1) {} tcgen( 8 ), base ( 0 ), amp ( 1 ), phase ( 0 ), freq ( 1 ), wave(1) {}
// "tcmod","deformvertexes","rgbgen", "tcgen" // "tcmod","deformvertexes","rgbgen", "tcgen"
......
...@@ -82,19 +82,6 @@ namespace scene ...@@ -82,19 +82,6 @@ namespace scene
//! to front and drawn in that order. //! to front and drawn in that order.
ESNRP_TRANSPARENT, ESNRP_TRANSPARENT,
//! Scene Nodes with special support
ESNRP_SHADER_0,
ESNRP_SHADER_1,
ESNRP_SHADER_2,
ESNRP_SHADER_3,
ESNRP_SHADER_4,
ESNRP_SHADER_5,
ESNRP_SHADER_6,
ESNRP_SHADER_7,
ESNRP_SHADER_8,
ESNRP_SHADER_9,
ESNRP_SHADER_10,
//! Never used, value specifing how much parameters there are. //! Never used, value specifing how much parameters there are.
ESNRP_COUNT ESNRP_COUNT
}; };
......
...@@ -160,7 +160,7 @@ namespace scene ...@@ -160,7 +160,7 @@ namespace scene
//! returns the absolute transformation of the node. Is recalculated every OnAnimate()-call. //! returns the absolute transformation of the node. Is recalculated every OnAnimate()-call.
const core::matrix4& getAbsoluteTransformation() const virtual const core::matrix4& getAbsoluteTransformation() const
{ {
return AbsoluteTransformation; return AbsoluteTransformation;
} }
......
...@@ -64,7 +64,7 @@ to the compiler settings: -DIRR_COMPILE_WITH_DX9_DEV_PACK ...@@ -64,7 +64,7 @@ to the compiler settings: -DIRR_COMPILE_WITH_DX9_DEV_PACK
and this to the linker settings: -ld3dx9 -ld3dx8 **/ and this to the linker settings: -ld3dx9 -ld3dx8 **/
#if defined(_IRR_WINDOWS_API_) && (!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK)) #if defined(_IRR_WINDOWS_API_) && (!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK))
//#define _IRR_COMPILE_WITH_DIRECT3D_8_ #define _IRR_COMPILE_WITH_DIRECT3D_8_
#define _IRR_COMPILE_WITH_DIRECT3D_9_ #define _IRR_COMPILE_WITH_DIRECT3D_9_
#endif #endif
...@@ -191,7 +191,7 @@ Note that the engine will run in D3D REF for this, which is a lot slower than HA ...@@ -191,7 +191,7 @@ Note that the engine will run in D3D REF for this, which is a lot slower than HA
#endif #endif
//! Define one of the three setting for Burning's Video Software Rasterizer //! Define one of the three setting for Burning's Video Software Rasterizer
/** So if we were marketing guys we could says Irrlicht has 4 Software-Rasterizers. /** So if we were marketing guys we could say Irrlicht has 4 Software-Rasterizers.
In a Nutshell: In a Nutshell:
All Burnings Rasterizers use 32 Bit Backbuffer, 32Bit Texture & 32 Bit Z or WBuffer, All Burnings Rasterizers use 32 Bit Backbuffer, 32Bit Texture & 32 Bit Z or WBuffer,
16 Bit/32 Bit can be adjusted on a global flag. 16 Bit/32 Bit can be adjusted on a global flag.
......
...@@ -242,10 +242,7 @@ namespace video ...@@ -242,10 +242,7 @@ namespace video
//! Gets the i-th texture //! Gets the i-th texture
ITexture* getTexture(u32 i) const ITexture* getTexture(u32 i) const
{ {
if (i>=MATERIAL_MAX_TEXTURES) return i < MATERIAL_MAX_TEXTURES ? TextureLayer[i].Texture : 0;
return 0;
else
return TextureLayer[i].Texture;
} }
//! Sets the i-th texture //! Sets the i-th texture
......
...@@ -94,7 +94,7 @@ namespace video ...@@ -94,7 +94,7 @@ namespace video
ITexture* Texture; ITexture* Texture;
//! Texture Matrix //! Texture Matrix
//! Do not acces this element directly as the internal //! Do not access this element directly as the internal
//! ressource management has to cope with Null pointers etc. //! ressource management has to cope with Null pointers etc.
core::matrix4* TextureMatrix; core::matrix4* TextureMatrix;
......
...@@ -258,6 +258,7 @@ namespace core ...@@ -258,6 +258,7 @@ namespace core
void setTextureScaleCenter( f32 sx, f32 sy ); void setTextureScaleCenter( f32 sx, f32 sy );
void setTextureTranslate( f32 x, f32 y ); void setTextureTranslate( f32 x, f32 y );
void setTextureTranslateTransposed( f32 x, f32 y );
void buildTextureTransform( f32 rotateRad, void buildTextureTransform( f32 rotateRad,
const core::vector2df &rotatecenter, const core::vector2df &rotatecenter,
...@@ -1580,6 +1581,14 @@ namespace core ...@@ -1580,6 +1581,14 @@ namespace core
definitelyIdentityMatrix = definitelyIdentityMatrix && (x==0.0f) && (y==0.0f) ; definitelyIdentityMatrix = definitelyIdentityMatrix && (x==0.0f) && (y==0.0f) ;
} }
template <class T>
inline void CMatrix4<T>::setTextureTranslateTransposed ( f32 x, f32 y )
{
M[2] = (T)x;
M[6] = (T)y;
definitelyIdentityMatrix = definitelyIdentityMatrix && (x==0.0f) && (y==0.0f) ;
}
template <class T> template <class T>
inline void CMatrix4<T>::setTextureScale ( f32 sx, f32 sy ) inline void CMatrix4<T>::setTextureScale ( f32 sx, f32 sy )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment