Shaders:Clean some dead code

This commit is contained in:
Vincent Lejeune 2014-02-02 20:34:47 +01:00
parent cd43ee3c9d
commit 541edc76a0
6 changed files with 9 additions and 66 deletions

View File

@ -254,13 +254,6 @@ void ColorizeProvider::OnSetConstants(IMaterialRendererServices *srv, int)
//-------------------------------------
void GlowProvider::OnSetConstants(IMaterialRendererServices *srv, int)
{
srv->setVertexShaderConstant("res", m_res, 2);
}
//-------------------------------------
void ObjectPassProvider::OnSetConstants(IMaterialRendererServices *srv, int)
{
core::matrix4 ModelViewProjectionMatrix = srv->getVideoDriver()->getTransform(ETS_PROJECTION);

View File

@ -328,23 +328,6 @@ private:
//
class GlowProvider: public CallBase
{
public:
virtual void OnSetConstants(video::IMaterialRendererServices *srv, int);
void setResolution(int x, int y)
{
m_res[0] = (float)x;
m_res[1] = (float)y;
}
private:
float m_res[2];
};
//
class ObjectPassProvider: public CallBase
{
public:

View File

@ -39,15 +39,6 @@ GlowNode::GlowNode(scene::ISceneManager* mgr, float radius): ISceneNode(mgr->get
{
if (!sphere)
{
mat.Lighting = false;
mat.MaterialType = irr_driver->getShader(ES_GLOW);
mat.setTexture(0, irr_driver->getRTT(RTT_QUARTER1));
mat.TextureLayer[0].TextureWrapU =
mat.TextureLayer[0].TextureWrapV = ETC_CLAMP_TO_EDGE;
mat.setFlag(EMF_TRILINEAR_FILTER, true);
mat.BlendOperation = EBO_ADD;
sphere = mgr->getGeometryCreator()->createSphereMesh(1, 4, 4);
box = sphere->getBoundingBox();
}
@ -65,10 +56,5 @@ void GlowNode::render()
void GlowNode::OnRegisterSceneNode()
{
if (IsVisible)
{
SceneManager->registerNodeForRendering(this, ESNRP_TRANSPARENT);
}
ISceneNode::OnRegisterSceneNode();
}

View File

@ -640,10 +640,6 @@ void IrrDriver::renderGlow(video::SOverrideMaterial &overridemat,
const u32 glowcount = glows.size();
ColorizeProvider * const cb = (ColorizeProvider *) m_shaders->m_callbacks[ES_COLORIZE];
GlowProvider * const glowcb = (GlowProvider *) m_shaders->m_callbacks[ES_GLOW];
glowcb->setResolution(UserConfigParams::m_width,
UserConfigParams::m_height);
/* overridemat.Material.MaterialType = m_shaders->getShader(ES_COLORIZE);
overridemat.EnableFlags = video::EMF_MATERIAL_TYPE;
overridemat.EnablePasses = scene::ESNRP_SOLID;

View File

@ -40,8 +40,6 @@ Shaders::Shaders()
m_callbacks[ES_GAUSSIAN3V] = m_callbacks[ES_GAUSSIAN3H] = new GaussianBlurProvider();
m_callbacks[ES_MIPVIZ] = new MipVizProvider();
m_callbacks[ES_COLORIZE] = new ColorizeProvider();
m_callbacks[ES_GLOW] = new GlowProvider();
m_callbacks[ES_OBJECTPASS] = new ObjectPassProvider();
m_callbacks[ES_SUNLIGHT] = new SunLightProvider();
m_callbacks[ES_MLAA_COLOR1] = new MLAAColor1Provider();
m_callbacks[ES_MLAA_BLEND2] = new MLAABlend2Provider();
@ -108,25 +106,20 @@ void Shaders::loadShaders()
memcpy(saved_shaders, m_shaders, sizeof(m_shaders));
// Ok, go
m_shaders[ES_NORMAL_MAP] = glslmat(dir + "normalmap.vert", dir + "normalmap.frag",
m_callbacks[ES_NORMAL_MAP], EMT_SOLID_2_LAYER);
m_shaders[ES_NORMAL_MAP_LIGHTMAP] = glslmat(dir + "normalmap.vert", dir + "normalmap.frag",
m_callbacks[ES_NORMAL_MAP_LIGHTMAP], EMT_SOLID_2_LAYER);
m_shaders[ES_NORMAL_MAP] = glsl_noinput(dir + "normalmap.vert", dir + "normalmap.frag");
m_shaders[ES_NORMAL_MAP_LIGHTMAP] = glsl_noinput(dir + "normalmap.vert", dir + "normalmap.frag");
m_shaders[ES_SKYBOX] = glslmat(dir + "skybox.vert", dir + "skybox.frag",
m_callbacks[ES_SKYBOX], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_shaders[ES_SPLATTING] = glslmat(dir + "splatting.vert", dir + "splatting.frag",
m_callbacks[ES_SPLATTING], EMT_SOLID);
m_shaders[ES_SPLATTING] = glsl_noinput(dir + "splatting.vert", dir + "splatting.frag");
m_shaders[ES_WATER] = glslmat(dir + "water.vert", dir + "water.frag",
m_callbacks[ES_WATER], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_shaders[ES_WATER_SURFACE] = glsl(dir + "water.vert", dir + "pass.frag",
m_callbacks[ES_WATER]);
m_shaders[ES_SPHERE_MAP] = glslmat(dir + "objectpass.vert", dir + "objectpass_spheremap.frag",
m_callbacks[ES_OBJECTPASS], EMT_SOLID);
m_shaders[ES_SPHERE_MAP] = glsl_noinput(dir + "objectpass.vert", dir + "objectpass_spheremap.frag");
m_shaders[ES_GRASS] = glslmat(dir + "grass.vert", dir + "grass.frag",
m_callbacks[ES_GRASS], EMT_TRANSPARENT_ALPHA_CHANNEL);
@ -155,19 +148,12 @@ void Shaders::loadShaders()
m_shaders[ES_COLORIZE_REF] = glslmat(std::string(""), dir + "colorize_ref.frag",
m_callbacks[ES_COLORIZE], EMT_SOLID);
m_shaders[ES_GLOW] = glslmat(std::string(""), dir + "glow.frag",
m_callbacks[ES_GLOW], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_shaders[ES_OBJECTPASS] = glsl_noinput(dir + "objectpass.vert", dir + "objectpass.frag");
m_shaders[ES_OBJECT_UNLIT] = glsl_noinput(dir + "objectpass.vert", dir + "objectpass.frag");
m_shaders[ES_OBJECTPASS_REF] = glsl_noinput(dir + "objectpass.vert", dir + "objectpass_ref.frag");
m_shaders[ES_OBJECTPASS_RIMLIT] = glsl_noinput(dir + "objectpass_rimlit.vert", dir + "objectpass_rimlit.frag");
m_shaders[ES_OBJECTPASS] = glslmat(dir + "objectpass.vert", dir + "objectpass.frag",
m_callbacks[ES_OBJECTPASS], EMT_SOLID);
m_shaders[ES_OBJECT_UNLIT] = glslmat(dir + "objectpass.vert", dir + "objectpass.frag",
m_callbacks[ES_OBJECTPASS], EMT_SOLID);
m_shaders[ES_OBJECTPASS_REF] = glslmat(dir + "objectpass.vert", dir + "objectpass_ref.frag",
m_callbacks[ES_OBJECTPASS], EMT_SOLID);
m_shaders[ES_OBJECTPASS_RIMLIT] = glslmat(dir + "objectpass_rimlit.vert", dir + "objectpass_rimlit.frag",
m_callbacks[ES_OBJECTPASS], EMT_SOLID);
m_shaders[ES_SUNLIGHT] = glslmat(std::string(""), dir + "sunlight.frag",
m_shaders[ES_SUNLIGHT] = glsl_noinput(std::string(""), dir + "sunlight.frag",
m_callbacks[ES_SUNLIGHT], EMT_SOLID);
m_shaders[ES_SUNLIGHT_SHADOW] = glslmat(dir + "pass.vert", dir + "sunlightshadow.frag",
m_callbacks[ES_SUNLIGHT], EMT_SOLID);

View File

@ -484,7 +484,6 @@ public:
ACT(ES_MIPVIZ) \
ACT(ES_COLORIZE) \
ACT(ES_COLORIZE_REF) \
ACT(ES_GLOW) \
ACT(ES_OBJECT_UNLIT) \
ACT(ES_OBJECTPASS) \
ACT(ES_OBJECTPASS_REF) \