Merge MAT_* with shadertype
This commit is contained in:
parent
ecb2f74711
commit
7b165574c0
@ -57,7 +57,10 @@ public:
|
||||
SHADERTYPE_VEGETATION,
|
||||
SHADERTYPE_WATER,
|
||||
SHADERTYPE_SPHERE_MAP,
|
||||
SHADERTYPE_SPLATTING
|
||||
SHADERTYPE_NORMAL_MAP,
|
||||
SHADERTYPE_DETAIL_MAP,
|
||||
SHADERTYPE_SPLATTING,
|
||||
SHADERTYPE_COUNT,
|
||||
};
|
||||
|
||||
enum ParticleConditions
|
||||
|
@ -67,7 +67,7 @@ struct DefaultMaterial
|
||||
typedef MeshShader::ObjectPass2Shader SecondPassShader;
|
||||
typedef ListMatDefault List;
|
||||
static const enum video::E_VERTEX_TYPE VertexType = video::EVT_STANDARD;
|
||||
static const enum MeshMaterial MaterialType = MAT_DEFAULT;
|
||||
static const enum Material::ShaderType MaterialType = Material::SHADERTYPE_SOLID;
|
||||
static const enum InstanceType Instance = InstanceTypeDualTex;
|
||||
static const std::vector<size_t> FirstPassTextures;
|
||||
static const std::vector<size_t> SecondPassTextures;
|
||||
@ -85,7 +85,7 @@ struct AlphaRef
|
||||
typedef MeshShader::ObjectRefPass2Shader SecondPassShader;
|
||||
typedef ListMatAlphaRef List;
|
||||
static const enum video::E_VERTEX_TYPE VertexType = video::EVT_STANDARD;
|
||||
static const enum MeshMaterial MaterialType = MAT_ALPHA_REF;
|
||||
static const enum Material::ShaderType MaterialType = Material::SHADERTYPE_ALPHA_TEST;
|
||||
static const enum InstanceType Instance = InstanceTypeDualTex;
|
||||
static const std::vector<size_t> FirstPassTextures;
|
||||
static const std::vector<size_t> SecondPassTextures;
|
||||
@ -103,7 +103,7 @@ struct SphereMap
|
||||
typedef MeshShader::SphereMapShader SecondPassShader;
|
||||
typedef ListMatSphereMap List;
|
||||
static const enum video::E_VERTEX_TYPE VertexType = video::EVT_STANDARD;
|
||||
static const enum MeshMaterial MaterialType = MAT_SPHEREMAP;
|
||||
static const enum Material::ShaderType MaterialType = Material::SHADERTYPE_SPHERE_MAP;
|
||||
static const enum InstanceType Instance = InstanceTypeDualTex;
|
||||
static const std::vector<size_t> FirstPassTextures;
|
||||
static const std::vector<size_t> SecondPassTextures;
|
||||
@ -121,7 +121,7 @@ struct UnlitMat
|
||||
typedef MeshShader::ObjectUnlitShader SecondPassShader;
|
||||
typedef ListMatUnlit List;
|
||||
static const enum video::E_VERTEX_TYPE VertexType = video::EVT_STANDARD;
|
||||
static const enum MeshMaterial MaterialType = MAT_UNLIT;
|
||||
static const enum Material::ShaderType MaterialType = Material::SHADERTYPE_SOLID_UNLIT;
|
||||
static const enum InstanceType Instance = InstanceTypeDualTex;
|
||||
static const std::vector<size_t> FirstPassTextures;
|
||||
static const std::vector<size_t> SecondPassTextures;
|
||||
@ -139,7 +139,7 @@ struct GrassMat
|
||||
typedef MeshShader::GrassPass2Shader SecondPassShader;
|
||||
typedef ListMatGrass List;
|
||||
static const enum video::E_VERTEX_TYPE VertexType = video::EVT_STANDARD;
|
||||
static const enum MeshMaterial MaterialType = MAT_GRASS;
|
||||
static const enum Material::ShaderType MaterialType = Material::SHADERTYPE_VEGETATION;
|
||||
static const enum InstanceType Instance = InstanceTypeDualTex;
|
||||
static const std::vector<size_t> FirstPassTextures;
|
||||
static const std::vector<size_t> SecondPassTextures;
|
||||
@ -157,7 +157,7 @@ struct NormalMat
|
||||
typedef MeshShader::ObjectPass2Shader SecondPassShader;
|
||||
typedef ListMatNormalMap List;
|
||||
static const enum video::E_VERTEX_TYPE VertexType = video::EVT_TANGENTS;
|
||||
static const enum MeshMaterial MaterialType = MAT_NORMAL_MAP;
|
||||
static const enum Material::ShaderType MaterialType = Material::SHADERTYPE_NORMAL_MAP;
|
||||
static const enum InstanceType Instance = InstanceTypeThreeTex;
|
||||
static const std::vector<size_t> FirstPassTextures;
|
||||
static const std::vector<size_t> SecondPassTextures;
|
||||
@ -175,7 +175,7 @@ struct DetailMat
|
||||
typedef MeshShader::DetailledObjectPass2Shader SecondPassShader;
|
||||
typedef ListMatDetails List;
|
||||
static const enum video::E_VERTEX_TYPE VertexType = video::EVT_2TCOORDS;
|
||||
static const enum MeshMaterial MaterialType = MAT_DETAIL;
|
||||
static const enum Material::ShaderType MaterialType = Material::SHADERTYPE_DETAIL_MAP;
|
||||
static const enum InstanceType Instance = InstanceTypeThreeTex;
|
||||
static const std::vector<size_t> FirstPassTextures;
|
||||
static const std::vector<size_t> SecondPassTextures;
|
||||
@ -823,7 +823,7 @@ void renderShadow(const std::vector<GLuint> TextureUnits, unsigned cascade, cons
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Shader, MeshMaterial Mat, video::E_VERTEX_TYPE VT, typename...Args>
|
||||
template<typename Shader, Material::ShaderType Mat, video::E_VERTEX_TYPE VT, typename...Args>
|
||||
void renderInstancedShadow(const std::vector<GLuint> TextureUnits, unsigned cascade, const std::vector<GLMesh *> &t, Args ...args)
|
||||
{
|
||||
glUseProgram(Shader::getInstance()->Program);
|
||||
@ -844,7 +844,7 @@ void renderInstancedShadow(const std::vector<GLuint> TextureUnits, unsigned casc
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Shader, MeshMaterial Mat, video::E_VERTEX_TYPE VT, typename...Args>
|
||||
template<typename Shader, Material::ShaderType Mat, video::E_VERTEX_TYPE VT, typename...Args>
|
||||
static void multidrawShadow(unsigned i, Args ...args)
|
||||
{
|
||||
glUseProgram(Shader::getInstance()->Program);
|
||||
@ -892,21 +892,21 @@ void IrrDriver::renderShadows()
|
||||
|
||||
if (UserConfigParams::m_azdo)
|
||||
{
|
||||
multidrawShadow<MeshShader::InstancedShadowShader, MAT_DEFAULT, video::EVT_STANDARD>(cascade);
|
||||
multidrawShadow<MeshShader::InstancedShadowShader, MAT_DETAIL, video::EVT_2TCOORDS>(cascade);
|
||||
multidrawShadow<MeshShader::InstancedShadowShader, MAT_NORMAL_MAP, video::EVT_TANGENTS>(cascade);
|
||||
multidrawShadow<MeshShader::InstancedRefShadowShader, MAT_ALPHA_REF, video::EVT_STANDARD>(cascade);
|
||||
multidrawShadow<MeshShader::InstancedRefShadowShader, MAT_UNLIT, video::EVT_STANDARD>(cascade);
|
||||
multidrawShadow<MeshShader::InstancedGrassShadowShader, MAT_GRASS, video::EVT_STANDARD>(cascade, windDir);
|
||||
multidrawShadow<MeshShader::InstancedShadowShader, Material::SHADERTYPE_SOLID, video::EVT_STANDARD>(cascade);
|
||||
multidrawShadow<MeshShader::InstancedShadowShader, Material::SHADERTYPE_DETAIL_MAP, video::EVT_2TCOORDS>(cascade);
|
||||
multidrawShadow<MeshShader::InstancedShadowShader, Material::SHADERTYPE_NORMAL_MAP, video::EVT_TANGENTS>(cascade);
|
||||
multidrawShadow<MeshShader::InstancedRefShadowShader, Material::SHADERTYPE_ALPHA_TEST, video::EVT_STANDARD>(cascade);
|
||||
multidrawShadow<MeshShader::InstancedRefShadowShader, Material::SHADERTYPE_SOLID_UNLIT, video::EVT_STANDARD>(cascade);
|
||||
multidrawShadow<MeshShader::InstancedGrassShadowShader, Material::SHADERTYPE_VEGETATION, video::EVT_STANDARD>(cascade, windDir);
|
||||
}
|
||||
else if (irr_driver->hasARB_draw_indirect())
|
||||
{
|
||||
renderInstancedShadow<MeshShader::InstancedShadowShader, MAT_DEFAULT, video::EVT_STANDARD>(noTexUnits, cascade, ListInstancedMatDefault::getInstance()->Shadows[cascade]);
|
||||
renderInstancedShadow<MeshShader::InstancedShadowShader, MAT_DETAIL, video::EVT_2TCOORDS>(noTexUnits, cascade, ListInstancedMatDetails::getInstance()->Shadows[cascade]);
|
||||
renderInstancedShadow<MeshShader::InstancedRefShadowShader, MAT_ALPHA_REF, video::EVT_STANDARD>(std::vector < GLuint > { 0 }, cascade, ListInstancedMatAlphaRef::getInstance()->Shadows[cascade]);
|
||||
renderInstancedShadow<MeshShader::InstancedRefShadowShader, MAT_UNLIT, video::EVT_STANDARD>(std::vector < GLuint > { 0 }, cascade, ListInstancedMatUnlit::getInstance()->Shadows[cascade]);
|
||||
renderInstancedShadow<MeshShader::InstancedGrassShadowShader, MAT_GRASS, video::EVT_STANDARD>(std::vector < GLuint > { 0 }, cascade, ListInstancedMatGrass::getInstance()->Shadows[cascade], windDir);
|
||||
renderInstancedShadow<MeshShader::InstancedShadowShader, MAT_NORMAL_MAP, video::EVT_TANGENTS>(noTexUnits, cascade, ListInstancedMatNormalMap::getInstance()->Shadows[cascade]);
|
||||
renderInstancedShadow<MeshShader::InstancedShadowShader, Material::SHADERTYPE_SOLID, video::EVT_STANDARD>(noTexUnits, cascade, ListInstancedMatDefault::getInstance()->Shadows[cascade]);
|
||||
renderInstancedShadow<MeshShader::InstancedShadowShader, Material::SHADERTYPE_DETAIL_MAP, video::EVT_2TCOORDS>(noTexUnits, cascade, ListInstancedMatDetails::getInstance()->Shadows[cascade]);
|
||||
renderInstancedShadow<MeshShader::InstancedRefShadowShader, Material::SHADERTYPE_ALPHA_TEST, video::EVT_STANDARD>(std::vector < GLuint > { 0 }, cascade, ListInstancedMatAlphaRef::getInstance()->Shadows[cascade]);
|
||||
renderInstancedShadow<MeshShader::InstancedRefShadowShader, Material::SHADERTYPE_SOLID_UNLIT, video::EVT_STANDARD>(std::vector < GLuint > { 0 }, cascade, ListInstancedMatUnlit::getInstance()->Shadows[cascade]);
|
||||
renderInstancedShadow<MeshShader::InstancedGrassShadowShader, Material::SHADERTYPE_VEGETATION, video::EVT_STANDARD>(std::vector < GLuint > { 0 }, cascade, ListInstancedMatGrass::getInstance()->Shadows[cascade], windDir);
|
||||
renderInstancedShadow<MeshShader::InstancedShadowShader, Material::SHADERTYPE_NORMAL_MAP, video::EVT_TANGENTS>(noTexUnits, cascade, ListInstancedMatNormalMap::getInstance()->Shadows[cascade]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -957,7 +957,7 @@ void drawRSM(const core::matrix4 & rsm_matrix, const std::vector<GLuint> &Textur
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Shader, MeshMaterial Mat, video::E_VERTEX_TYPE VT, typename...Args>
|
||||
template<typename Shader, Material::ShaderType Mat, video::E_VERTEX_TYPE VT, typename...Args>
|
||||
void renderRSMShadow(const std::vector<GLuint> TextureUnits, const std::vector<GLMesh *> &t, Args ...args)
|
||||
{
|
||||
glUseProgram(Shader::getInstance()->Program);
|
||||
@ -977,7 +977,7 @@ void renderRSMShadow(const std::vector<GLuint> TextureUnits, const std::vector<G
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Shader, MeshMaterial Mat, enum video::E_VERTEX_TYPE VertexType, typename... Args>
|
||||
template<typename Shader, Material::ShaderType Mat, enum video::E_VERTEX_TYPE VertexType, typename... Args>
|
||||
void multidrawRSM(Args...args)
|
||||
{
|
||||
glUseProgram(Shader::getInstance()->Program);
|
||||
@ -1009,18 +1009,18 @@ void IrrDriver::renderRSM()
|
||||
|
||||
if (UserConfigParams::m_azdo)
|
||||
{
|
||||
multidrawRSM<MeshShader::InstancedRSMShader, MAT_DEFAULT, video::EVT_STANDARD>(rsm_matrix);
|
||||
multidrawRSM<MeshShader::InstancedRSMShader, MAT_NORMAL_MAP, video::EVT_TANGENTS>(rsm_matrix);
|
||||
multidrawRSM<MeshShader::InstancedRSMShader, MAT_ALPHA_REF, video::EVT_STANDARD>(rsm_matrix);
|
||||
multidrawRSM<MeshShader::InstancedRSMShader, MAT_UNLIT, video::EVT_STANDARD>(rsm_matrix);
|
||||
multidrawRSM<MeshShader::InstancedRSMShader, MAT_DETAIL, video::EVT_2TCOORDS>(rsm_matrix);
|
||||
multidrawRSM<MeshShader::InstancedRSMShader, Material::SHADERTYPE_SOLID, video::EVT_STANDARD>(rsm_matrix);
|
||||
multidrawRSM<MeshShader::InstancedRSMShader, Material::SHADERTYPE_NORMAL_MAP, video::EVT_TANGENTS>(rsm_matrix);
|
||||
multidrawRSM<MeshShader::InstancedRSMShader, Material::SHADERTYPE_ALPHA_TEST, video::EVT_STANDARD>(rsm_matrix);
|
||||
multidrawRSM<MeshShader::InstancedRSMShader, Material::SHADERTYPE_SOLID_UNLIT, video::EVT_STANDARD>(rsm_matrix);
|
||||
multidrawRSM<MeshShader::InstancedRSMShader, Material::SHADERTYPE_DETAIL_MAP, video::EVT_2TCOORDS>(rsm_matrix);
|
||||
}
|
||||
else if (irr_driver->hasARB_draw_indirect())
|
||||
{
|
||||
renderRSMShadow<MeshShader::InstancedRSMShader, MAT_DEFAULT, video::EVT_STANDARD>(std::vector < GLuint > { 0 }, ListInstancedMatDefault::getInstance()->RSM, rsm_matrix);
|
||||
renderRSMShadow<MeshShader::InstancedRSMShader, MAT_ALPHA_REF, video::EVT_STANDARD>(std::vector < GLuint > { 0 }, ListInstancedMatAlphaRef::getInstance()->RSM, rsm_matrix);
|
||||
renderRSMShadow<MeshShader::InstancedRSMShader, MAT_UNLIT, video::EVT_STANDARD>(std::vector < GLuint > { 0 }, ListInstancedMatUnlit::getInstance()->RSM, rsm_matrix);
|
||||
renderRSMShadow<MeshShader::InstancedRSMShader, MAT_NORMAL_MAP, video::EVT_TANGENTS>(std::vector < GLuint > { 0 }, ListInstancedMatNormalMap::getInstance()->RSM, rsm_matrix);
|
||||
renderRSMShadow<MeshShader::InstancedRSMShader, MAT_DETAIL, video::EVT_2TCOORDS>(std::vector < GLuint > { 0 }, ListInstancedMatDetails::getInstance()->RSM, rsm_matrix);
|
||||
renderRSMShadow<MeshShader::InstancedRSMShader, Material::SHADERTYPE_SOLID, video::EVT_STANDARD>(std::vector < GLuint > { 0 }, ListInstancedMatDefault::getInstance()->RSM, rsm_matrix);
|
||||
renderRSMShadow<MeshShader::InstancedRSMShader, Material::SHADERTYPE_ALPHA_TEST, video::EVT_STANDARD>(std::vector < GLuint > { 0 }, ListInstancedMatAlphaRef::getInstance()->RSM, rsm_matrix);
|
||||
renderRSMShadow<MeshShader::InstancedRSMShader, Material::SHADERTYPE_SOLID_UNLIT, video::EVT_STANDARD>(std::vector < GLuint > { 0 }, ListInstancedMatUnlit::getInstance()->RSM, rsm_matrix);
|
||||
renderRSMShadow<MeshShader::InstancedRSMShader, Material::SHADERTYPE_NORMAL_MAP, video::EVT_TANGENTS>(std::vector < GLuint > { 0 }, ListInstancedMatNormalMap::getInstance()->RSM, rsm_matrix);
|
||||
renderRSMShadow<MeshShader::InstancedRSMShader, Material::SHADERTYPE_DETAIL_MAP, video::EVT_2TCOORDS>(std::vector < GLuint > { 0 }, ListInstancedMatDetails::getInstance()->RSM, rsm_matrix);
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ void STKAnimatedMesh::cleanGLMeshes()
|
||||
glDeleteBuffers(1, &(mesh.index_buffer));
|
||||
}
|
||||
GLmeshes.clear();
|
||||
for (unsigned i = 0; i < MAT_COUNT; i++)
|
||||
for (unsigned i = 0; i < Material::SHADERTYPE_COUNT; i++)
|
||||
MeshSolidMaterial[i].clearWithoutDeleting();
|
||||
for (unsigned i = 0; i < TM_COUNT; i++)
|
||||
TransparentMesh[i].clearWithoutDeleting();
|
||||
@ -105,7 +105,7 @@ void STKAnimatedMesh::updateNoGL()
|
||||
}
|
||||
else
|
||||
{
|
||||
MeshMaterial MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material);
|
||||
Material::ShaderType MatType = material->getShaderType();// MaterialTypeToMeshMaterial(type, mb->getVertexType(), material);
|
||||
MeshSolidMaterial[MatType].push_back(&mesh);
|
||||
}
|
||||
}
|
||||
@ -142,7 +142,7 @@ void STKAnimatedMesh::updateGL()
|
||||
if (!rnd->isTransparent())
|
||||
{
|
||||
Material* material = material_manager->getMaterialFor(mb->getMaterial().getTexture(0), mb);
|
||||
MeshMaterial MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material);
|
||||
Material::ShaderType MatType = material->getShaderType();// MaterialTypeToMeshMaterial(type, mb->getVertexType(), material);
|
||||
InitTextures(mesh, MatType);
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "graphics/camera.hpp"
|
||||
#include "modes/world.hpp"
|
||||
|
||||
/*
|
||||
MeshMaterial MaterialTypeToMeshMaterial(video::E_MATERIAL_TYPE MaterialType, video::E_VERTEX_TYPE tp, Material* material)
|
||||
{
|
||||
switch (material->getShaderType())
|
||||
@ -31,8 +32,8 @@ MeshMaterial MaterialTypeToMeshMaterial(video::E_MATERIAL_TYPE MaterialType, vid
|
||||
return MAT_DETAIL;
|
||||
return MAT_DEFAULT;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
TransparentMaterial MaterialTypeToTransparentMaterial(video::E_MATERIAL_TYPE type, f32 MaterialTypeParam, Material* material)
|
||||
{
|
||||
@ -299,26 +300,26 @@ SetTexture(GLMesh &mesh, unsigned i, bool isSrgb)
|
||||
}
|
||||
}
|
||||
|
||||
void InitTextures(GLMesh &mesh, MeshMaterial Mat)
|
||||
void InitTextures(GLMesh &mesh, Material::ShaderType Mat)
|
||||
{
|
||||
switch (Mat)
|
||||
{
|
||||
default:
|
||||
case MAT_DEFAULT:
|
||||
case MAT_ALPHA_REF:
|
||||
case MAT_GRASS:
|
||||
case MAT_SPHEREMAP:
|
||||
case MAT_UNLIT:
|
||||
case Material::SHADERTYPE_SOLID:
|
||||
case Material::SHADERTYPE_ALPHA_TEST:
|
||||
case Material::SHADERTYPE_VEGETATION:
|
||||
case Material::SHADERTYPE_SPHERE_MAP:
|
||||
case Material::SHADERTYPE_SOLID_UNLIT:
|
||||
SetTexture(mesh, 0, true);
|
||||
SetTexture(mesh, 1, false);
|
||||
break;
|
||||
case MAT_DETAIL:
|
||||
case MAT_NORMAL_MAP:
|
||||
case Material::SHADERTYPE_DETAIL_MAP:
|
||||
case Material::SHADERTYPE_NORMAL_MAP:
|
||||
SetTexture(mesh, 0, true);
|
||||
SetTexture(mesh, 1, false);
|
||||
SetTexture(mesh, 2, false);
|
||||
break;
|
||||
case MAT_SPLATTING:
|
||||
case Material::SHADERTYPE_SPLATTING:
|
||||
SetTexture(mesh, 0, true);
|
||||
SetTexture(mesh, 1, false);
|
||||
SetTexture(mesh, 2, true);
|
||||
|
@ -9,22 +9,10 @@
|
||||
#include "../lib/irrlicht/source/Irrlicht/CMeshSceneNode.h"
|
||||
|
||||
#include <vector>
|
||||
#include "material.hpp"
|
||||
|
||||
class Material;
|
||||
|
||||
enum MeshMaterial
|
||||
{
|
||||
MAT_DEFAULT,
|
||||
MAT_ALPHA_REF,
|
||||
MAT_NORMAL_MAP,
|
||||
MAT_GRASS,
|
||||
MAT_SPHEREMAP,
|
||||
MAT_SPLATTING,
|
||||
MAT_UNLIT,
|
||||
MAT_DETAIL,
|
||||
MAT_COUNT
|
||||
};
|
||||
|
||||
enum TransparentMaterial
|
||||
{
|
||||
TM_DEFAULT,
|
||||
@ -67,7 +55,7 @@ protected:
|
||||
bool m_culledForShadowCam[4];
|
||||
bool m_culledForRSMCam;
|
||||
public:
|
||||
PtrVector<GLMesh, REF> MeshSolidMaterial[MAT_COUNT];
|
||||
PtrVector<GLMesh, REF> MeshSolidMaterial[Material::SHADERTYPE_COUNT];
|
||||
PtrVector<GLMesh, REF> TransparentMesh[TM_COUNT];
|
||||
virtual void updateNoGL() = 0;
|
||||
virtual void updateGL() = 0;
|
||||
@ -186,9 +174,8 @@ class ListDisplacement : public MiscList<ListDisplacement, GLMesh *, core::matri
|
||||
class ListInstancedGlow : public Singleton<ListInstancedGlow>, public std::vector<GLMesh *>
|
||||
{};
|
||||
|
||||
MeshMaterial MaterialTypeToMeshMaterial(video::E_MATERIAL_TYPE, video::E_VERTEX_TYPE, Material* material);
|
||||
TransparentMaterial MaterialTypeToTransparentMaterial(video::E_MATERIAL_TYPE, f32 MaterialTypeParam, Material* material);
|
||||
|
||||
void InitTextures(GLMesh &mesh, MeshMaterial);
|
||||
void InitTextures(GLMesh &mesh, Material::ShaderType);
|
||||
|
||||
#endif // STKMESH_H
|
||||
|
@ -62,7 +62,7 @@ void STKMeshSceneNode::cleanGLMeshes()
|
||||
glDeleteBuffers(1, &(mesh.index_buffer));
|
||||
}
|
||||
GLmeshes.clear();
|
||||
for (unsigned i = 0; i < MAT_COUNT; i++)
|
||||
for (unsigned i = 0; i < Material::SHADERTYPE_COUNT; i++)
|
||||
MeshSolidMaterial[i].clearWithoutDeleting();
|
||||
for (unsigned i = 0; i < TM_COUNT; i++)
|
||||
TransparentMesh[i].clearWithoutDeleting();
|
||||
@ -143,7 +143,7 @@ void STKMeshSceneNode::updateNoGL()
|
||||
else
|
||||
{
|
||||
assert(!isDisplacement);
|
||||
MeshMaterial MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material);
|
||||
Material::ShaderType MatType = material->getShaderType();// MaterialTypeToMeshMaterial(type, mb->getVertexType(), material);
|
||||
if (!immediate_draw)
|
||||
MeshSolidMaterial[MatType].push_back(&mesh);
|
||||
}
|
||||
@ -179,7 +179,7 @@ void STKMeshSceneNode::updateGL()
|
||||
if (!rnd->isTransparent())
|
||||
{
|
||||
Material* material = material_manager->getMaterialFor(mb->getMaterial().getTexture(0), mb);
|
||||
MeshMaterial MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material);
|
||||
Material::ShaderType MatType = material->getShaderType();// MaterialTypeToMeshMaterial(type, mb->getVertexType(), material);
|
||||
if (!immediate_draw)
|
||||
InitTextures(mesh, MatType);
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ void FillInstances(const std::unordered_map<scene::IMeshBuffer *, std::vector<st
|
||||
}
|
||||
}
|
||||
|
||||
static std::unordered_map <scene::IMeshBuffer *, std::vector<std::pair<GLMesh *, scene::ISceneNode*> > > MeshForSolidPass[MAT_COUNT];
|
||||
static std::unordered_map <scene::IMeshBuffer *, std::vector<std::pair<GLMesh *, scene::ISceneNode*> > > MeshForSolidPass[Material::SHADERTYPE_COUNT];
|
||||
static std::unordered_map <scene::IMeshBuffer *, std::vector<std::pair<GLMesh *, scene::ISceneNode*> > > MeshForGlowPass;
|
||||
static std::vector <STKMeshCommon *> DeferredUpdate;
|
||||
|
||||
@ -248,7 +248,7 @@ handleSTKCommon(scene::ISceneNode *Node, std::vector<scene::ISceneNode *> *Immed
|
||||
for_in(mesh, node->TransparentMesh[TM_DISPLACEMENT])
|
||||
pushVector(ListDisplacement::getInstance(), mesh, Node->getAbsoluteTransformation());
|
||||
|
||||
for (unsigned Mat = 0; Mat < MAT_COUNT; ++Mat)
|
||||
for (unsigned Mat = 0; Mat < Material::SHADERTYPE_COUNT; ++Mat)
|
||||
{
|
||||
if (irr_driver->hasARB_draw_indirect())
|
||||
{
|
||||
@ -257,7 +257,7 @@ handleSTKCommon(scene::ISceneNode *Node, std::vector<scene::ISceneNode *> *Immed
|
||||
if (node->glow())
|
||||
MeshForGlowPass[mesh->mb].emplace_back(mesh, Node);
|
||||
|
||||
if (Mat != MAT_SPLATTING && mesh->TextureMatrix.isIdentity())
|
||||
if (Mat != Material::SHADERTYPE_SPLATTING && mesh->TextureMatrix.isIdentity())
|
||||
MeshForSolidPass[Mat][mesh->mb].emplace_back(mesh, Node);
|
||||
else
|
||||
{
|
||||
@ -265,16 +265,16 @@ handleSTKCommon(scene::ISceneNode *Node, std::vector<scene::ISceneNode *> *Immed
|
||||
ModelMatrix.getInverse(InvModelMatrix);
|
||||
switch (Mat)
|
||||
{
|
||||
case MAT_DEFAULT:
|
||||
case Material::SHADERTYPE_SOLID:
|
||||
ListMatDefault::getInstance()->SolidPass.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_ALPHA_REF:
|
||||
case Material::SHADERTYPE_ALPHA_TEST:
|
||||
ListMatAlphaRef::getInstance()->SolidPass.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_UNLIT:
|
||||
case Material::SHADERTYPE_SOLID_UNLIT:
|
||||
ListMatUnlit::getInstance()->SolidPass.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_SPLATTING:
|
||||
case Material::SHADERTYPE_SPLATTING:
|
||||
ListMatSplatting::getInstance()->SolidPass.emplace_back(mesh, ModelMatrix, InvModelMatrix);
|
||||
break;
|
||||
}
|
||||
@ -292,28 +292,28 @@ handleSTKCommon(scene::ISceneNode *Node, std::vector<scene::ISceneNode *> *Immed
|
||||
{
|
||||
switch (Mat)
|
||||
{
|
||||
case MAT_DEFAULT:
|
||||
case Material::SHADERTYPE_SOLID:
|
||||
ListMatDefault::getInstance()->SolidPass.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_ALPHA_REF:
|
||||
case Material::SHADERTYPE_ALPHA_TEST:
|
||||
ListMatAlphaRef::getInstance()->SolidPass.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_NORMAL_MAP:
|
||||
case Material::SHADERTYPE_NORMAL_MAP:
|
||||
ListMatNormalMap::getInstance()->SolidPass.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_DETAIL:
|
||||
case Material::SHADERTYPE_DETAIL_MAP:
|
||||
ListMatDetails::getInstance()->SolidPass.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_UNLIT:
|
||||
case Material::SHADERTYPE_SOLID_UNLIT:
|
||||
ListMatUnlit::getInstance()->SolidPass.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_SPHEREMAP:
|
||||
case Material::SHADERTYPE_SPHERE_MAP:
|
||||
ListMatSphereMap::getInstance()->SolidPass.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_SPLATTING:
|
||||
case Material::SHADERTYPE_SPLATTING:
|
||||
ListMatSplatting::getInstance()->SolidPass.emplace_back(mesh, ModelMatrix, InvModelMatrix);
|
||||
break;
|
||||
case MAT_GRASS:
|
||||
case Material::SHADERTYPE_VEGETATION:
|
||||
ListMatGrass::getInstance()->SolidPass.emplace_back(mesh, ModelMatrix, InvModelMatrix, windDir);
|
||||
break;
|
||||
}
|
||||
@ -322,7 +322,7 @@ handleSTKCommon(scene::ISceneNode *Node, std::vector<scene::ISceneNode *> *Immed
|
||||
}
|
||||
if (!UserConfigParams::m_shadows)
|
||||
return;
|
||||
for (unsigned Mat = 0; Mat < MAT_COUNT; ++Mat)
|
||||
for (unsigned Mat = 0; Mat < Material::SHADERTYPE_COUNT; ++Mat)
|
||||
{
|
||||
for (unsigned cascade = 0; cascade < 4; ++cascade)
|
||||
{
|
||||
@ -337,28 +337,28 @@ handleSTKCommon(scene::ISceneNode *Node, std::vector<scene::ISceneNode *> *Immed
|
||||
{
|
||||
switch (Mat)
|
||||
{
|
||||
case MAT_DEFAULT:
|
||||
case Material::SHADERTYPE_SOLID:
|
||||
ListMatDefault::getInstance()->Shadows[cascade].emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_ALPHA_REF:
|
||||
case Material::SHADERTYPE_ALPHA_TEST:
|
||||
ListMatAlphaRef::getInstance()->Shadows[cascade].emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_NORMAL_MAP:
|
||||
case Material::SHADERTYPE_NORMAL_MAP:
|
||||
ListMatNormalMap::getInstance()->Shadows[cascade].emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_DETAIL:
|
||||
case Material::SHADERTYPE_DETAIL_MAP:
|
||||
ListMatDetails::getInstance()->Shadows[cascade].emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_UNLIT:
|
||||
case Material::SHADERTYPE_SOLID_UNLIT:
|
||||
ListMatUnlit::getInstance()->Shadows[cascade].emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_SPHEREMAP:
|
||||
case Material::SHADERTYPE_SPHERE_MAP:
|
||||
ListMatSphereMap::getInstance()->Shadows[cascade].emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_SPLATTING:
|
||||
case Material::SHADERTYPE_SPLATTING:
|
||||
ListMatSplatting::getInstance()->Shadows[cascade].emplace_back(mesh, ModelMatrix, InvModelMatrix);
|
||||
break;
|
||||
case MAT_GRASS:
|
||||
case Material::SHADERTYPE_VEGETATION:
|
||||
ListMatGrass::getInstance()->Shadows[cascade].emplace_back(mesh, ModelMatrix, InvModelMatrix, windDir);
|
||||
}
|
||||
}
|
||||
@ -367,11 +367,11 @@ handleSTKCommon(scene::ISceneNode *Node, std::vector<scene::ISceneNode *> *Immed
|
||||
}
|
||||
if (!UserConfigParams::m_gi)
|
||||
return;
|
||||
for (unsigned Mat = 0; Mat < MAT_COUNT; ++Mat)
|
||||
for (unsigned Mat = 0; Mat < Material::SHADERTYPE_COUNT; ++Mat)
|
||||
{
|
||||
if (irr_driver->hasARB_draw_indirect())
|
||||
{
|
||||
if (Mat == MAT_SPLATTING)
|
||||
if (Mat == Material::SHADERTYPE_SPLATTING)
|
||||
for_in(mesh, node->MeshSolidMaterial[Mat])
|
||||
{
|
||||
core::matrix4 ModelMatrix = Node->getAbsoluteTransformation(), InvModelMatrix;
|
||||
@ -390,28 +390,28 @@ handleSTKCommon(scene::ISceneNode *Node, std::vector<scene::ISceneNode *> *Immed
|
||||
{
|
||||
switch (Mat)
|
||||
{
|
||||
case MAT_DEFAULT:
|
||||
case Material::SHADERTYPE_SOLID:
|
||||
ListMatDefault::getInstance()->RSM.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_ALPHA_REF:
|
||||
case Material::SHADERTYPE_ALPHA_TEST:
|
||||
ListMatAlphaRef::getInstance()->RSM.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_NORMAL_MAP:
|
||||
case Material::SHADERTYPE_NORMAL_MAP:
|
||||
ListMatNormalMap::getInstance()->RSM.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_DETAIL:
|
||||
case Material::SHADERTYPE_DETAIL_MAP:
|
||||
ListMatDetails::getInstance()->RSM.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_UNLIT:
|
||||
case Material::SHADERTYPE_SOLID_UNLIT:
|
||||
ListMatUnlit::getInstance()->RSM.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_SPHEREMAP:
|
||||
case Material::SHADERTYPE_SPHERE_MAP:
|
||||
ListMatSphereMap::getInstance()->RSM.emplace_back(mesh, ModelMatrix, InvModelMatrix, mesh->TextureMatrix);
|
||||
break;
|
||||
case MAT_SPLATTING:
|
||||
case Material::SHADERTYPE_SPLATTING:
|
||||
ListMatSplatting::getInstance()->RSM.emplace_back(mesh, ModelMatrix, InvModelMatrix);
|
||||
break;
|
||||
case MAT_GRASS:
|
||||
case Material::SHADERTYPE_VEGETATION:
|
||||
ListMatGrass::getInstance()->RSM.emplace_back(mesh, ModelMatrix, InvModelMatrix, windDir);
|
||||
break;
|
||||
}
|
||||
@ -453,7 +453,7 @@ parseSceneManager(core::list<scene::ISceneNode*> List, std::vector<scene::IScene
|
||||
}
|
||||
}
|
||||
|
||||
template<MeshMaterial Mat, typename T> static void
|
||||
template<Material::ShaderType Mat, typename T> static void
|
||||
GenDrawCalls(unsigned cascade, std::vector<GLMesh *> &InstancedList,
|
||||
T *InstanceBuffer, DrawElementsIndirectCommand *CommandBuffer, size_t &InstanceBufferOffset, size_t &CommandBufferOffset, size_t &PolyCount)
|
||||
{
|
||||
@ -490,7 +490,7 @@ void IrrDriver::PrepareDrawCalls(scene::ICameraSceneNode *camnode)
|
||||
ParticlesList::getInstance()->clear();
|
||||
ListInstancedGlow::getInstance()->clear();
|
||||
|
||||
for (unsigned Mat = 0; Mat < MAT_COUNT; ++Mat)
|
||||
for (unsigned Mat = 0; Mat < Material::SHADERTYPE_COUNT; ++Mat)
|
||||
MeshForSolidPass[Mat].clear();
|
||||
MeshForGlowPass.clear();
|
||||
DeferredUpdate.clear();
|
||||
@ -595,25 +595,25 @@ void IrrDriver::PrepareDrawCalls(scene::ICameraSceneNode *camnode)
|
||||
|
||||
|
||||
// Default Material
|
||||
SolidPassCmd::getInstance()->Offset[MAT_DEFAULT] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[MAT_DEFAULT], ListInstancedMatDefault::getInstance()->SolidPass, InstanceBufferDualTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[MAT_DEFAULT] = current_cmd - SolidPassCmd::getInstance()->Offset[MAT_DEFAULT];
|
||||
SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_SOLID] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_SOLID], ListInstancedMatDefault::getInstance()->SolidPass, InstanceBufferDualTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[Material::SHADERTYPE_SOLID] = current_cmd - SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_SOLID];
|
||||
// Alpha Ref
|
||||
SolidPassCmd::getInstance()->Offset[MAT_ALPHA_REF] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[MAT_ALPHA_REF], ListInstancedMatAlphaRef::getInstance()->SolidPass, InstanceBufferDualTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[MAT_ALPHA_REF] = current_cmd - SolidPassCmd::getInstance()->Offset[MAT_ALPHA_REF];
|
||||
SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_ALPHA_TEST] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_ALPHA_TEST], ListInstancedMatAlphaRef::getInstance()->SolidPass, InstanceBufferDualTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[Material::SHADERTYPE_ALPHA_TEST] = current_cmd - SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_ALPHA_TEST];
|
||||
// Unlit
|
||||
SolidPassCmd::getInstance()->Offset[MAT_UNLIT] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[MAT_UNLIT], ListInstancedMatUnlit::getInstance()->SolidPass, InstanceBufferDualTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[MAT_UNLIT] = current_cmd - SolidPassCmd::getInstance()->Offset[MAT_UNLIT];
|
||||
SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_SOLID_UNLIT] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_SOLID_UNLIT], ListInstancedMatUnlit::getInstance()->SolidPass, InstanceBufferDualTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[Material::SHADERTYPE_SOLID_UNLIT] = current_cmd - SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_SOLID_UNLIT];
|
||||
// Spheremap
|
||||
SolidPassCmd::getInstance()->Offset[MAT_SPHEREMAP] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[MAT_SPHEREMAP], ListInstancedMatSphereMap::getInstance()->SolidPass, InstanceBufferDualTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[MAT_SPHEREMAP] = current_cmd - SolidPassCmd::getInstance()->Offset[MAT_SPHEREMAP];
|
||||
SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_SPHERE_MAP] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_SPHERE_MAP], ListInstancedMatSphereMap::getInstance()->SolidPass, InstanceBufferDualTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[Material::SHADERTYPE_SPHERE_MAP] = current_cmd - SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_SPHERE_MAP];
|
||||
// Grass
|
||||
SolidPassCmd::getInstance()->Offset[MAT_GRASS] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[MAT_GRASS], ListInstancedMatGrass::getInstance()->SolidPass, InstanceBufferDualTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[MAT_GRASS] = current_cmd - SolidPassCmd::getInstance()->Offset[MAT_GRASS];
|
||||
SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_VEGETATION] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_VEGETATION], ListInstancedMatGrass::getInstance()->SolidPass, InstanceBufferDualTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[Material::SHADERTYPE_VEGETATION] = current_cmd - SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_VEGETATION];
|
||||
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
{
|
||||
@ -624,13 +624,13 @@ void IrrDriver::PrepareDrawCalls(scene::ICameraSceneNode *camnode)
|
||||
}
|
||||
|
||||
// Detail
|
||||
SolidPassCmd::getInstance()->Offset[MAT_DETAIL] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[MAT_DETAIL], ListInstancedMatDetails::getInstance()->SolidPass, InstanceBufferThreeTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[MAT_DETAIL] = current_cmd - SolidPassCmd::getInstance()->Offset[MAT_DETAIL];
|
||||
SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_DETAIL_MAP] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_DETAIL_MAP], ListInstancedMatDetails::getInstance()->SolidPass, InstanceBufferThreeTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[Material::SHADERTYPE_DETAIL_MAP] = current_cmd - SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_DETAIL_MAP];
|
||||
// Normal Map
|
||||
SolidPassCmd::getInstance()->Offset[MAT_NORMAL_MAP] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[MAT_NORMAL_MAP], ListInstancedMatNormalMap::getInstance()->SolidPass, InstanceBufferThreeTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[MAT_NORMAL_MAP] = current_cmd - SolidPassCmd::getInstance()->Offset[MAT_NORMAL_MAP];
|
||||
SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_NORMAL_MAP] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_NORMAL_MAP], ListInstancedMatNormalMap::getInstance()->SolidPass, InstanceBufferThreeTex, CmdBuffer, offset, current_cmd, SolidPoly, playercamculling);
|
||||
SolidPassCmd::getInstance()->Size[Material::SHADERTYPE_NORMAL_MAP] = current_cmd - SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_NORMAL_MAP];
|
||||
|
||||
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
@ -689,19 +689,19 @@ void IrrDriver::PrepareDrawCalls(scene::ICameraSceneNode *camnode)
|
||||
for (unsigned i = 0; i < 4; i++)
|
||||
{
|
||||
// Mat default
|
||||
GenDrawCalls<MAT_DEFAULT>(i, ListInstancedMatDefault::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
GenDrawCalls<Material::SHADERTYPE_SOLID>(i, ListInstancedMatDefault::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
// Mat AlphaRef
|
||||
GenDrawCalls<MAT_ALPHA_REF>(i, ListInstancedMatAlphaRef::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
GenDrawCalls<Material::SHADERTYPE_ALPHA_TEST>(i, ListInstancedMatAlphaRef::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
// Mat Unlit
|
||||
GenDrawCalls<MAT_UNLIT>(i, ListInstancedMatUnlit::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
GenDrawCalls<Material::SHADERTYPE_SOLID_UNLIT>(i, ListInstancedMatUnlit::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
// Mat NormalMap
|
||||
GenDrawCalls<MAT_NORMAL_MAP>(i, ListInstancedMatNormalMap::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
GenDrawCalls<Material::SHADERTYPE_NORMAL_MAP>(i, ListInstancedMatNormalMap::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
// Mat Spheremap
|
||||
GenDrawCalls<MAT_SPHEREMAP>(i, ListInstancedMatSphereMap::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
GenDrawCalls<Material::SHADERTYPE_SPHERE_MAP>(i, ListInstancedMatSphereMap::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
// Mat Detail
|
||||
GenDrawCalls<MAT_DETAIL>(i, ListInstancedMatDetails::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
GenDrawCalls<Material::SHADERTYPE_DETAIL_MAP>(i, ListInstancedMatDetails::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
// Mat Grass
|
||||
GenDrawCalls<MAT_GRASS>(i, ListInstancedMatGrass::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
GenDrawCalls<Material::SHADERTYPE_VEGETATION>(i, ListInstancedMatGrass::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
}
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
{
|
||||
@ -722,25 +722,25 @@ void IrrDriver::PrepareDrawCalls(scene::ICameraSceneNode *camnode)
|
||||
}
|
||||
|
||||
// Default Material
|
||||
RSMPassCmd::getInstance()->Offset[MAT_DEFAULT] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[MAT_DEFAULT], ListInstancedMatDefault::getInstance()->RSM, RSMInstanceBuffer, RSMCmdBuffer, offset, current_cmd, MiscPoly, rsmcamculling);
|
||||
RSMPassCmd::getInstance()->Size[MAT_DEFAULT] = current_cmd - RSMPassCmd::getInstance()->Offset[MAT_DEFAULT];
|
||||
RSMPassCmd::getInstance()->Offset[Material::SHADERTYPE_SOLID] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_SOLID], ListInstancedMatDefault::getInstance()->RSM, RSMInstanceBuffer, RSMCmdBuffer, offset, current_cmd, MiscPoly, rsmcamculling);
|
||||
RSMPassCmd::getInstance()->Size[Material::SHADERTYPE_SOLID] = current_cmd - RSMPassCmd::getInstance()->Offset[Material::SHADERTYPE_SOLID];
|
||||
// Alpha Ref
|
||||
RSMPassCmd::getInstance()->Offset[MAT_ALPHA_REF] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[MAT_ALPHA_REF], ListInstancedMatAlphaRef::getInstance()->RSM, RSMInstanceBuffer, RSMCmdBuffer, offset, current_cmd, MiscPoly, rsmcamculling);
|
||||
RSMPassCmd::getInstance()->Size[MAT_ALPHA_REF] = current_cmd - RSMPassCmd::getInstance()->Offset[MAT_ALPHA_REF];
|
||||
RSMPassCmd::getInstance()->Offset[Material::SHADERTYPE_ALPHA_TEST] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_ALPHA_TEST], ListInstancedMatAlphaRef::getInstance()->RSM, RSMInstanceBuffer, RSMCmdBuffer, offset, current_cmd, MiscPoly, rsmcamculling);
|
||||
RSMPassCmd::getInstance()->Size[Material::SHADERTYPE_ALPHA_TEST] = current_cmd - RSMPassCmd::getInstance()->Offset[Material::SHADERTYPE_ALPHA_TEST];
|
||||
// Unlit
|
||||
RSMPassCmd::getInstance()->Offset[MAT_UNLIT] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[MAT_UNLIT], ListInstancedMatUnlit::getInstance()->RSM, RSMInstanceBuffer, RSMCmdBuffer, offset, current_cmd, MiscPoly, rsmcamculling);
|
||||
RSMPassCmd::getInstance()->Size[MAT_UNLIT] = current_cmd - RSMPassCmd::getInstance()->Offset[MAT_UNLIT];
|
||||
RSMPassCmd::getInstance()->Offset[Material::SHADERTYPE_SOLID_UNLIT] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_SOLID_UNLIT], ListInstancedMatUnlit::getInstance()->RSM, RSMInstanceBuffer, RSMCmdBuffer, offset, current_cmd, MiscPoly, rsmcamculling);
|
||||
RSMPassCmd::getInstance()->Size[Material::SHADERTYPE_SOLID_UNLIT] = current_cmd - RSMPassCmd::getInstance()->Offset[Material::SHADERTYPE_SOLID_UNLIT];
|
||||
// Detail
|
||||
RSMPassCmd::getInstance()->Offset[MAT_DETAIL] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[MAT_DETAIL], ListInstancedMatDetails::getInstance()->RSM, RSMInstanceBuffer, RSMCmdBuffer, offset, current_cmd, MiscPoly, rsmcamculling);
|
||||
RSMPassCmd::getInstance()->Size[MAT_DETAIL] = current_cmd - RSMPassCmd::getInstance()->Offset[MAT_DETAIL];
|
||||
RSMPassCmd::getInstance()->Offset[Material::SHADERTYPE_DETAIL_MAP] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_DETAIL_MAP], ListInstancedMatDetails::getInstance()->RSM, RSMInstanceBuffer, RSMCmdBuffer, offset, current_cmd, MiscPoly, rsmcamculling);
|
||||
RSMPassCmd::getInstance()->Size[Material::SHADERTYPE_DETAIL_MAP] = current_cmd - RSMPassCmd::getInstance()->Offset[Material::SHADERTYPE_DETAIL_MAP];
|
||||
// Normal Map
|
||||
RSMPassCmd::getInstance()->Offset[MAT_NORMAL_MAP] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[MAT_NORMAL_MAP], ListInstancedMatNormalMap::getInstance()->RSM, RSMInstanceBuffer, RSMCmdBuffer, offset, current_cmd, MiscPoly, rsmcamculling);
|
||||
RSMPassCmd::getInstance()->Size[MAT_NORMAL_MAP] = current_cmd - RSMPassCmd::getInstance()->Offset[MAT_NORMAL_MAP];
|
||||
RSMPassCmd::getInstance()->Offset[Material::SHADERTYPE_NORMAL_MAP] = current_cmd;
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_NORMAL_MAP], ListInstancedMatNormalMap::getInstance()->RSM, RSMInstanceBuffer, RSMCmdBuffer, offset, current_cmd, MiscPoly, rsmcamculling);
|
||||
RSMPassCmd::getInstance()->Size[Material::SHADERTYPE_NORMAL_MAP] = current_cmd - RSMPassCmd::getInstance()->Offset[Material::SHADERTYPE_NORMAL_MAP];
|
||||
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
{
|
||||
|
@ -45,19 +45,19 @@ class ParticlesList : public Singleton<ParticlesList>, public std::vector<Partic
|
||||
class SolidPassCmd : public CommandBuffer<SolidPassCmd>
|
||||
{
|
||||
public:
|
||||
size_t Offset[MAT_COUNT], Size[MAT_COUNT];
|
||||
size_t Offset[Material::SHADERTYPE_COUNT], Size[Material::SHADERTYPE_COUNT];
|
||||
};
|
||||
|
||||
class ShadowPassCmd : public CommandBuffer<ShadowPassCmd>
|
||||
{
|
||||
public:
|
||||
size_t Offset[4][MAT_COUNT], Size[4][MAT_COUNT];
|
||||
size_t Offset[4][Material::SHADERTYPE_COUNT], Size[4][Material::SHADERTYPE_COUNT];
|
||||
};
|
||||
|
||||
class RSMPassCmd : public CommandBuffer<RSMPassCmd>
|
||||
{
|
||||
public:
|
||||
size_t Offset[MAT_COUNT], Size[MAT_COUNT];
|
||||
size_t Offset[Material::SHADERTYPE_COUNT], Size[Material::SHADERTYPE_COUNT];
|
||||
};
|
||||
|
||||
class GlowPassCmd : public CommandBuffer<GlowPassCmd>
|
||||
|
Loading…
Reference in New Issue
Block a user