Commit 0efce9c9 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@1047 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 201ce2c1
...@@ -209,13 +209,13 @@ void CAnimatedMeshSceneNode::OnAnimate(u32 timeMs) ...@@ -209,13 +209,13 @@ void CAnimatedMeshSceneNode::OnAnimate(u32 timeMs)
if ( Mesh ) if ( Mesh )
{ {
/* /*
scene::IMesh *m = Mesh->getMesh(CurrentFrameNr, 255, StartFrame, EndFrame); scene::IMesh *m = Mesh->getMesh(CurrentFrameNr, 255, StartFrame, EndFrame);
if ( m ) if ( m )
{ {
Box = m->getBoundingBox(); Box = m->getBoundingBox();
} }
*/ */
} }
......
...@@ -50,10 +50,9 @@ CBillboardSceneNode::CBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr, ...@@ -50,10 +50,9 @@ CBillboardSceneNode::CBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr,
void CBillboardSceneNode::OnRegisterSceneNode() void CBillboardSceneNode::OnRegisterSceneNode()
{ {
if (IsVisible) if (IsVisible)
{
SceneManager->registerNodeForRendering(this); SceneManager->registerNodeForRendering(this);
ISceneNode::OnRegisterSceneNode();
} ISceneNode::OnRegisterSceneNode();
} }
......
This diff is collapsed.
...@@ -221,8 +221,7 @@ void CCameraSceneNode::OnRegisterSceneNode() ...@@ -221,8 +221,7 @@ void CCameraSceneNode::OnRegisterSceneNode()
if ( SceneManager->getActiveCamera () == this ) if ( SceneManager->getActiveCamera () == this )
SceneManager->registerNodeForRendering(this, ESNRP_CAMERA); SceneManager->registerNodeForRendering(this, ESNRP_CAMERA);
if (IsVisible) ISceneNode::OnRegisterSceneNode();
ISceneNode::OnRegisterSceneNode();
} }
......
...@@ -106,10 +106,8 @@ const core::aabbox3d<f32>& CCubeSceneNode::getBoundingBox() const ...@@ -106,10 +106,8 @@ const core::aabbox3d<f32>& CCubeSceneNode::getBoundingBox() const
void CCubeSceneNode::OnRegisterSceneNode() void CCubeSceneNode::OnRegisterSceneNode()
{ {
if (IsVisible) if (IsVisible)
{
SceneManager->registerNodeForRendering(this); SceneManager->registerNodeForRendering(this);
ISceneNode::OnRegisterSceneNode(); ISceneNode::OnRegisterSceneNode();
}
} }
......
...@@ -102,7 +102,9 @@ public: ...@@ -102,7 +102,9 @@ public:
unpack_texureBlendFunc ( srcFact, dstFact, modulate, material.MaterialTypeParam ); unpack_texureBlendFunc ( srcFact, dstFact, modulate, material.MaterialTypeParam );
if (srcFact == EBF_SRC_COLOR && dstFact == EBF_ZERO) if (srcFact == EBF_SRC_COLOR && dstFact == EBF_ZERO)
{
pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
}
else else
{ {
pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
...@@ -137,7 +139,7 @@ public: ...@@ -137,7 +139,7 @@ public:
u32 getD3DBlend ( E_BLEND_FACTOR factor ) const u32 getD3DBlend ( E_BLEND_FACTOR factor ) const
{ {
u32 r = 0; u32 r = 0;
switch ( factor ) switch ( factor )
{ {
case EBF_ZERO: r = D3DBLEND_ZERO; break; case EBF_ZERO: r = D3DBLEND_ZERO; break;
case EBF_ONE: r = D3DBLEND_ONE; break; case EBF_ONE: r = D3DBLEND_ONE; break;
...@@ -157,7 +159,7 @@ public: ...@@ -157,7 +159,7 @@ public:
u32 getTexelAlpha ( E_BLEND_FACTOR factor ) const u32 getTexelAlpha ( E_BLEND_FACTOR factor ) const
{ {
u32 r = 0; u32 r = 0;
switch ( factor ) switch ( factor )
{ {
case EBF_SRC_ALPHA: r = 1; break; case EBF_SRC_ALPHA: r = 1; break;
case EBF_ONE_MINUS_SRC_ALPHA: r = 1; break; case EBF_ONE_MINUS_SRC_ALPHA: r = 1; break;
...@@ -180,6 +182,8 @@ public: ...@@ -180,6 +182,8 @@ public:
return r; return r;
} }
bool transparent;
}; };
......
...@@ -65,7 +65,8 @@ void CDepthBuffer::setSize(const core::dimension2d<s32>& size) ...@@ -65,7 +65,8 @@ void CDepthBuffer::setSize(const core::dimension2d<s32>& size)
if (Buffer) if (Buffer)
delete [] Buffer; delete [] Buffer;
TotalSize = size.Width * size.Height * sizeof ( fp24 ); Pitch = size.Width * sizeof ( fp24 );
TotalSize = Pitch * size.Height;
Buffer = new u8[TotalSize]; Buffer = new u8[TotalSize];
} }
...@@ -79,19 +80,6 @@ const core::dimension2d<s32>& CDepthBuffer::getSize() const ...@@ -79,19 +80,6 @@ const core::dimension2d<s32>& CDepthBuffer::getSize() const
//! locks the zbuffer
fp24* CDepthBuffer::lock()
{
return (fp24*) Buffer;
}
//! unlocks the zbuffer
void CDepthBuffer::unlock()
{
}
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
......
...@@ -32,16 +32,29 @@ namespace video ...@@ -32,16 +32,29 @@ namespace video
virtual const core::dimension2d<s32>& getSize() const; virtual const core::dimension2d<s32>& getSize() const;
//! locks the zbuffer //! locks the zbuffer
virtual fp24* lock(); virtual void* lock()
{
return (void*) Buffer;
}
//! unlocks the zbuffer //! unlocks the zbuffer
virtual void unlock(); virtual void unlock()
{
}
//! returns pitch of depthbuffer (in bytes)
virtual u32 getPitch() const
{
return Pitch;
}
private: private:
u8* Buffer; u8* Buffer;
core::dimension2d<s32> Size; core::dimension2d<s32> Size;
u32 TotalSize; u32 TotalSize;
u32 Pitch;
}; };
} // end namespace video } // end namespace video
......
...@@ -27,10 +27,9 @@ CEmptySceneNode::CEmptySceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id) ...@@ -27,10 +27,9 @@ CEmptySceneNode::CEmptySceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id)
void CEmptySceneNode::OnRegisterSceneNode() void CEmptySceneNode::OnRegisterSceneNode()
{ {
if (IsVisible) if (IsVisible)
{
SceneManager->registerNodeForRendering(this); SceneManager->registerNodeForRendering(this);
ISceneNode::OnRegisterSceneNode();
} ISceneNode::OnRegisterSceneNode();
} }
......
...@@ -39,10 +39,9 @@ void CLightSceneNode::OnRegisterSceneNode() ...@@ -39,10 +39,9 @@ void CLightSceneNode::OnRegisterSceneNode()
doLightRecalc(); doLightRecalc();
if (IsVisible) if (IsVisible)
{
SceneManager->registerNodeForRendering(this, ESNRP_LIGHT); SceneManager->registerNodeForRendering(this, ESNRP_LIGHT);
ISceneNode::OnRegisterSceneNode();
} ISceneNode::OnRegisterSceneNode();
} }
......
...@@ -625,7 +625,7 @@ s32 CQ3LevelMesh::setShaderMaterial ( video::SMaterial &material, const tBSPFace ...@@ -625,7 +625,7 @@ s32 CQ3LevelMesh::setShaderMaterial ( video::SMaterial &material, const tBSPFace
if ( face->lightmapID >= 0 ) if ( face->lightmapID >= 0 )
{ {
material.setTexture(1, Lightmap [ face->lightmapID ]); material.setTexture(1, Lightmap [ face->lightmapID ]);
material.MaterialType = quake3::defaultLightMap; material.MaterialType = quake3::defaultMaterialType;
} }
// store shader ID // store shader ID
...@@ -643,7 +643,7 @@ s32 CQ3LevelMesh::setShaderMaterial ( video::SMaterial &material, const tBSPFace ...@@ -643,7 +643,7 @@ s32 CQ3LevelMesh::setShaderMaterial ( video::SMaterial &material, const tBSPFace
group = shader->getGroup ( 1 ); group = shader->getGroup ( 1 );
if ( group ) if ( group )
{ {
material.BackfaceCulling = quake3::getBackfaceCulling ( group->get ( "cull" ) ); material.BackfaceCulling = quake3::isDisabled ( group->get ( "cull" ) );
if ( group->isDefined ( "surfaceparm", "nolightmap" ) ) if ( group->isDefined ( "surfaceparm", "nolightmap" ) )
{ {
...@@ -668,7 +668,7 @@ s32 CQ3LevelMesh::setShaderMaterial ( video::SMaterial &material, const tBSPFace ...@@ -668,7 +668,7 @@ s32 CQ3LevelMesh::setShaderMaterial ( video::SMaterial &material, const tBSPFace
index = group->getIndex ( "depthwrite" ); index = group->getIndex ( "depthwrite" );
if ( index >= 0 ) if ( index >= 0 )
{ {
material.ZBuffer = true; material.ZWriteEnable = true;
} }
quake3::SBlendFunc blendfunc; quake3::SBlendFunc blendfunc;
...@@ -807,7 +807,7 @@ void CQ3LevelMesh::constructMesh2() ...@@ -807,7 +807,7 @@ void CQ3LevelMesh::constructMesh2()
{ {
if ( 0 == toBuffer[g].takeVertexColor ) if ( 0 == toBuffer[g].takeVertexColor )
{ {
toBuffer[g].takeVertexColor = material.getTexture(0) == 0 || material.getTexture(1); toBuffer[g].takeVertexColor = material.getTexture(0) == 0 || material.getTexture(1) == 0;
} }
if (Faces[i].lightmapID < -1 || Faces[i].lightmapID > NumLightMaps-1) if (Faces[i].lightmapID < -1 || Faces[i].lightmapID > NumLightMaps-1)
{ {
...@@ -821,8 +821,24 @@ void CQ3LevelMesh::constructMesh2() ...@@ -821,8 +821,24 @@ void CQ3LevelMesh::constructMesh2()
} }
else else
{ {
// Construct a unique mesh for each shader or combine meshbuffers for same shader
#if 0
buffer = 0;
if ( shader )
{
const quake3::SVarGroup *group = shader->getGroup ( 1 );
if ( group )
{
if ( group->getIndex ( "deformvertexes" ) >= 0 )
{
buffer = (SMeshBufferLightMap*) Mesh[ toBuffer[g].index ]->getMeshBuffer ( material );
}
}
}
#else
buffer = (SMeshBufferLightMap*) Mesh[ toBuffer[g].index ]->getMeshBuffer ( material ); buffer = (SMeshBufferLightMap*) Mesh[ toBuffer[g].index ]->getMeshBuffer ( material );
//buffer = 0; #endif
if ( 0 == buffer ) if ( 0 == buffer )
{ {
buffer = new scene::SMeshBufferLightMap(); buffer = new scene::SMeshBufferLightMap();
...@@ -1415,6 +1431,7 @@ const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileN ...@@ -1415,6 +1431,7 @@ const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileN
{ {
quake3::SShader search; quake3::SShader search;
search.name = filename; search.name = filename;
search.name.replace ( '\\', '/' );
s32 index; s32 index;
...@@ -1431,7 +1448,7 @@ const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileN ...@@ -1431,7 +1448,7 @@ const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileN
{ {
// extract the shader name from the last path component in filename // extract the shader name from the last path component in filename
// "scripts/[name].shader" // "scripts/[name].shader"
core::stringc cut ( filename ); core::stringc cut ( search.name );
s32 end = cut.findLast ( '/' ); s32 end = cut.findLast ( '/' );
s32 start = cut.findLast ( '/', end - 1 ); s32 start = cut.findLast ( '/', end - 1 );
...@@ -1442,7 +1459,7 @@ const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileN ...@@ -1442,7 +1459,7 @@ const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileN
} }
else else
{ {
loadFile = filename; loadFile = search.name;
} }
// already loaded the file ? // already loaded the file ?
...@@ -1450,6 +1467,9 @@ const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileN ...@@ -1450,6 +1467,9 @@ const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileN
if ( index >= 0 ) if ( index >= 0 )
return 0; return 0;
// add file to loaded files
ShaderFile.push_back ( loadFile );
if ( !FileSystem->existFile ( loadFile.c_str () ) ) if ( !FileSystem->existFile ( loadFile.c_str () ) )
return 0; return 0;
...@@ -1461,9 +1481,6 @@ const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileN ...@@ -1461,9 +1481,6 @@ const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileN
message = loadFile + " for " + core::stringc ( filename ); message = loadFile + " for " + core::stringc ( filename );
os::Printer::log("Loaded shader", message.c_str(), ELL_INFORMATION); os::Printer::log("Loaded shader", message.c_str(), ELL_INFORMATION);
// add file to loaded files
ShaderFile.push_back ( loadFile );
// load script // load script
core::array<u8> script; core::array<u8> script;
const long len = file->getSize (); const long len = file->getSize ();
...@@ -1772,6 +1789,12 @@ void CQ3LevelMesh::loadTextures2() ...@@ -1772,6 +1789,12 @@ void CQ3LevelMesh::loadTextures2()
core::stringc check; core::stringc check;
quake3::tTexArray textureArray; quake3::tTexArray textureArray;
// pre-load shaders
for ( t=0; t< NumTextures; ++t)
{
shader = getShader ( Textures[t].strName, 0 );
}
for ( t=0; t< NumTextures; ++t) for ( t=0; t< NumTextures; ++t)
{ {
Tex[t].ShaderID = -1; Tex[t].ShaderID = -1;
......
This diff is collapsed.
...@@ -63,18 +63,15 @@ private: ...@@ -63,18 +63,15 @@ private:
void vertextransform_wave ( f32 dt, quake3::SModifierFunction &function ); void vertextransform_wave ( f32 dt, quake3::SModifierFunction &function );
void vertextransform_bulge( f32 dt, quake3::SModifierFunction &function ); void vertextransform_bulge( f32 dt, quake3::SModifierFunction &function );
void vertextransform_autosprite( f32 dt, quake3::SModifierFunction &function ); void vertextransform_autosprite( f32 dt, quake3::SModifierFunction &function );
void vertextransform_tcgen ( f32 dt, quake3::SModifierFunction &function );
void rgbgen ( f32 dt, quake3::SModifierFunction &function ); void vertextransform_rgbgen ( f32 dt, quake3::SModifierFunction &function );
u32 tcgen ( f32 dt, quake3::SModifierFunction &function, core::matrix4 &texture );
void transformtex ( const core::matrix4 &m, const u32 clamp ); void transformtex ( const core::matrix4 &m, const u32 clamp );
f32 TimeAbs; f32 TimeAbs;
u32 animate( u32 stage, core::matrix4 &texture ); void animate( u32 stage, core::matrix4 &texture );
s32 PassedCulling; bool isTransparent ();
s32 StageCall;
}; };
......
...@@ -1111,22 +1111,6 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDE ...@@ -1111,22 +1111,6 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDE
taken = 1; taken = 1;
} }
break; break;
case ESNRP_SHADER_0:
case ESNRP_SHADER_1:
case ESNRP_SHADER_2:
case ESNRP_SHADER_3:
case ESNRP_SHADER_4:
case ESNRP_SHADER_5:
case ESNRP_SHADER_6:
case ESNRP_SHADER_7:
case ESNRP_SHADER_8:
case ESNRP_SHADER_9:
case ESNRP_SHADER_10:
if ( !isCulled(node) )
{
ShaderNodeList[ time - ESNRP_SHADER_0].push_back( ShaderNodeEntry ( node,time - ESNRP_SHADER_0 ));
taken = 1;
} break;
case ESNRP_COUNT: // ignore this one case ESNRP_COUNT: // ignore this one
break; break;
...@@ -1265,23 +1249,6 @@ void CSceneManager::drawAll() ...@@ -1265,23 +1249,6 @@ void CSceneManager::drawAll()
TransparentNodeList.set_used(0); TransparentNodeList.set_used(0);
} }
// render shader objects.
{
for ( u32 g = 0; g!= ESNRP_SHADER_10 - ESNRP_SHADER_0 + 1; ++g )
{
CurrentRendertime = (scene::E_SCENE_NODE_RENDER_PASS) (ESNRP_SHADER_0 + g);
const u32 size = ShaderNodeList[g].size ();
if ( 0 == size )
continue;
ShaderNodeList[g].sort(); // sort by textures
for (i=0; i< size; ++i)
ShaderNodeList[g][i].node->render();
ShaderNodeList[g].set_used(0);
}
}
clearDeletionList(); clearDeletionList();
......
...@@ -483,26 +483,6 @@ namespace scene ...@@ -483,26 +483,6 @@ namespace scene
} }
}; };
struct ShaderNodeEntry
{
ShaderNodeEntry() {};
ShaderNodeEntry(ISceneNode* n, u32 sceneTime )
{
textureValue = n->getMaterial( sceneTime ).getTexture(0);
node = n;
}
ISceneNode* node;
void* textureValue;
bool operator < (const ShaderNodeEntry& other) const
{
return (textureValue < other.textureValue);
}
};
struct TransparentNodeEntry struct TransparentNodeEntry
{ {
...@@ -579,7 +559,6 @@ namespace scene ...@@ -579,7 +559,6 @@ namespace scene
core::array<ISceneNode*> SkyBoxList; core::array<ISceneNode*> SkyBoxList;
core::array<DefaultNodeEntry> SolidNodeList; core::array<DefaultNodeEntry> SolidNodeList;
core::array<TransparentNodeEntry> TransparentNodeList; core::array<TransparentNodeEntry> TransparentNodeList;
core::array<ShaderNodeEntry> ShaderNodeList[ ESNRP_SHADER_10 - ESNRP_SHADER_0 + 1];
core::array<IMeshLoader*> MeshLoaderList; core::array<IMeshLoader*> MeshLoaderList;
core::array<ISceneNode*> DeletionList; core::array<ISceneNode*> DeletionList;
......
...@@ -383,10 +383,9 @@ void CShadowVolumeSceneNode::setMeshToRenderFrom(const IMesh* mesh) ...@@ -383,10 +383,9 @@ void CShadowVolumeSceneNode::setMeshToRenderFrom(const IMesh* mesh)
void CShadowVolumeSceneNode::OnRegisterSceneNode() void CShadowVolumeSceneNode::OnRegisterSceneNode()
{ {
if (IsVisible) if (IsVisible)
{
SceneManager->registerNodeForRendering(this, scene::ESNRP_SHADOW); SceneManager->registerNodeForRendering(this, scene::ESNRP_SHADOW);
ISceneNode::OnRegisterSceneNode();
} ISceneNode::OnRegisterSceneNode();
} }
......
...@@ -206,10 +206,9 @@ const core::aabbox3d<f32>& CSkyBoxSceneNode::getBoundingBox() const ...@@ -206,10 +206,9 @@ const core::aabbox3d<f32>& CSkyBoxSceneNode::getBoundingBox() const
void CSkyBoxSceneNode::OnRegisterSceneNode() void CSkyBoxSceneNode::OnRegisterSceneNode()
{ {
if (IsVisible) if (IsVisible)
{
SceneManager->registerNodeForRendering(this, ESNRP_SKY_BOX); SceneManager->registerNodeForRendering(this, ESNRP_SKY_BOX);
ISceneNode::OnRegisterSceneNode();
} ISceneNode::OnRegisterSceneNode();
} }
......
...@@ -142,10 +142,9 @@ const core::aabbox3d<f32>& CSkyDomeSceneNode::getBoundingBox() const ...@@ -142,10 +142,9 @@ const core::aabbox3d<f32>& CSkyDomeSceneNode::getBoundingBox() const
void CSkyDomeSceneNode::OnRegisterSceneNode() void CSkyDomeSceneNode::OnRegisterSceneNode()
{ {
if (IsVisible) if (IsVisible)
{
SceneManager->registerNodeForRendering(this, ESNRP_SKY_BOX); SceneManager->registerNodeForRendering(this, ESNRP_SKY_BOX);
ISceneNode::OnRegisterSceneNode();
} ISceneNode::OnRegisterSceneNode();
} }
......
...@@ -21,21 +21,21 @@ class CSoftware2MaterialRenderer : public IMaterialRenderer ...@@ -21,21 +21,21 @@ class CSoftware2MaterialRenderer : public IMaterialRenderer
public: public:
//! Constructor //! Constructor
CSoftware2MaterialRenderer(video::CSoftwareDriver2* driver) CSoftware2MaterialRenderer(video::CBurningVideoDriver* driver)
: Driver(driver) : Driver(driver)
{ {
} }
protected: protected:
video::CSoftwareDriver2* Driver; video::CBurningVideoDriver* Driver;
}; };
//! solid material renderer //! solid material renderer
class CSoftware2MaterialRenderer_SOLID : public CSoftware2MaterialRenderer class CSoftware2MaterialRenderer_SOLID : public CSoftware2MaterialRenderer
{ {
public: public:
CSoftware2MaterialRenderer_SOLID ( video::CSoftwareDriver2* driver ) CSoftware2MaterialRenderer_SOLID ( video::CBurningVideoDriver* driver )
:CSoftware2MaterialRenderer ( driver ) {} :CSoftware2MaterialRenderer ( driver ) {}
//! Returns if the material is transparent. //! Returns if the material is transparent.
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
class CSoftware2MaterialRenderer_TRANSPARENT_ADD_COLOR : public CSoftware2MaterialRenderer class CSoftware2MaterialRenderer_TRANSPARENT_ADD_COLOR : public CSoftware2MaterialRenderer
{ {
public: public:
CSoftware2MaterialRenderer_TRANSPARENT_ADD_COLOR ( video::CSoftwareDriver2* driver ) CSoftware2MaterialRenderer_TRANSPARENT_ADD_COLOR ( video::CBurningVideoDriver* driver )
: CSoftware2MaterialRenderer ( driver ) {} : CSoftware2MaterialRenderer ( driver ) {}
...@@ -68,13 +68,48 @@ public: ...@@ -68,13 +68,48 @@ public:
class CSoftware2MaterialRenderer_UNSUPPORTED : public CSoftware2MaterialRenderer class CSoftware2MaterialRenderer_UNSUPPORTED : public CSoftware2MaterialRenderer
{ {
public: public:
CSoftware2MaterialRenderer_UNSUPPORTED ( video::CSoftwareDriver2* driver ) CSoftware2MaterialRenderer_UNSUPPORTED ( video::CBurningVideoDriver* driver )
: CSoftware2MaterialRenderer ( driver ) {} : CSoftware2MaterialRenderer ( driver ) {}
virtual s32 getRenderCapability() const { return 1; } virtual s32 getRenderCapability() const { return 1; }
}; };
//! unsupported material renderer
class CBurningShader_REFERENCE : public CSoftware2MaterialRenderer
{
public:
CBurningShader_REFERENCE ( video::CBurningVideoDriver* driver )
: CSoftware2MaterialRenderer ( driver ) {}
virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial,
bool resetAllRenderstates, IMaterialRendererServices* services)
{
}
virtual void OnUnsetMaterial()
{
}
virtual bool isTransparent() const
{
return false;
}
virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype)
{
return true;
};
virtual s32 getRenderCapability() const
{
return 1;
}
};
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
......
This diff is collapsed.
...@@ -16,15 +16,15 @@ namespace irr ...@@ -16,15 +16,15 @@ namespace irr
{ {
namespace video namespace video
{ {
class CSoftwareDriver2 : public CNullDriver class CBurningVideoDriver : public CNullDriver
{ {
public: public:
//! constructor //! constructor
CSoftwareDriver2(const core::dimension2d<s32>& windowSize, bool fullscreen, io::IFileSystem* io, video::IImagePresenter* presenter); CBurningVideoDriver(const core::dimension2d<s32>& windowSize, bool fullscreen, io::IFileSystem* io, video::IImagePresenter* presenter);
//! destructor //! destructor
virtual ~CSoftwareDriver2(); virtual ~CBurningVideoDriver();
//! presents the rendered scene on the screen, returns false if failed //! presents the rendered scene on the screen, returns false if failed
virtual bool endScene( s32 windowId = 0, core::rect<s32>* sourceRect=0 ); virtual bool endScene( s32 windowId = 0, core::rect<s32>* sourceRect=0 );
...@@ -124,7 +124,7 @@ namespace video ...@@ -124,7 +124,7 @@ namespace video
void setRenderTarget(video::CImage* image); void setRenderTarget(video::CImage* image);
//! sets the current Texture //! sets the current Texture
bool setTexture(u32 stage, video::ITexture* texture); //bool setTexture(u32 stage, video::ITexture* texture);
//! returns a device dependent texture from a software surface (IImage) //! returns a device dependent texture from a software surface (IImage)
//! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES //! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES
...@@ -145,8 +145,6 @@ namespace video ...@@ -145,8 +145,6 @@ namespace video
IDepthBuffer* DepthBuffer; IDepthBuffer* DepthBuffer;
video::ITexture* Texture[2];
sInternalTexture Texmap[2];
/* /*
extend Matrix Stack extend Matrix Stack
...@@ -215,37 +213,8 @@ namespace video ...@@ -215,37 +213,8 @@ namespace video
void select_polygon_mipmap2 ( s4DVertex **source, s32 tex ) const; void select_polygon_mipmap2 ( s4DVertex **source, s32 tex ) const;
sVec4 Global_AmbientLight; SBurningShaderLightSpace LightSpace;
SBurningShaderMaterial Material;
struct SInternalLight
{
SLight org;
sVec4 posEyeSpace;
f32 constantAttenuation;
f32 linearAttenuation;
f32 quadraticAttenuation;
sVec4 AmbientColor;
sVec4 DiffuseColor;
sVec4 SpecularColor;
};
core::array<SInternalLight> Light;
struct SInternalMaterial
{
SMaterial org;
sVec4 AmbientColor;
sVec4 DiffuseColor;
sVec4 SpecularColor;
sVec4 EmissiveColor;
u32 SpecularEnabled; // == Power2
};
SInternalMaterial Material;
static const sVec4 NDCPlane[6]; static const sVec4 NDCPlane[6];
......
...@@ -37,14 +37,14 @@ CSoftwareTexture2::CSoftwareTexture2(IImage* image, const char* name, bool gener ...@@ -37,14 +37,14 @@ CSoftwareTexture2::CSoftwareTexture2(IImage* image, const char* name, bool gener
if ( origSize == optSize ) if ( origSize == optSize )
{ {
MipMap[0] = new CImage(ECF_SOFTWARE2, image); MipMap[0] = new CImage(BURNINGSHADER_COLOR_FORMAT, image);
} }
else else
{ {
MipMap[0] = new CImage(ECF_SOFTWARE2, optSize); MipMap[0] = new CImage(BURNINGSHADER_COLOR_FORMAT, optSize);
// temporary CImage needed // temporary CImage needed
CImage * temp = new CImage ( ECF_SOFTWARE2, image ); CImage * temp = new CImage ( BURNINGSHADER_COLOR_FORMAT, image );
temp->copyToScaling(MipMap[0]); temp->copyToScaling(MipMap[0]);
temp->drop (); temp->drop ();
} }
...@@ -108,7 +108,7 @@ void CSoftwareTexture2::regenerateMipMapLevels() ...@@ -108,7 +108,7 @@ void CSoftwareTexture2::regenerateMipMapLevels()
newSize.Width = core::s32_max ( 1, currentSize.Width >> 1 ); newSize.Width = core::s32_max ( 1, currentSize.Width >> 1 );
newSize.Height = core::s32_max ( 1, currentSize.Height >> 1 ); newSize.Height = core::s32_max ( 1, currentSize.Height >> 1 );
MipMap[i] = new CImage(ECF_SOFTWARE2, newSize); MipMap[i] = new CImage(BURNINGSHADER_COLOR_FORMAT, newSize);
MipMap[0]->copyToScalingBoxFilter ( MipMap[i], 0 ); MipMap[0]->copyToScalingBoxFilter ( MipMap[i], 0 );
c = MipMap[i]; c = MipMap[i];
i += 1; i += 1;
......
...@@ -48,7 +48,7 @@ public: ...@@ -48,7 +48,7 @@ public:
} }
//! Returns the size of the largest mipmap. //! Returns the size of the largest mipmap.
const core::dimension2d<s32>& getMaxSize() const const core::dimension2d<s32>& getMaxMipMapSize() const
{ {
return MipMap[0]->getDimension(); return MipMap[0]->getDimension();
} }
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
//! returns color format of texture //! returns color format of texture
virtual ECOLOR_FORMAT getColorFormat() const virtual ECOLOR_FORMAT getColorFormat() const
{ {
return ECF_SOFTWARE2; return BURNINGSHADER_COLOR_FORMAT;
} }
//! returns pitch of texture (in bytes) //! returns pitch of texture (in bytes)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -144,10 +144,7 @@ void CTRTextureBlend::scanline_bilinear () ...@@ -144,10 +144,7 @@ void CTRTextureBlend::scanline_bilinear ()
sVec4 slopeC; sVec4 slopeC;
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
sVec2 slopeT0; sVec2 slopeT[MATERIAL_MAX_TEXTURES];
#endif
#ifdef IPOL_T1
sVec2 slopeT1;
#endif #endif
// apply top-left fill-convention, left // apply top-left fill-convention, left
...@@ -172,10 +169,10 @@ void CTRTextureBlend::scanline_bilinear () ...@@ -172,10 +169,10 @@ void CTRTextureBlend::scanline_bilinear ()
slopeC = (line.c[1] - line.c[0]) * invDeltaX; slopeC = (line.c[1] - line.c[0]) * invDeltaX;
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
slopeT0 = (line.t0[1] - line.t0[0]) * invDeltaX; slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX;
#endif #endif
#ifdef IPOL_T1 #ifdef IPOL_T1
slopeT1 = (line.t1[1] - line.t1[0]) * invDeltaX; slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX;
#endif #endif
#ifdef SUBTEXEL #ifdef SUBTEXEL
...@@ -190,17 +187,17 @@ void CTRTextureBlend::scanline_bilinear () ...@@ -190,17 +187,17 @@ void CTRTextureBlend::scanline_bilinear ()
line.c[0] += slopeC * subPixel; line.c[0] += slopeC * subPixel;
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
line.t0[0] += slopeT0 * subPixel; line.t[0][0] += slopeT[0] * subPixel;
#endif #endif
#ifdef IPOL_T1 #ifdef IPOL_T1
line.t1[0] += slopeT1 * subPixel; line.t[1][0] += slopeT[1] * subPixel;
#endif #endif
#endif #endif
dst = lockedSurface + ( line.y * SurfaceWidth ) + xStart; dst = lockedSurface + ( line.y * RenderTarget->getDimension().Width ) + xStart;
#ifdef USE_ZBUFFER #ifdef USE_ZBUFFER
z = lockedZBuffer + ( line.y * SurfaceWidth ) + xStart; z = lockedDepthBuffer + ( line.y * RenderTarget->getDimension().Width ) + xStart;
#endif #endif
...@@ -232,8 +229,8 @@ void CTRTextureBlend::scanline_bilinear () ...@@ -232,8 +229,8 @@ void CTRTextureBlend::scanline_bilinear ()
getSample_texture ( r0, g0, b0, getSample_texture ( r0, g0, b0,
&IT[0], &IT[0],
f32_to_fixPoint ( line.t0[0].x,inversew), f32_to_fixPoint ( line.t[0][0].x,inversew),
f32_to_fixPoint ( line.t0[0].y,inversew) f32_to_fixPoint ( line.t[0][0].y,inversew)
); );
color_to_fix ( r1, g1, b1, dst[i] ); color_to_fix ( r1, g1, b1, dst[i] );
...@@ -248,7 +245,7 @@ void CTRTextureBlend::scanline_bilinear () ...@@ -248,7 +245,7 @@ void CTRTextureBlend::scanline_bilinear ()
line.w[0] += slopeW; line.w[0] += slopeW;
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
line.t0[0] += slopeT0; line.t[0][0] += slopeT[0];
#endif #endif
} }
break; break;
...@@ -271,8 +268,8 @@ void CTRTextureBlend::scanline_bilinear () ...@@ -271,8 +268,8 @@ void CTRTextureBlend::scanline_bilinear ()
#endif #endif
getSample_texture ( r0, g0, b0, getSample_texture ( r0, g0, b0,
&IT[0], &IT[0],
f32_to_fixPoint ( line.t0[0].x,inversew), f32_to_fixPoint ( line.t[0][0].x,inversew),
f32_to_fixPoint ( line.t0[0].y,inversew) f32_to_fixPoint ( line.t[0][0].y,inversew)
); );
color_to_fix ( r1, g1, b1, dst[i] ); color_to_fix ( r1, g1, b1, dst[i] );
...@@ -287,7 +284,7 @@ void CTRTextureBlend::scanline_bilinear () ...@@ -287,7 +284,7 @@ void CTRTextureBlend::scanline_bilinear ()
line.w[0] += slopeW; line.w[0] += slopeW;
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
line.t0[0] += slopeT0; line.t[0][0] += slopeT[0];
#endif #endif
}break; }break;
} // zcompare } // zcompare
...@@ -342,13 +339,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -342,13 +339,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
scan.slopeT0[0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0];
scan.t0[0] = a->Tex[0]; scan.t[0][0] = a->Tex[0];
#endif #endif
#ifdef IPOL_T1 #ifdef IPOL_T1
scan.slopeT1[0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0];
scan.t1[0] = a->Tex[1]; scan.t[1][0] = a->Tex[1];
#endif #endif
// top left fill convention y run // top left fill convention y run
...@@ -362,7 +359,7 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -362,7 +359,7 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
lockedSurface = (tVideoSample*)RenderTarget->lock(); lockedSurface = (tVideoSample*)RenderTarget->lock();
#ifdef USE_ZBUFFER #ifdef USE_ZBUFFER
lockedZBuffer = ZBuffer->lock(); lockedDepthBuffer = (fp24*) DepthBuffer->lock();
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
...@@ -396,13 +393,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -396,13 +393,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
scan.slopeT0[1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1];
scan.t0[1] = a->Tex[0]; scan.t[0][1] = a->Tex[0];
#endif #endif
#ifdef IPOL_T1 #ifdef IPOL_T1
scan.slopeT1[1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1];
scan.t1[1] = a->Tex[1]; scan.t[1][1] = a->Tex[1];
#endif #endif
// apply top-left fill convention, top part // apply top-left fill convention, top part
...@@ -432,13 +429,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -432,13 +429,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
scan.t0[0] += scan.slopeT0[0] * subPixel; scan.t[0][0] += scan.slopeT[0][0] * subPixel;
scan.t0[1] += scan.slopeT0[1] * subPixel; scan.t[0][1] += scan.slopeT[0][1] * subPixel;
#endif #endif
#ifdef IPOL_T1 #ifdef IPOL_T1
scan.t1[0] += scan.slopeT1[0] * subPixel; scan.t[1][0] += scan.slopeT[1][0] * subPixel;
scan.t1[1] += scan.slopeT1[1] * subPixel; scan.t[1][1] += scan.slopeT[1][1] * subPixel;
#endif #endif
#endif #endif
...@@ -465,13 +462,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -465,13 +462,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
line.t0[scan.left] = scan.t0[0]; line.t[0][scan.left] = scan.t[0][0];
line.t0[scan.right] = scan.t0[1]; line.t[0][scan.right] = scan.t[0][1];
#endif #endif
#ifdef IPOL_T1 #ifdef IPOL_T1
line.t1[scan.left] = scan.t1[0]; line.t[1][scan.left] = scan.t[1][0];
line.t1[scan.right] = scan.t1[1]; line.t[1][scan.right] = scan.t[1][1];
#endif #endif
// render a scanline // render a scanline
...@@ -496,13 +493,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -496,13 +493,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
scan.t0[0] += scan.slopeT0[0]; scan.t[0][0] += scan.slopeT[0][0];
scan.t0[1] += scan.slopeT0[1]; scan.t[0][1] += scan.slopeT[0][1];
#endif #endif
#ifdef IPOL_T1 #ifdef IPOL_T1
scan.t1[0] += scan.slopeT1[0]; scan.t[1][0] += scan.slopeT[1][0];
scan.t1[1] += scan.slopeT1[1]; scan.t[1][1] += scan.slopeT[1][1];
#endif #endif
} }
...@@ -527,10 +524,10 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -527,10 +524,10 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
scan.c[0] = a->Color[0] + scan.slopeC[0] * temp[0]; scan.c[0] = a->Color[0] + scan.slopeC[0] * temp[0];
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
scan.t0[0] = a->Tex[0] + scan.slopeT0[0] * temp[0]; scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0];
#endif #endif
#ifdef IPOL_T1 #ifdef IPOL_T1
scan.t1[0] = a->Tex[1] + scan.slopeT1[0] * temp[0]; scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0];
#endif #endif
} }
...@@ -555,13 +552,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -555,13 +552,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
scan.slopeT0[1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2];
scan.t0[1] = b->Tex[0]; scan.t[0][1] = b->Tex[0];
#endif #endif
#ifdef IPOL_T1 #ifdef IPOL_T1
scan.slopeT1[1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2];
scan.t1[1] = b->Tex[1]; scan.t[1][1] = b->Tex[1];
#endif #endif
// apply top-left fill convention, top part // apply top-left fill convention, top part
...@@ -592,13 +589,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -592,13 +589,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
scan.t0[0] += scan.slopeT0[0] * subPixel; scan.t[0][0] += scan.slopeT[0][0] * subPixel;
scan.t0[1] += scan.slopeT0[1] * subPixel; scan.t[0][1] += scan.slopeT[0][1] * subPixel;
#endif #endif
#ifdef IPOL_T1 #ifdef IPOL_T1
scan.t1[0] += scan.slopeT1[0] * subPixel; scan.t[1][0] += scan.slopeT[1][0] * subPixel;
scan.t1[1] += scan.slopeT1[1] * subPixel; scan.t[1][1] += scan.slopeT[1][1] * subPixel;
#endif #endif
#endif #endif
...@@ -625,13 +622,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -625,13 +622,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
line.t0[scan.left] = scan.t0[0]; line.t[0][scan.left] = scan.t[0][0];
line.t0[scan.right] = scan.t0[1]; line.t[0][scan.right] = scan.t[0][1];
#endif #endif
#ifdef IPOL_T1 #ifdef IPOL_T1
line.t1[scan.left] = scan.t1[0]; line.t[1][scan.left] = scan.t[1][0];
line.t1[scan.right] = scan.t1[1]; line.t[1][scan.right] = scan.t[1][1];
#endif #endif
// render a scanline // render a scanline
...@@ -656,13 +653,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -656,13 +653,13 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
scan.t0[0] += scan.slopeT0[0]; scan.t[0][0] += scan.slopeT[0][0];
scan.t0[1] += scan.slopeT0[1]; scan.t[0][1] += scan.slopeT[0][1];
#endif #endif
#ifdef IPOL_T1 #ifdef IPOL_T1
scan.t1[0] += scan.slopeT1[0]; scan.t[1][0] += scan.slopeT[1][0];
scan.t1[1] += scan.slopeT1[1]; scan.t[1][1] += scan.slopeT[1][1];
#endif #endif
} }
...@@ -671,7 +668,7 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -671,7 +668,7 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
RenderTarget->unlock(); RenderTarget->unlock();
#ifdef USE_ZBUFFER #ifdef USE_ZBUFFER
ZBuffer->unlock(); DepthBuffer->unlock();
#endif #endif
#ifdef IPOL_T0 #ifdef IPOL_T0
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -115,8 +115,8 @@ static inline void swap_xor ( s32 &a, s32 &b ) ...@@ -115,8 +115,8 @@ static inline void swap_xor ( s32 &a, s32 &b )
void CTRTextureWire2::renderLine ( const s4DVertex *a,const s4DVertex *b ) const void CTRTextureWire2::renderLine ( const s4DVertex *a,const s4DVertex *b ) const
{ {
int pitch0 = SurfaceWidth << VIDEO_SAMPLE_GRANULARITY; int pitch0 = RenderTarget->getDimension().Width << VIDEO_SAMPLE_GRANULARITY;
int pitch1 = SurfaceWidth << 2; int pitch1 = RenderTarget->getDimension().Width << 2;
int aposx = (int) a->Pos.x; int aposx = (int) a->Pos.x;
int aposy = (int) a->Pos.y; int aposy = (int) a->Pos.y;
...@@ -171,7 +171,7 @@ void CTRTextureWire2::renderLine ( const s4DVertex *a,const s4DVertex *b ) const ...@@ -171,7 +171,7 @@ void CTRTextureWire2::renderLine ( const s4DVertex *a,const s4DVertex *b ) const
dst = (tVideoSample*) ( (u8*) lockedSurface + ( aposy * pitch0 ) + (aposx << VIDEO_SAMPLE_GRANULARITY ) ); dst = (tVideoSample*) ( (u8*) lockedSurface + ( aposy * pitch0 ) + (aposx << VIDEO_SAMPLE_GRANULARITY ) );
#ifdef USE_ZBUFFER #ifdef USE_ZBUFFER
z = (fp24*) ( (u8*) lockedZBuffer + ( aposy * pitch1 ) + (aposx << 2 ) ); z = (fp24*) ( (u8*) lockedDepthBuffer + ( aposy * pitch1 ) + (aposx << 2 ) );
#endif #endif
c = dx << 1; c = dx << 1;
...@@ -254,7 +254,7 @@ void CTRTextureWire2::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -254,7 +254,7 @@ void CTRTextureWire2::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
lockedSurface = (tVideoSample*)RenderTarget->lock(); lockedSurface = (tVideoSample*)RenderTarget->lock();
#ifdef USE_ZBUFFER #ifdef USE_ZBUFFER
lockedZBuffer = ZBuffer->lock(); lockedDepthBuffer = (fp24*) DepthBuffer->lock();
#endif #endif
renderLine ( a, b ); renderLine ( a, b );
...@@ -264,7 +264,7 @@ void CTRTextureWire2::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const ...@@ -264,7 +264,7 @@ void CTRTextureWire2::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
RenderTarget->unlock(); RenderTarget->unlock();
#ifdef USE_ZBUFFER #ifdef USE_ZBUFFER
ZBuffer->unlock(); DepthBuffer->unlock();
#endif #endif
} }
...@@ -281,14 +281,14 @@ void CTRTextureWire2::drawLine ( const s4DVertex *a,const s4DVertex *b) ...@@ -281,14 +281,14 @@ void CTRTextureWire2::drawLine ( const s4DVertex *a,const s4DVertex *b)
lockedSurface = (tVideoSample*)RenderTarget->lock(); lockedSurface = (tVideoSample*)RenderTarget->lock();
#ifdef USE_ZBUFFER #ifdef USE_ZBUFFER
lockedZBuffer = ZBuffer->lock(); lockedDepthBuffer = (fp24*) DepthBuffer->lock();
#endif #endif
renderLine ( a, b ); renderLine ( a, b );
RenderTarget->unlock(); RenderTarget->unlock();
#ifdef USE_ZBUFFER #ifdef USE_ZBUFFER
ZBuffer->unlock(); DepthBuffer->unlock();
#endif #endif
} }
......
...@@ -46,10 +46,9 @@ CTextSceneNode::~CTextSceneNode() ...@@ -46,10 +46,9 @@ CTextSceneNode::~CTextSceneNode()
void CTextSceneNode::OnRegisterSceneNode() void CTextSceneNode::OnRegisterSceneNode()
{ {
if (IsVisible) if (IsVisible)
{
SceneManager->registerNodeForRendering(this, ESNRP_TRANSPARENT); SceneManager->registerNodeForRendering(this, ESNRP_TRANSPARENT);
ISceneNode::OnRegisterSceneNode();
} ISceneNode::OnRegisterSceneNode();
} }
//! renders the node. //! renders the node.
...@@ -101,11 +100,11 @@ CBillboardTextSceneNode::CBillboardTextSceneNode(ISceneNode* parent, ISceneManag ...@@ -101,11 +100,11 @@ CBillboardTextSceneNode::CBillboardTextSceneNode(ISceneNode* parent, ISceneManag
setDebugName("CBillboardTextSceneNode"); setDebugName("CBillboardTextSceneNode");
#endif #endif
Material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; Material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
Material.MaterialTypeParam = 0.5f; Material.MaterialTypeParam = 1.f / 255.f;
Material.BackfaceCulling = false; Material.BackfaceCulling = false;
Material.Lighting = false; Material.Lighting = false;
Material.ZBuffer = false; Material.ZBuffer = true;
Material.ZWriteEnable = false; Material.ZWriteEnable = false;
if (font) if (font)
......
...@@ -1420,8 +1420,6 @@ bool CXMeshFileLoader::parseDataObjectAnimation() ...@@ -1420,8 +1420,6 @@ bool CXMeshFileLoader::parseDataObjectAnimation()
{ {
ISkinnedMesh::SPositionKey *key=&animationDump.PositionKeys[n]; ISkinnedMesh::SPositionKey *key=&animationDump.PositionKeys[n];
//key->position+=joint->LocalMatrix.getTranslation();
joint->PositionKeys.push_back(*key); joint->PositionKeys.push_back(*key);
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -30,10 +30,14 @@ namespace video ...@@ -30,10 +30,14 @@ namespace video
virtual const core::dimension2d<s32>& getSize() const = 0; virtual const core::dimension2d<s32>& getSize() const = 0;
//! locks the zbuffer //! locks the zbuffer
virtual fp24* lock() = 0; virtual void* lock() = 0;
//! unlocks the zbuffer //! unlocks the zbuffer
virtual void unlock() = 0; virtual void unlock() = 0;
//! returns pitch of depthbuffer (in bytes)
virtual u32 getPitch() const = 0;
}; };
......
...@@ -9,7 +9,7 @@ CppCompiler=-D__GNUWIN32__ -W -DWIN32 -DNDEBUG -D_WINDOWS -D_MBCS -D_USRDLL -DIR ...@@ -9,7 +9,7 @@ CppCompiler=-D__GNUWIN32__ -W -DWIN32 -DNDEBUG -D_WINDOWS -D_MBCS -D_USRDLL -DIR
Includes=..\..\include;zlib Includes=..\..\include;zlib
Linker=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lopengl32_@@_ Linker=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lopengl32_@@_
Libs= Libs=
UnitCount=592 UnitCount=593
Folders=doc,gui_impl,include,include/core,include/gui,include/io,include/scene,include/video,io_impl,other_impl,other_impl/extern,other_impl/extern/jpeglib,other_impl/extern/libpng,other_impl/extern/zlib,scene_impl,scene_impl/animators,scene_impl/collision,scene_impl/mesh,scene_impl/mesh/loaders,scene_impl/mesh/writers,scene_impl/nodes,scene_impl/nodes/particles,video_impl,"video_impl/Burning Video",video_impl/DirectX8,video_impl/DirectX9,video_impl/Null,video_impl/OpenGL,video_impl/Software Folders=doc,gui_impl,include,include/core,include/gui,include/io,include/scene,include/video,io_impl,other_impl,other_impl/extern,other_impl/extern/jpeglib,other_impl/extern/libpng,other_impl/extern/zlib,scene_impl,scene_impl/animators,scene_impl/collision,scene_impl/mesh,scene_impl/mesh/loaders,scene_impl/mesh/writers,scene_impl/nodes,scene_impl/nodes/particles,video_impl,"video_impl/Burning Video",video_impl/DirectX8,video_impl/DirectX9,video_impl/Null,video_impl/OpenGL,video_impl/Software
ObjFiles= ObjFiles=
PrivateResource= PrivateResource=
...@@ -5967,3 +5967,13 @@ Priority=1000 ...@@ -5967,3 +5967,13 @@ Priority=1000
OverrideBuildCmd=0 OverrideBuildCmd=0
BuildCmd= BuildCmd=
[Unit593]
FileName=CBurningShader_Raster_Reference.cpp
CompileCpp=1
Folder=video_impl/Burning Video
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
...@@ -409,6 +409,9 @@ ...@@ -409,6 +409,9 @@
<File <File
RelativePath="..\..\include\EDebugSceneTypes.h"> RelativePath="..\..\include\EDebugSceneTypes.h">
</File> </File>
<File
RelativePath="..\..\include\EMeshWriterEnums.h">
</File>
<File <File
RelativePath=".\..\..\include\ESceneNodeAnimatorTypes.h"> RelativePath=".\..\..\include\ESceneNodeAnimatorTypes.h">
</File> </File>
...@@ -463,9 +466,6 @@ ...@@ -463,9 +466,6 @@
<File <File
RelativePath="..\..\include\IMeshWriter.h"> RelativePath="..\..\include\IMeshWriter.h">
</File> </File>
<File
RelativePath="..\..\include\EMeshWriterEnums.h">
</File>
<File <File
RelativePath=".\..\..\include\IMetaTriangleSelector.h"> RelativePath=".\..\..\include\IMetaTriangleSelector.h">
</File> </File>
...@@ -481,6 +481,9 @@ ...@@ -481,6 +481,9 @@
<File <File
RelativePath=".\..\..\include\IQ3LevelMesh.h"> RelativePath=".\..\..\include\IQ3LevelMesh.h">
</File> </File>
<File
RelativePath="..\..\include\IQ3Shader.h">
</File>
<File <File
RelativePath=".\..\..\include\ISceneCollisionManager.h"> RelativePath=".\..\..\include\ISceneCollisionManager.h">
</File> </File>
...@@ -1099,6 +1102,9 @@ ...@@ -1099,6 +1102,9 @@
</Filter> </Filter>
<Filter <Filter
Name="Burning Video"> Name="Burning Video">
<File
RelativePath=".\CBurningShader_Raster_Reference.cpp">
</File>
<File <File
RelativePath=".\CDepthBuffer.cpp"> RelativePath=".\CDepthBuffer.cpp">
</File> </File>
...@@ -1358,16 +1364,16 @@ ...@@ -1358,16 +1364,16 @@
RelativePath=".\CSkinnedMesh.h"> RelativePath=".\CSkinnedMesh.h">
</File> </File>
<File <File
RelativePath="CXMeshFileLoader.cpp"> RelativePath="CSTLMeshFileLoader.cpp">
</File> </File>
<File <File
RelativePath="CXMeshFileLoader.h"> RelativePath="CSTLMeshFileLoader.h">
</File> </File>
<File <File
RelativePath="CSTLMeshFileLoader.cpp"> RelativePath="CXMeshFileLoader.cpp">
</File> </File>
<File <File
RelativePath="CSTLMeshFileLoader.h"> RelativePath="CXMeshFileLoader.h">
</File> </File>
<File <File
RelativePath=".\dmfsupport.h"> RelativePath=".\dmfsupport.h">
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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