Use new Shader baseclass for all shaders.
This commit is contained in:
parent
bbaf061ae9
commit
5d098488e6
@ -36,7 +36,7 @@ static void drawTexColoredQuad(const video::ITexture *texture, const video::SCol
|
||||
glBindBuffer(GL_ARRAY_BUFFER, UIShader::ColoredTextureRectShader::getInstance()->colorvbo);
|
||||
glBufferSubData(GL_ARRAY_BUFFER, 0, 16 * sizeof(unsigned), colors);
|
||||
|
||||
glUseProgram(UIShader::ColoredTextureRectShader::getInstance()->Program);
|
||||
UIShader::ColoredTextureRectShader::getInstance()->use();
|
||||
glBindVertexArray(UIShader::ColoredTextureRectShader::getInstance()->vao);
|
||||
|
||||
UIShader::ColoredTextureRectShader::getInstance()->SetTextureUnits(static_cast<const irr::video::COpenGLTexture*>(texture)->getOpenGLTextureName());
|
||||
@ -56,7 +56,7 @@ void drawTexQuad(GLuint texture, float width, float height,
|
||||
float center_pos_x, float center_pos_y, float tex_center_pos_x, float tex_center_pos_y,
|
||||
float tex_width, float tex_height)
|
||||
{
|
||||
glUseProgram(UIShader::TextureRectShader::getInstance()->Program);
|
||||
UIShader::TextureRectShader::getInstance()->use();
|
||||
glBindVertexArray(SharedObject::UIVAO);
|
||||
|
||||
UIShader::TextureRectShader::getInstance()->SetTextureUnits(texture);
|
||||
@ -158,7 +158,7 @@ void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect
|
||||
clipRect->getWidth(), clipRect->getHeight());
|
||||
}
|
||||
|
||||
glUseProgram(UIShader::UniformColoredTextureRectShader::getInstance()->Program);
|
||||
UIShader::UniformColoredTextureRectShader::getInstance()->use();
|
||||
glBindVertexArray(SharedObject::UIVAO);
|
||||
|
||||
UIShader::UniformColoredTextureRectShader::getInstance()->SetTextureUnits(static_cast<const irr::video::COpenGLTexture*>(texture)->getOpenGLTextureName());
|
||||
@ -194,7 +194,7 @@ void draw2DImageFromRTT(GLuint texture, size_t texture_w, size_t texture_h,
|
||||
destRect, sourceRect, width, height, center_pos_x, center_pos_y,
|
||||
tex_width, tex_height, tex_center_pos_x, tex_center_pos_y);
|
||||
|
||||
glUseProgram(UIShader::UniformColoredTextureRectShader::getInstance()->Program);
|
||||
UIShader::UniformColoredTextureRectShader::getInstance()->use();
|
||||
glBindVertexArray(SharedObject::UIVAO);
|
||||
|
||||
UIShader::UniformColoredTextureRectShader::getInstance()->SetTextureUnits(texture);
|
||||
@ -281,7 +281,7 @@ void draw2DVertexPrimitiveList(video::ITexture *tex, const void* vertices,
|
||||
|
||||
VertexUtils::bindVertexArrayAttrib(vType);
|
||||
|
||||
glUseProgram(UIShader::Primitive2DList::getInstance()->Program);
|
||||
UIShader::Primitive2DList::getInstance()->use();
|
||||
UIShader::Primitive2DList::getInstance()->setUniforms();
|
||||
const video::SOverrideMaterial &m = irr_driver->getVideoDriver()->getOverrideMaterial();
|
||||
compressTexture(tex, false);
|
||||
@ -339,7 +339,7 @@ void GL32_draw2DRectangle(video::SColor color, const core::rect<s32>& position,
|
||||
clip->getWidth(), clip->getHeight());
|
||||
}
|
||||
|
||||
glUseProgram(UIShader::ColoredRectShader::getInstance()->Program);
|
||||
UIShader::ColoredRectShader::getInstance()->use();
|
||||
glBindVertexArray(SharedObject::UIVAO);
|
||||
UIShader::ColoredRectShader::getInstance()->setUniforms(core::vector2df(center_pos_x, center_pos_y), core::vector2df(width, height), color);
|
||||
|
||||
|
@ -320,7 +320,7 @@ GLuint generateSpecularCubemap(GLuint probe)
|
||||
glViewport(0, 0, cubemap_size, cubemap_size);
|
||||
GLenum bufs[] = { GL_COLOR_ATTACHMENT0 };
|
||||
glDrawBuffers(1, bufs);
|
||||
glUseProgram(UtilShader::SpecularIBLGenerator::getInstance()->Program);
|
||||
UtilShader::SpecularIBLGenerator::getInstance()->use();
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
@ -297,7 +297,7 @@ void draw3DLine(const core::vector3df& start,
|
||||
glBindBuffer(GL_ARRAY_BUFFER, UtilShader::ColoredLine::getInstance()->vbo);
|
||||
glBufferSubData(GL_ARRAY_BUFFER, 0, 6 * sizeof(float), vertex);
|
||||
|
||||
glUseProgram(UtilShader::ColoredLine::getInstance()->Program);
|
||||
UtilShader::ColoredLine::getInstance()->use();
|
||||
UtilShader::ColoredLine::getInstance()->setUniforms(color);
|
||||
glDrawArrays(GL_LINES, 0, 2);
|
||||
|
||||
|
@ -387,7 +387,7 @@ void ParticleSystemProxy::simulate()
|
||||
glEnable(GL_RASTERIZER_DISCARD);
|
||||
if (has_height_map)
|
||||
{
|
||||
glUseProgram(HeightmapSimulationShader::getInstance()->Program);
|
||||
HeightmapSimulationShader::getInstance()->use();
|
||||
glActiveTexture(GL_TEXTURE0 + HeightmapSimulationShader::getInstance()->TU_heightmap);
|
||||
glBindTexture(GL_TEXTURE_BUFFER, heightmaptexture);
|
||||
HeightmapSimulationShader::getInstance()->setUniforms(matrix, timediff, active_count, size_increase_factor, track_x, track_x_len, track_z, track_z_len);
|
||||
@ -433,7 +433,7 @@ void ParticleSystemProxy::simulate()
|
||||
void ParticleSystemProxy::drawFlip()
|
||||
{
|
||||
glBlendFunc(GL_ONE, GL_ONE);
|
||||
glUseProgram(FlipParticleRender::getInstance()->Program);
|
||||
FlipParticleRender::getInstance()->use();
|
||||
|
||||
FlipParticleRender::getInstance()->SetTextureUnits(texture, irr_driver->getDepthStencilTexture());
|
||||
FlipParticleRender::getInstance()->setUniforms();
|
||||
@ -617,19 +617,19 @@ HeightmapSimulationShader::HeightmapSimulationShader()
|
||||
"new_particle_velocity",
|
||||
"new_size",
|
||||
};
|
||||
Program = LoadTFBProgram(file_manager->getAsset("shaders/particlesimheightmap.vert").c_str(), varyings, 4);
|
||||
loadTFBProgram("particlesimheightmap.vert", varyings, 4);
|
||||
TU_heightmap = 2;
|
||||
AssignTextureUnit(Program, TexUnit(TU_heightmap, "heightmap"));
|
||||
AssignUniforms("sourcematrix", "dt", "level", "size_increase_factor", "track_x", "track_x_len", "track_z", "track_z_len");
|
||||
AssignTextureUnit(m_program, TexUnit(TU_heightmap, "heightmap"));
|
||||
assignUniforms("sourcematrix", "dt", "level", "size_increase_factor", "track_x", "track_x_len", "track_z", "track_z_len");
|
||||
}
|
||||
|
||||
FlipParticleRender::FlipParticleRender()
|
||||
{
|
||||
Program = LoadProgram(PARTICLES_RENDERING,
|
||||
GL_VERTEX_SHADER, file_manager->getAsset("shaders/flipparticle.vert").c_str(),
|
||||
GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getPosFromUVDepth.frag").c_str(),
|
||||
GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/particle.frag").c_str());
|
||||
AssignUniforms();
|
||||
loadProgram(PARTICLES_RENDERING,
|
||||
GL_VERTEX_SHADER, "flipparticle.vert",
|
||||
GL_FRAGMENT_SHADER, "utils/getPosFromUVDepth.frag",
|
||||
GL_FRAGMENT_SHADER, "particle.frag");
|
||||
assignUniforms();
|
||||
|
||||
AssignSamplerNames(Program, 0, "tex", 1, "dtex");
|
||||
AssignSamplerNames(m_program, 0, "tex", 1, "dtex");
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
|
||||
// ============================================================================
|
||||
|
||||
class HeightmapSimulationShader : public ShaderHelperSingleton<HeightmapSimulationShader, core::matrix4, int, int, float, float, float, float, float>
|
||||
class HeightmapSimulationShader : public Shader<HeightmapSimulationShader, core::matrix4, int, int, float, float, float, float, float>
|
||||
{
|
||||
public:
|
||||
GLuint TU_heightmap;
|
||||
@ -52,7 +52,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class FlipParticleRender : public ShaderHelperSingleton<FlipParticleRender>, public TextureRead<Trilinear_Anisotropic_Filtered, Nearest_Filtered>
|
||||
class FlipParticleRender : public Shader<FlipParticleRender>, public TextureRead<Trilinear_Anisotropic_Filtered, Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
FlipParticleRender();
|
||||
|
@ -222,7 +222,7 @@ void PostProcessing::renderEnvMap(const float *bSHCoeff, const float *gSHCoeff,
|
||||
|
||||
if (UserConfigParams::m_degraded_IBL)
|
||||
{
|
||||
glUseProgram(FullScreenShader::DegradedIBLShader::getInstance()->Program);
|
||||
FullScreenShader::DegradedIBLShader::getInstance()->use();
|
||||
glBindVertexArray(SharedObject::FullScreenQuadVAO);
|
||||
|
||||
FullScreenShader::DegradedIBLShader::getInstance()->SetTextureUnits(irr_driver->getRenderTargetTexture(RTT_NORMAL_AND_DEPTH));
|
||||
@ -230,7 +230,7 @@ void PostProcessing::renderEnvMap(const float *bSHCoeff, const float *gSHCoeff,
|
||||
}
|
||||
else
|
||||
{
|
||||
glUseProgram(FullScreenShader::IBLShader::getInstance()->Program);
|
||||
FullScreenShader::IBLShader::getInstance()->use();
|
||||
glBindVertexArray(SharedObject::FullScreenQuadVAO);
|
||||
|
||||
FullScreenShader::IBLShader::getInstance()->SetTextureUnits(irr_driver->getRenderTargetTexture(RTT_NORMAL_AND_DEPTH), irr_driver->getDepthStencilTexture(), skybox);
|
||||
@ -249,7 +249,7 @@ void PostProcessing::renderEnvMap(const float *bSHCoeff, const float *gSHCoeff,
|
||||
void PostProcessing::renderRHDebug(unsigned SHR, unsigned SHG, unsigned SHB, const core::matrix4 &rh_matrix, const core::vector3df &rh_extend)
|
||||
{
|
||||
glEnable(GL_PROGRAM_POINT_SIZE);
|
||||
glUseProgram(FullScreenShader::RHDebug::getInstance()->Program);
|
||||
FullScreenShader::RHDebug::getInstance()->use();
|
||||
glActiveTexture(GL_TEXTURE0 + FullScreenShader::RHDebug::getInstance()->TU_SHR);
|
||||
glBindTexture(GL_TEXTURE_3D, SHR);
|
||||
glActiveTexture(GL_TEXTURE0 + FullScreenShader::RHDebug::getInstance()->TU_SHG);
|
||||
@ -341,7 +341,7 @@ void PostProcessing::renderGaussian6BlurLayer(FrameBuffer &in_fbo, size_t layer,
|
||||
{
|
||||
const std::vector<float> &weightsV = getGaussianWeight(sigmaV, 7);
|
||||
glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT);
|
||||
glUseProgram(FullScreenShader::ComputeShadowBlurVShader::getInstance()->Program);
|
||||
FullScreenShader::ComputeShadowBlurVShader::getInstance()->use();
|
||||
FullScreenShader::ComputeShadowBlurVShader::getInstance()->SetTextureUnits(LayerTex);
|
||||
glBindSampler(FullScreenShader::ComputeShadowBlurVShader::getInstance()->TU_dest, 0);
|
||||
glBindImageTexture(FullScreenShader::ComputeShadowBlurVShader::getInstance()->TU_dest, irr_driver->getFBO(FBO_SCALAR_1024).getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_R32F);
|
||||
@ -350,7 +350,7 @@ void PostProcessing::renderGaussian6BlurLayer(FrameBuffer &in_fbo, size_t layer,
|
||||
|
||||
const std::vector<float> &weightsH = getGaussianWeight(sigmaH, 7);
|
||||
glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT | GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
|
||||
glUseProgram(FullScreenShader::ComputeShadowBlurHShader::getInstance()->Program);
|
||||
FullScreenShader::ComputeShadowBlurHShader::getInstance()->use();
|
||||
FullScreenShader::ComputeShadowBlurHShader::getInstance()->SetTextureUnits(irr_driver->getFBO(FBO_SCALAR_1024).getRTT()[0]);
|
||||
glBindSampler(FullScreenShader::ComputeShadowBlurHShader::getInstance()->TU_dest, 0);
|
||||
glBindImageTexture(FullScreenShader::ComputeShadowBlurHShader::getInstance()->TU_dest, LayerTex, 0, false, 0, GL_WRITE_ONLY, GL_R32F);
|
||||
@ -382,7 +382,7 @@ void PostProcessing::renderGaussian6Blur(FrameBuffer &in_fbo, FrameBuffer &auxil
|
||||
{
|
||||
const std::vector<float> &weightsV = getGaussianWeight(sigmaV, 7);
|
||||
glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT);
|
||||
glUseProgram(FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->Program);
|
||||
FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->use();
|
||||
FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->SetTextureUnits(in_fbo.getRTT()[0]);
|
||||
glBindSampler(FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->TU_dest, 0);
|
||||
glBindImageTexture(FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->TU_dest, auxiliary.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_RGBA16F);
|
||||
@ -391,7 +391,7 @@ void PostProcessing::renderGaussian6Blur(FrameBuffer &in_fbo, FrameBuffer &auxil
|
||||
|
||||
const std::vector<float> &weightsH = getGaussianWeight(sigmaH, 7);
|
||||
glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT | GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
|
||||
glUseProgram(FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->Program);
|
||||
FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->use();
|
||||
FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->SetTextureUnits(auxiliary.getRTT()[0]);
|
||||
glBindSampler(FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->TU_dest, 0);
|
||||
glBindImageTexture(FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->TU_dest, in_fbo.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_RGBA16F);
|
||||
@ -436,7 +436,7 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
|
||||
}
|
||||
else
|
||||
{
|
||||
glUseProgram(FullScreenShader::ComputeGaussian17TapHShader::getInstance()->Program);
|
||||
FullScreenShader::ComputeGaussian17TapHShader::getInstance()->use();
|
||||
glBindSampler(FullScreenShader::ComputeGaussian17TapHShader::getInstance()->TU_dest, 0);
|
||||
FullScreenShader::ComputeGaussian17TapHShader::getInstance()->SetTextureUnits(in_fbo.getRTT()[0], irr_driver->getFBO(FBO_LINEAR_DEPTH).getRTT()[0]);
|
||||
glBindImageTexture(FullScreenShader::ComputeGaussian17TapHShader::getInstance()->TU_dest, auxiliary.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_R16F);
|
||||
@ -456,7 +456,7 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
|
||||
}
|
||||
else
|
||||
{
|
||||
glUseProgram(FullScreenShader::ComputeGaussian17TapVShader::getInstance()->Program);
|
||||
FullScreenShader::ComputeGaussian17TapVShader::getInstance()->use();
|
||||
glBindSampler(FullScreenShader::ComputeGaussian17TapVShader::getInstance()->TU_dest, 0);
|
||||
FullScreenShader::ComputeGaussian17TapVShader::getInstance()->SetTextureUnits(auxiliary.getRTT()[0], irr_driver->getFBO(FBO_LINEAR_DEPTH).getRTT()[0]);
|
||||
glBindImageTexture(FullScreenShader::ComputeGaussian17TapVShader::getInstance()->TU_dest, in_fbo.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_R16F);
|
||||
@ -476,7 +476,7 @@ void PostProcessing::renderPassThrough(GLuint tex, unsigned width, unsigned heig
|
||||
|
||||
void PostProcessing::renderTextureLayer(unsigned tex, unsigned layer)
|
||||
{
|
||||
glUseProgram(FullScreenShader::LayerPassThroughShader::getInstance()->Program);
|
||||
FullScreenShader::LayerPassThroughShader::getInstance()->use();
|
||||
glBindVertexArray(FullScreenShader::LayerPassThroughShader::getInstance()->vao);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0 + FullScreenShader::LayerPassThroughShader::getInstance()->TU_texture);
|
||||
@ -490,7 +490,7 @@ void PostProcessing::renderTextureLayer(unsigned tex, unsigned layer)
|
||||
|
||||
void PostProcessing::renderGlow(unsigned tex)
|
||||
{
|
||||
glUseProgram(FullScreenShader::GlowShader::getInstance()->Program);
|
||||
FullScreenShader::GlowShader::getInstance()->use();
|
||||
glBindVertexArray(FullScreenShader::GlowShader::getInstance()->vao);
|
||||
|
||||
FullScreenShader::GlowShader::getInstance()->SetTextureUnits(tex);
|
||||
@ -590,7 +590,7 @@ void PostProcessing::applyMLAA()
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||
|
||||
// Pass 1: color edge detection
|
||||
glUseProgram(FullScreenShader::MLAAColorEdgeDetectionSHader::getInstance()->Program);
|
||||
FullScreenShader::MLAAColorEdgeDetectionSHader::getInstance()->use();
|
||||
FullScreenShader::MLAAColorEdgeDetectionSHader::getInstance()->SetTextureUnits(irr_driver->getRenderTargetTexture(RTT_MLAA_COLORS));
|
||||
DrawFullScreenEffect<FullScreenShader::MLAAColorEdgeDetectionSHader>(PIXEL_SIZE);
|
||||
|
||||
@ -601,7 +601,7 @@ void PostProcessing::applyMLAA()
|
||||
irr_driver->getFBO(FBO_MLAA_BLEND).Bind();
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glUseProgram(FullScreenShader::MLAABlendWeightSHader::getInstance()->Program);
|
||||
FullScreenShader::MLAABlendWeightSHader::getInstance()->use();
|
||||
FullScreenShader::MLAABlendWeightSHader::getInstance()->SetTextureUnits(irr_driver->getRenderTargetTexture(RTT_MLAA_TMP), getTextureGLuint(m_areamap));
|
||||
DrawFullScreenEffect<FullScreenShader::MLAABlendWeightSHader>(PIXEL_SIZE);
|
||||
|
||||
@ -611,7 +611,7 @@ void PostProcessing::applyMLAA()
|
||||
// Pass 3: gather
|
||||
irr_driver->getFBO(FBO_MLAA_COLORS).Bind();
|
||||
|
||||
glUseProgram(FullScreenShader::MLAAGatherSHader::getInstance()->Program);
|
||||
FullScreenShader::MLAAGatherSHader::getInstance()->use();
|
||||
FullScreenShader::MLAAGatherSHader::getInstance()->SetTextureUnits(irr_driver->getRenderTargetTexture(RTT_MLAA_BLEND), irr_driver->getRenderTargetTexture(RTT_MLAA_TMP));
|
||||
DrawFullScreenEffect<FullScreenShader::MLAAGatherSHader>(PIXEL_SIZE);
|
||||
|
||||
|
@ -192,7 +192,7 @@ void IrrDriver::renderGLSL(float dt)
|
||||
// Render bounding boxes
|
||||
if (irr_driver->getBoundingBoxesViz())
|
||||
{
|
||||
glUseProgram(UtilShader::ColoredLine::getInstance()->Program);
|
||||
UtilShader::ColoredLine::getInstance()->use();
|
||||
glBindVertexArray(UtilShader::ColoredLine::getInstance()->vao);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, UtilShader::ColoredLine::getInstance()->vbo);
|
||||
UtilShader::ColoredLine::getInstance()->setUniforms(SColor(255, 255, 0, 0));
|
||||
@ -221,7 +221,7 @@ void IrrDriver::renderGLSL(float dt)
|
||||
const std::map<video::SColor, std::vector<float> >& lines = debug_drawer->getLines();
|
||||
std::map<video::SColor, std::vector<float> >::const_iterator it;
|
||||
|
||||
glUseProgram(UtilShader::ColoredLine::getInstance()->Program);
|
||||
UtilShader::ColoredLine::getInstance()->use();
|
||||
glBindVertexArray(UtilShader::ColoredLine::getInstance()->vao);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, UtilShader::ColoredLine::getInstance()->vbo);
|
||||
for (it = lines.begin(); it != lines.end(); it++)
|
||||
@ -625,7 +625,7 @@ void IrrDriver::renderParticles()
|
||||
|
||||
static void renderWireFrameFrustrum(float *tmp, unsigned i)
|
||||
{
|
||||
glUseProgram(MeshShader::ViewFrustrumShader::getInstance()->Program);
|
||||
MeshShader::ViewFrustrumShader::getInstance()->use();
|
||||
glBindVertexArray(MeshShader::ViewFrustrumShader::getInstance()->frustrumvao);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, SharedObject::frustrumvbo);
|
||||
|
||||
@ -689,7 +689,7 @@ void IrrDriver::renderGlow(std::vector<GlowData>& glows)
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
{
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, GlowPassCmd::getInstance()->drawindirectcmd);
|
||||
glUseProgram(MeshShader::InstancedColorizeShader::getInstance()->Program);
|
||||
MeshShader::InstancedColorizeShader::getInstance()->use();
|
||||
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(video::EVT_STANDARD, InstanceTypeGlow));
|
||||
if (CVS->isAZDOEnabled())
|
||||
|
@ -426,7 +426,7 @@ template<typename T, int ...List>
|
||||
void renderMeshes1stPass()
|
||||
{
|
||||
auto &meshes = T::List::getInstance()->SolidPass;
|
||||
glUseProgram(T::FirstPassShader::getInstance()->Program);
|
||||
T::FirstPassShader::getInstance()->use();
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(T::VertexType));
|
||||
for (unsigned i = 0; i < meshes.size(); i++)
|
||||
@ -456,7 +456,7 @@ template<typename T, typename...Args>
|
||||
void renderInstancedMeshes1stPass(Args...args)
|
||||
{
|
||||
std::vector<GLMesh *> &meshes = T::InstancedList::getInstance()->SolidPass;
|
||||
glUseProgram(T::InstancedFirstPassShader::getInstance()->Program);
|
||||
T::InstancedFirstPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, T::Instance));
|
||||
for (unsigned i = 0; i < meshes.size(); i++)
|
||||
{
|
||||
@ -480,7 +480,7 @@ void renderInstancedMeshes1stPass(Args...args)
|
||||
template<typename T, typename...Args>
|
||||
void multidraw1stPass(Args...args)
|
||||
{
|
||||
glUseProgram(T::InstancedFirstPassShader::getInstance()->Program);
|
||||
T::InstancedFirstPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, T::Instance));
|
||||
if (SolidPassCmd::getInstance()->Size[T::MaterialType])
|
||||
{
|
||||
@ -546,7 +546,7 @@ void renderMeshes2ndPass( const std::vector<uint64_t> &Prefilled_Handle,
|
||||
const std::vector<GLuint> &Prefilled_Tex)
|
||||
{
|
||||
auto &meshes = T::List::getInstance()->SolidPass;
|
||||
glUseProgram(T::SecondPassShader::getInstance()->Program);
|
||||
T::SecondPassShader::getInstance()->use();
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(T::VertexType));
|
||||
for (unsigned i = 0; i < meshes.size(); i++)
|
||||
@ -575,7 +575,7 @@ template<typename T, typename...Args>
|
||||
void renderInstancedMeshes2ndPass(const std::vector<GLuint> &Prefilled_tex, Args...args)
|
||||
{
|
||||
std::vector<GLMesh *> &meshes = T::InstancedList::getInstance()->SolidPass;
|
||||
glUseProgram(T::InstancedSecondPassShader::getInstance()->Program);
|
||||
T::InstancedSecondPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, T::Instance));
|
||||
for (unsigned i = 0; i < meshes.size(); i++)
|
||||
{
|
||||
@ -590,7 +590,7 @@ void renderInstancedMeshes2ndPass(const std::vector<GLuint> &Prefilled_tex, Args
|
||||
template<typename T, typename...Args>
|
||||
void multidraw2ndPass(const std::vector<uint64_t> &Handles, Args... args)
|
||||
{
|
||||
glUseProgram(T::InstancedSecondPassShader::getInstance()->Program);
|
||||
T::InstancedSecondPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, T::Instance));
|
||||
uint64_t nulltex[10] = {};
|
||||
if (SolidPassCmd::getInstance()->Size[T::MaterialType])
|
||||
@ -664,7 +664,7 @@ void IrrDriver::renderSolidSecondPass()
|
||||
|
||||
// template does not work with template due to extra depth texture
|
||||
{
|
||||
glUseProgram(GrassMat::InstancedSecondPassShader::getInstance()->Program);
|
||||
GrassMat::InstancedSecondPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(GrassMat::VertexType, GrassMat::Instance));
|
||||
uint64_t nulltex[10] = {};
|
||||
if (SolidPassCmd::getInstance()->Size[GrassMat::MaterialType])
|
||||
@ -690,7 +690,7 @@ void IrrDriver::renderSolidSecondPass()
|
||||
// template does not work with template due to extra depth texture
|
||||
{
|
||||
std::vector<GLMesh *> &meshes = GrassMat::InstancedList::getInstance()->SolidPass;
|
||||
glUseProgram(GrassMat::InstancedSecondPassShader::getInstance()->Program);
|
||||
GrassMat::InstancedSecondPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(GrassMat::VertexType, GrassMat::Instance));
|
||||
for (unsigned i = 0; i < meshes.size(); i++)
|
||||
{
|
||||
@ -708,7 +708,7 @@ template<typename T>
|
||||
static void renderInstancedMeshNormals()
|
||||
{
|
||||
std::vector<GLMesh *> &meshes = T::InstancedList::getInstance()->SolidPass;
|
||||
glUseProgram(MeshShader::NormalVisualizer::getInstance()->Program);
|
||||
MeshShader::NormalVisualizer::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, T::Instance));
|
||||
for (unsigned i = 0; i < meshes.size(); i++)
|
||||
{
|
||||
@ -720,7 +720,7 @@ static void renderInstancedMeshNormals()
|
||||
template<typename T>
|
||||
static void renderMultiMeshNormals()
|
||||
{
|
||||
glUseProgram(MeshShader::NormalVisualizer::getInstance()->Program);
|
||||
MeshShader::NormalVisualizer::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, T::Instance));
|
||||
if (SolidPassCmd::getInstance()->Size[T::MaterialType])
|
||||
{
|
||||
@ -756,7 +756,7 @@ void IrrDriver::renderNormalsVisualisation()
|
||||
template<typename Shader, enum video::E_VERTEX_TYPE VertexType, int...List, typename... TupleType>
|
||||
void renderTransparenPass(const std::vector<TexUnit> &TexUnits, std::vector<STK::Tuple<TupleType...> > *meshes)
|
||||
{
|
||||
glUseProgram(Shader::getInstance()->Program);
|
||||
Shader::getInstance()->use();
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(VertexType));
|
||||
for (unsigned i = 0; i < meshes->size(); i++)
|
||||
@ -863,7 +863,7 @@ void IrrDriver::renderTransparent()
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
glUseProgram(MeshShader::DisplaceMaskShader::getInstance()->Program);
|
||||
MeshShader::DisplaceMaskShader::getInstance()->use();
|
||||
MeshShader::DisplaceMaskShader::getInstance()->setUniforms(AbsoluteTransformation);
|
||||
glDrawElementsBaseVertex(ptype, (int)count, itype,
|
||||
(GLvoid *)mesh.vaoOffset, (int)mesh.vaoBaseVertex);
|
||||
@ -890,7 +890,7 @@ void IrrDriver::renderTransparent()
|
||||
irr_driver->getRenderTargetTexture(RTT_COLOR),
|
||||
irr_driver->getRenderTargetTexture(RTT_TMP1),
|
||||
getTextureGLuint(mesh.textures[0]));
|
||||
glUseProgram(MeshShader::DisplaceShader::getInstance()->Program);
|
||||
MeshShader::DisplaceShader::getInstance()->use();
|
||||
MeshShader::DisplaceShader::getInstance()->setUniforms(AbsoluteTransformation,
|
||||
core::vector2df(cb->getDirX(), cb->getDirY()),
|
||||
core::vector2df(cb->getDir2X(), cb->getDir2Y()));
|
||||
@ -944,7 +944,7 @@ template<typename T, int...List>
|
||||
void renderShadow(unsigned cascade)
|
||||
{
|
||||
auto &t = T::List::getInstance()->Shadows[cascade];
|
||||
glUseProgram(T::ShadowPassShader::getInstance()->Program);
|
||||
T::ShadowPassShader::getInstance()->use();
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(T::VertexType));
|
||||
for (unsigned i = 0; i < t.size(); i++)
|
||||
@ -963,7 +963,7 @@ void renderShadow(unsigned cascade)
|
||||
template<typename T, typename...Args>
|
||||
void renderInstancedShadow(unsigned cascade, Args ...args)
|
||||
{
|
||||
glUseProgram(T::InstancedShadowPassShader::getInstance()->Program);
|
||||
T::InstancedShadowPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, InstanceTypeShadow));
|
||||
std::vector<GLMesh *> &t = T::InstancedList::getInstance()->Shadows[cascade];
|
||||
for (unsigned i = 0; i < t.size(); i++)
|
||||
@ -981,7 +981,7 @@ void renderInstancedShadow(unsigned cascade, Args ...args)
|
||||
template<typename T, typename...Args>
|
||||
static void multidrawShadow(unsigned i, Args ...args)
|
||||
{
|
||||
glUseProgram(T::InstancedShadowPassShader::getInstance()->Program);
|
||||
T::InstancedShadowPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, InstanceTypeShadow));
|
||||
if (ShadowPassCmd::getInstance()->Size[i][T::MaterialType])
|
||||
{
|
||||
@ -1096,7 +1096,7 @@ struct rsm_custom_unroll_args<N, List...>
|
||||
template<typename T, int... Selector>
|
||||
void drawRSM(const core::matrix4 & rsm_matrix)
|
||||
{
|
||||
glUseProgram(T::RSMShader::getInstance()->Program);
|
||||
T::RSMShader::getInstance()->use();
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(T::VertexType));
|
||||
auto t = T::List::getInstance()->RSM;
|
||||
@ -1117,7 +1117,7 @@ void drawRSM(const core::matrix4 & rsm_matrix)
|
||||
template<typename T, typename...Args>
|
||||
void renderRSMShadow(Args ...args)
|
||||
{
|
||||
glUseProgram(T::InstancedRSMShader::getInstance()->Program);
|
||||
T::InstancedRSMShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, InstanceTypeRSM));
|
||||
auto t = T::InstancedList::getInstance()->RSM;
|
||||
for (unsigned i = 0; i < t.size(); i++)
|
||||
@ -1134,7 +1134,7 @@ void renderRSMShadow(Args ...args)
|
||||
template<typename T, typename... Args>
|
||||
void multidrawRSM(Args...args)
|
||||
{
|
||||
glUseProgram(T::InstancedRSMShader::getInstance()->Program);
|
||||
T::InstancedRSMShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, InstanceTypeRSM));
|
||||
if (RSMPassCmd::getInstance()->Size[T::MaterialType])
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ static void renderPointLights(unsigned count)
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(GL_FALSE);
|
||||
|
||||
glUseProgram(LightShader::PointLightShader::getInstance()->Program);
|
||||
LightShader::PointLightShader::getInstance()->use();
|
||||
glBindVertexArray(LightShader::PointLightShader::getInstance()->vao);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, LightShader::PointLightShader::getInstance()->vbo);
|
||||
glBufferSubData(GL_ARRAY_BUFFER, 0, count * sizeof(LightShader::PointLightInfo), PointLightsInfo);
|
||||
@ -158,7 +158,7 @@ void IrrDriver::renderLights(unsigned pointlightcount, bool hasShadow)
|
||||
glBindVertexArray(SharedObject::FullScreenQuadVAO);
|
||||
if (CVS->needRHWorkaround())
|
||||
{
|
||||
glUseProgram(FullScreenShader::NVWorkaroundRadianceHintsConstructionShader::getInstance()->Program);
|
||||
FullScreenShader::NVWorkaroundRadianceHintsConstructionShader::getInstance()->use();
|
||||
FullScreenShader::NVWorkaroundRadianceHintsConstructionShader::getInstance()->SetTextureUnits(
|
||||
m_rtts->getRSM().getRTT()[0], m_rtts->getRSM().getRTT()[1], m_rtts->getRSM().getDepthTexture());
|
||||
for (unsigned i = 0; i < 32; i++)
|
||||
@ -169,7 +169,7 @@ void IrrDriver::renderLights(unsigned pointlightcount, bool hasShadow)
|
||||
}
|
||||
else
|
||||
{
|
||||
glUseProgram(FullScreenShader::RadianceHintsConstructionShader::getInstance()->Program);
|
||||
FullScreenShader::RadianceHintsConstructionShader::getInstance()->use();
|
||||
FullScreenShader::RadianceHintsConstructionShader::getInstance()->SetTextureUnits(
|
||||
m_rtts->getRSM().getRTT()[0],
|
||||
m_rtts->getRSM().getRTT()[1],
|
||||
@ -292,7 +292,7 @@ void IrrDriver::renderLightsScatter(unsigned pointlightcount)
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
core::vector3df col2(1., 1., 1.);
|
||||
|
||||
glUseProgram(LightShader::PointLightScatterShader::getInstance()->Program);
|
||||
LightShader::PointLightScatterShader::getInstance()->use();
|
||||
glBindVertexArray(LightShader::PointLightScatterShader::getInstance()->vao);
|
||||
|
||||
LightShader::PointLightScatterShader::getInstance()->SetTextureUnits(irr_driver->getDepthStencilTexture());
|
||||
|
@ -403,7 +403,7 @@ void IrrDriver::renderSkybox(const scene::ICameraSceneNode *camera)
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
glUseProgram(MeshShader::SkyboxShader::getInstance()->Program);
|
||||
MeshShader::SkyboxShader::getInstance()->use();
|
||||
glBindVertexArray(MeshShader::SkyboxShader::getInstance()->vao);
|
||||
MeshShader::SkyboxShader::getInstance()->setUniforms();
|
||||
|
||||
|
@ -91,7 +91,7 @@ GLuint ShaderBase::loadShader(const std::string &file, unsigned type)
|
||||
else
|
||||
Log::error("shader", "Can not open '%s'.", file.c_str());
|
||||
|
||||
Log::info("shader", "Compiling shader : %s", file);
|
||||
Log::info("shader", "Compiling shader : %s", file.c_str());
|
||||
const std::string &source = code.str();
|
||||
char const *source_pointer = source.c_str();
|
||||
int len = source.size();
|
||||
|
@ -161,7 +161,7 @@ private:
|
||||
template<unsigned N = 0, typename... Args>
|
||||
void setUniformsImpl(const irr::video::SColor &col, Args... arg) const
|
||||
{
|
||||
glUniform4i(m_uniforms[N], col.getRed(), c ol.getGreen(),
|
||||
glUniform4i(m_uniforms[N], col.getRed(), col.getGreen(),
|
||||
col.getBlue(), col.getAlpha());
|
||||
setUniformsImpl<N + 1>(arg...);
|
||||
} // setUniformsImpl
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -18,11 +18,12 @@
|
||||
#ifndef HEADER_SHADERS_HPP
|
||||
#define HEADER_SHADERS_HPP
|
||||
|
||||
#include <IShaderConstantSetCallBack.h>
|
||||
#include <IMeshSceneNode.h>
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/shader.hpp"
|
||||
#include "graphics/shaders_util.hpp"
|
||||
|
||||
#include "shaders_util.hpp"
|
||||
#include <IMeshSceneNode.h>
|
||||
#include <IShaderConstantSetCallBack.h>
|
||||
|
||||
using namespace irr;
|
||||
class ParticleSystemProxy;
|
||||
@ -39,7 +40,7 @@ public:
|
||||
|
||||
namespace UtilShader
|
||||
{
|
||||
class ColoredLine : public ShaderHelperSingleton<ColoredLine, video::SColor>
|
||||
class ColoredLine : public Shader<ColoredLine, video::SColor>
|
||||
{
|
||||
public:
|
||||
GLuint vao, vbo;
|
||||
@ -47,7 +48,7 @@ public:
|
||||
ColoredLine();
|
||||
};
|
||||
|
||||
class SpecularIBLGenerator : public ShaderHelperSingleton<SpecularIBLGenerator, core::matrix4, float >, public TextureRead<Trilinear_cubemap>
|
||||
class SpecularIBLGenerator : public Shader<SpecularIBLGenerator, core::matrix4, float >, public TextureRead<Trilinear_cubemap>
|
||||
{
|
||||
public:
|
||||
GLuint TU_Samples;
|
||||
@ -58,244 +59,244 @@ public:
|
||||
|
||||
namespace MeshShader
|
||||
{
|
||||
class ObjectPass1Shader : public ShaderHelperSingleton<ObjectPass1Shader, core::matrix4, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
class ObjectPass1Shader : public Shader<ObjectPass1Shader, core::matrix4, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
ObjectPass1Shader();
|
||||
};
|
||||
|
||||
class ObjectRefPass1Shader : public ShaderHelperSingleton<ObjectRefPass1Shader, core::matrix4, core::matrix4, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class ObjectRefPass1Shader : public Shader<ObjectRefPass1Shader, core::matrix4, core::matrix4, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
ObjectRefPass1Shader();
|
||||
};
|
||||
|
||||
class GrassPass1Shader : public ShaderHelperSingleton<GrassPass1Shader, core::matrix4, core::matrix4, core::vector3df>, public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class GrassPass1Shader : public Shader<GrassPass1Shader, core::matrix4, core::matrix4, core::vector3df>, public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
GrassPass1Shader();
|
||||
};
|
||||
|
||||
class NormalMapShader : public ShaderHelperSingleton<NormalMapShader, core::matrix4, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class NormalMapShader : public Shader<NormalMapShader, core::matrix4, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
NormalMapShader();
|
||||
};
|
||||
|
||||
class InstancedObjectPass1Shader : public ShaderHelperSingleton<InstancedObjectPass1Shader>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
class InstancedObjectPass1Shader : public Shader<InstancedObjectPass1Shader>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedObjectPass1Shader();
|
||||
};
|
||||
|
||||
class InstancedObjectRefPass1Shader : public ShaderHelperSingleton<InstancedObjectRefPass1Shader>, public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class InstancedObjectRefPass1Shader : public Shader<InstancedObjectRefPass1Shader>, public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedObjectRefPass1Shader();
|
||||
};
|
||||
|
||||
class InstancedGrassPass1Shader : public ShaderHelperSingleton<InstancedGrassPass1Shader, core::vector3df>, public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class InstancedGrassPass1Shader : public Shader<InstancedGrassPass1Shader, core::vector3df>, public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedGrassPass1Shader();
|
||||
};
|
||||
|
||||
class InstancedNormalMapShader : public ShaderHelperSingleton<InstancedNormalMapShader>, public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class InstancedNormalMapShader : public Shader<InstancedNormalMapShader>, public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedNormalMapShader();
|
||||
};
|
||||
|
||||
class ObjectPass2Shader : public ShaderHelperSingleton<ObjectPass2Shader, core::matrix4, core::matrix4>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class ObjectPass2Shader : public Shader<ObjectPass2Shader, core::matrix4, core::matrix4>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
ObjectPass2Shader();
|
||||
};
|
||||
|
||||
class InstancedObjectPass2Shader : public ShaderHelperSingleton<InstancedObjectPass2Shader>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class InstancedObjectPass2Shader : public Shader<InstancedObjectPass2Shader>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedObjectPass2Shader();
|
||||
};
|
||||
|
||||
class InstancedObjectRefPass2Shader : public ShaderHelperSingleton<InstancedObjectRefPass2Shader>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class InstancedObjectRefPass2Shader : public Shader<InstancedObjectRefPass2Shader>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedObjectRefPass2Shader();
|
||||
};
|
||||
|
||||
class DetailledObjectPass2Shader : public ShaderHelperSingleton<DetailledObjectPass2Shader, core::matrix4>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class DetailledObjectPass2Shader : public Shader<DetailledObjectPass2Shader, core::matrix4>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
DetailledObjectPass2Shader();
|
||||
};
|
||||
|
||||
class InstancedDetailledObjectPass2Shader : public ShaderHelperSingleton<InstancedDetailledObjectPass2Shader>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class InstancedDetailledObjectPass2Shader : public Shader<InstancedDetailledObjectPass2Shader>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedDetailledObjectPass2Shader();
|
||||
};
|
||||
|
||||
class ObjectUnlitShader : public ShaderHelperSingleton<ObjectUnlitShader, core::matrix4, core::matrix4>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class ObjectUnlitShader : public Shader<ObjectUnlitShader, core::matrix4, core::matrix4>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
ObjectUnlitShader();
|
||||
};
|
||||
|
||||
class InstancedObjectUnlitShader : public ShaderHelperSingleton<InstancedObjectUnlitShader>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class InstancedObjectUnlitShader : public Shader<InstancedObjectUnlitShader>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedObjectUnlitShader();
|
||||
};
|
||||
|
||||
class ObjectRefPass2Shader : public ShaderHelperSingleton<ObjectRefPass2Shader, core::matrix4, core::matrix4>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class ObjectRefPass2Shader : public Shader<ObjectRefPass2Shader, core::matrix4, core::matrix4>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
ObjectRefPass2Shader();
|
||||
};
|
||||
|
||||
class GrassPass2Shader : public ShaderHelperSingleton<GrassPass2Shader, core::matrix4, core::vector3df>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class GrassPass2Shader : public Shader<GrassPass2Shader, core::matrix4, core::vector3df>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
GrassPass2Shader();
|
||||
};
|
||||
|
||||
class InstancedGrassPass2Shader : public ShaderHelperSingleton<InstancedGrassPass2Shader, core::vector3df, core::vector3df>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Nearest_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class InstancedGrassPass2Shader : public Shader<InstancedGrassPass2Shader, core::vector3df, core::vector3df>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Nearest_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedGrassPass2Shader();
|
||||
};
|
||||
|
||||
class SphereMapShader : public ShaderHelperSingleton<SphereMapShader, core::matrix4, core::matrix4>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class SphereMapShader : public Shader<SphereMapShader, core::matrix4, core::matrix4>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
SphereMapShader();
|
||||
};
|
||||
|
||||
class InstancedSphereMapShader : public ShaderHelperSingleton<InstancedSphereMapShader>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class InstancedSphereMapShader : public Shader<InstancedSphereMapShader>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedSphereMapShader();
|
||||
};
|
||||
|
||||
class SplattingShader : public ShaderHelperSingleton<SplattingShader, core::matrix4>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class SplattingShader : public Shader<SplattingShader, core::matrix4>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
SplattingShader();
|
||||
};
|
||||
|
||||
class TransparentShader : public ShaderHelperSingleton<TransparentShader, core::matrix4, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
class TransparentShader : public Shader<TransparentShader, core::matrix4, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
TransparentShader();
|
||||
};
|
||||
|
||||
class TransparentFogShader : public ShaderHelperSingleton<TransparentFogShader, core::matrix4, core::matrix4, float, float, float, float, float, video::SColorf>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
class TransparentFogShader : public Shader<TransparentFogShader, core::matrix4, core::matrix4, float, float, float, float, float, video::SColorf>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
TransparentFogShader();
|
||||
};
|
||||
|
||||
class BillboardShader : public ShaderHelperSingleton<BillboardShader, core::matrix4, core::matrix4, core::vector3df, core::dimension2df>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
class BillboardShader : public Shader<BillboardShader, core::matrix4, core::matrix4, core::vector3df, core::dimension2df>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
BillboardShader();
|
||||
};
|
||||
|
||||
|
||||
class ColorizeShader : public ShaderHelperSingleton<ColorizeShader, core::matrix4, video::SColorf>
|
||||
class ColorizeShader : public Shader<ColorizeShader, core::matrix4, video::SColorf>
|
||||
{
|
||||
public:
|
||||
ColorizeShader();
|
||||
};
|
||||
|
||||
class InstancedColorizeShader : public ShaderHelperSingleton<InstancedColorizeShader>
|
||||
class InstancedColorizeShader : public Shader<InstancedColorizeShader>
|
||||
{
|
||||
public:
|
||||
InstancedColorizeShader();
|
||||
};
|
||||
|
||||
class ShadowShader : public ShaderHelperSingleton<ShadowShader, int, core::matrix4>, public TextureRead<>
|
||||
class ShadowShader : public Shader<ShadowShader, int, core::matrix4>, public TextureRead<>
|
||||
{
|
||||
public:
|
||||
ShadowShader();
|
||||
};
|
||||
|
||||
class RSMShader : public ShaderHelperSingleton<RSMShader, core::matrix4, core::matrix4, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
class RSMShader : public Shader<RSMShader, core::matrix4, core::matrix4, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
RSMShader();
|
||||
};
|
||||
|
||||
class InstancedRSMShader : public ShaderHelperSingleton<InstancedRSMShader, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
class InstancedRSMShader : public Shader<InstancedRSMShader, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedRSMShader();
|
||||
};
|
||||
|
||||
class SplattingRSMShader : public ShaderHelperSingleton<SplattingRSMShader, core::matrix4, core::matrix4>,
|
||||
class SplattingRSMShader : public Shader<SplattingRSMShader, core::matrix4, core::matrix4>,
|
||||
public TextureRead<Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
SplattingRSMShader();
|
||||
};
|
||||
|
||||
class InstancedShadowShader : public ShaderHelperSingleton<InstancedShadowShader, int>, public TextureRead<>
|
||||
class InstancedShadowShader : public Shader<InstancedShadowShader, int>, public TextureRead<>
|
||||
{
|
||||
public:
|
||||
InstancedShadowShader();
|
||||
};
|
||||
|
||||
class RefShadowShader : public ShaderHelperSingleton<RefShadowShader, int, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
class RefShadowShader : public Shader<RefShadowShader, int, core::matrix4>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
RefShadowShader();
|
||||
};
|
||||
|
||||
class InstancedRefShadowShader : public ShaderHelperSingleton<InstancedRefShadowShader, int>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
class InstancedRefShadowShader : public Shader<InstancedRefShadowShader, int>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedRefShadowShader();
|
||||
};
|
||||
|
||||
class GrassShadowShader : public ShaderHelperSingleton<GrassShadowShader, int, core::matrix4, core::vector3df>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
class GrassShadowShader : public Shader<GrassShadowShader, int, core::matrix4, core::vector3df>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
GrassShadowShader();
|
||||
};
|
||||
|
||||
class InstancedGrassShadowShader : public ShaderHelperSingleton<InstancedGrassShadowShader, int, core::vector3df>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
class InstancedGrassShadowShader : public Shader<InstancedGrassShadowShader, int, core::vector3df>, public TextureRead<Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
InstancedGrassShadowShader();
|
||||
};
|
||||
|
||||
class DisplaceMaskShader : public ShaderHelperSingleton<DisplaceMaskShader, core::matrix4>
|
||||
class DisplaceMaskShader : public Shader<DisplaceMaskShader, core::matrix4>
|
||||
{
|
||||
public:
|
||||
DisplaceMaskShader();
|
||||
};
|
||||
|
||||
class DisplaceShader : public ShaderHelperSingleton<DisplaceShader, core::matrix4, core::vector2df, core::vector2df>, public TextureRead<Bilinear_Filtered, Bilinear_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
class DisplaceShader : public Shader<DisplaceShader, core::matrix4, core::vector2df, core::vector2df>, public TextureRead<Bilinear_Filtered, Bilinear_Filtered, Bilinear_Filtered, Trilinear_Anisotropic_Filtered>
|
||||
{
|
||||
public:
|
||||
DisplaceShader();
|
||||
};
|
||||
|
||||
class SkyboxShader : public ShaderHelperSingleton<SkyboxShader>, public TextureRead<Trilinear_cubemap>
|
||||
class SkyboxShader : public Shader<SkyboxShader>, public TextureRead<Trilinear_cubemap>
|
||||
{
|
||||
public:
|
||||
SkyboxShader();
|
||||
GLuint vao;
|
||||
};
|
||||
|
||||
class NormalVisualizer : public ShaderHelperSingleton<NormalVisualizer, video::SColor>
|
||||
class NormalVisualizer : public Shader<NormalVisualizer, video::SColor>
|
||||
{
|
||||
public:
|
||||
NormalVisualizer();
|
||||
};
|
||||
|
||||
class ViewFrustrumShader : public ShaderHelperSingleton<ViewFrustrumShader, video::SColor, int>
|
||||
class ViewFrustrumShader : public Shader<ViewFrustrumShader, video::SColor, int>
|
||||
{
|
||||
public:
|
||||
GLuint frustrumvao;
|
||||
@ -322,7 +323,7 @@ namespace LightShader
|
||||
};
|
||||
|
||||
|
||||
class PointLightShader : public ShaderHelperSingleton<PointLightShader>, public TextureRead<Nearest_Filtered, Nearest_Filtered>
|
||||
class PointLightShader : public Shader<PointLightShader>, public TextureRead<Nearest_Filtered, Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
GLuint vbo;
|
||||
@ -330,7 +331,7 @@ namespace LightShader
|
||||
PointLightShader();
|
||||
};
|
||||
|
||||
class PointLightScatterShader : public ShaderHelperSingleton<PointLightScatterShader, float, core::vector3df>, public TextureRead<Nearest_Filtered>
|
||||
class PointLightScatterShader : public Shader<PointLightScatterShader, float, core::vector3df>, public TextureRead<Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
GLuint vbo;
|
||||
@ -343,7 +344,7 @@ namespace LightShader
|
||||
template<typename T, typename... Args>
|
||||
static void DrawFullScreenEffect(Args...args)
|
||||
{
|
||||
glUseProgram(T::getInstance()->Program);
|
||||
T::getInstance()->use();
|
||||
glBindVertexArray(SharedObject::FullScreenQuadVAO);
|
||||
T::getInstance()->setUniforms(args...);
|
||||
glDrawArrays(GL_TRIANGLES, 0, 3);
|
||||
@ -352,82 +353,82 @@ static void DrawFullScreenEffect(Args...args)
|
||||
namespace FullScreenShader
|
||||
{
|
||||
|
||||
class BloomShader : public ShaderHelperSingleton<BloomShader>, public TextureRead<Nearest_Filtered>
|
||||
class BloomShader : public Shader<BloomShader>, public TextureRead<Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
BloomShader();
|
||||
};
|
||||
|
||||
class BloomBlendShader : public ShaderHelperSingleton<BloomBlendShader>, public TextureRead<Bilinear_Filtered, Bilinear_Filtered, Bilinear_Filtered>
|
||||
class BloomBlendShader : public Shader<BloomBlendShader>, public TextureRead<Bilinear_Filtered, Bilinear_Filtered, Bilinear_Filtered>
|
||||
{
|
||||
public:
|
||||
BloomBlendShader();
|
||||
};
|
||||
|
||||
class LensBlendShader : public ShaderHelperSingleton<LensBlendShader>, public TextureRead<Bilinear_Filtered, Bilinear_Filtered, Bilinear_Filtered>
|
||||
class LensBlendShader : public Shader<LensBlendShader>, public TextureRead<Bilinear_Filtered, Bilinear_Filtered, Bilinear_Filtered>
|
||||
{
|
||||
public:
|
||||
LensBlendShader();
|
||||
};
|
||||
|
||||
|
||||
class ToneMapShader : public ShaderHelperSingleton<ToneMapShader, float>, public TextureRead<Nearest_Filtered>
|
||||
class ToneMapShader : public Shader<ToneMapShader, float>, public TextureRead<Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
|
||||
ToneMapShader();
|
||||
};
|
||||
|
||||
class DepthOfFieldShader : public ShaderHelperSingleton<DepthOfFieldShader>, public TextureRead<Bilinear_Filtered, Nearest_Filtered>
|
||||
class DepthOfFieldShader : public Shader<DepthOfFieldShader>, public TextureRead<Bilinear_Filtered, Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
DepthOfFieldShader();
|
||||
};
|
||||
|
||||
class SunLightShader : public ShaderHelperSingleton<SunLightShader, core::vector3df, video::SColorf>, public TextureRead<Nearest_Filtered, Nearest_Filtered>
|
||||
class SunLightShader : public Shader<SunLightShader, core::vector3df, video::SColorf>, public TextureRead<Nearest_Filtered, Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
SunLightShader();
|
||||
};
|
||||
|
||||
class IBLShader : public ShaderHelperSingleton<IBLShader>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Trilinear_cubemap>
|
||||
class IBLShader : public Shader<IBLShader>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Trilinear_cubemap>
|
||||
{
|
||||
public:
|
||||
IBLShader();
|
||||
};
|
||||
|
||||
class DegradedIBLShader : public ShaderHelperSingleton<DegradedIBLShader>, public TextureRead<Nearest_Filtered>
|
||||
class DegradedIBLShader : public Shader<DegradedIBLShader>, public TextureRead<Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
DegradedIBLShader();
|
||||
};
|
||||
|
||||
class ShadowedSunLightShaderPCF : public ShaderHelperSingleton<ShadowedSunLightShaderPCF, float, float, float, float, float>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Shadow_Sampler>
|
||||
class ShadowedSunLightShaderPCF : public Shader<ShadowedSunLightShaderPCF, float, float, float, float, float>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Shadow_Sampler>
|
||||
{
|
||||
public:
|
||||
ShadowedSunLightShaderPCF();
|
||||
};
|
||||
|
||||
class ShadowedSunLightShaderESM : public ShaderHelperSingleton<ShadowedSunLightShaderESM, float, float, float, float>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Trilinear_Clamped_Array2D>
|
||||
class ShadowedSunLightShaderESM : public Shader<ShadowedSunLightShaderESM, float, float, float, float>, public TextureRead<Nearest_Filtered, Nearest_Filtered, Trilinear_Clamped_Array2D>
|
||||
{
|
||||
public:
|
||||
ShadowedSunLightShaderESM();
|
||||
};
|
||||
|
||||
class RadianceHintsConstructionShader : public ShaderHelperSingleton<RadianceHintsConstructionShader, core::matrix4, core::matrix4, core::vector3df, video::SColorf>, public TextureRead<Bilinear_Filtered, Bilinear_Filtered, Bilinear_Filtered>
|
||||
class RadianceHintsConstructionShader : public Shader<RadianceHintsConstructionShader, core::matrix4, core::matrix4, core::vector3df, video::SColorf>, public TextureRead<Bilinear_Filtered, Bilinear_Filtered, Bilinear_Filtered>
|
||||
{
|
||||
public:
|
||||
RadianceHintsConstructionShader();
|
||||
};
|
||||
|
||||
// Workaround for a bug found in kepler nvidia linux and fermi nvidia windows
|
||||
class NVWorkaroundRadianceHintsConstructionShader : public ShaderHelperSingleton<NVWorkaroundRadianceHintsConstructionShader, core::matrix4, core::matrix4, core::vector3df, int, video::SColorf>, public TextureRead<Bilinear_Filtered, Bilinear_Filtered, Bilinear_Filtered>
|
||||
class NVWorkaroundRadianceHintsConstructionShader : public Shader<NVWorkaroundRadianceHintsConstructionShader, core::matrix4, core::matrix4, core::vector3df, int, video::SColorf>, public TextureRead<Bilinear_Filtered, Bilinear_Filtered, Bilinear_Filtered>
|
||||
{
|
||||
public:
|
||||
NVWorkaroundRadianceHintsConstructionShader();
|
||||
};
|
||||
|
||||
class RHDebug : public ShaderHelperSingleton<RHDebug, core::matrix4, core::vector3df>
|
||||
class RHDebug : public Shader<RHDebug, core::matrix4, core::vector3df>
|
||||
{
|
||||
public:
|
||||
GLuint TU_SHR, TU_SHG, TU_SHB;
|
||||
@ -435,65 +436,65 @@ public:
|
||||
RHDebug();
|
||||
};
|
||||
|
||||
class GlobalIlluminationReconstructionShader : public ShaderHelperSingleton<GlobalIlluminationReconstructionShader, core::matrix4, core::matrix4, core::vector3df>,
|
||||
class GlobalIlluminationReconstructionShader : public Shader<GlobalIlluminationReconstructionShader, core::matrix4, core::matrix4, core::vector3df>,
|
||||
public TextureRead<Nearest_Filtered, Nearest_Filtered, Volume_Linear_Filtered, Volume_Linear_Filtered, Volume_Linear_Filtered>
|
||||
{
|
||||
public:
|
||||
GlobalIlluminationReconstructionShader();
|
||||
};
|
||||
|
||||
class Gaussian17TapHShader : public ShaderHelperSingleton<Gaussian17TapHShader, core::vector2df>, public TextureRead<Bilinear_Clamped_Filtered, Bilinear_Clamped_Filtered>
|
||||
class Gaussian17TapHShader : public Shader<Gaussian17TapHShader, core::vector2df>, public TextureRead<Bilinear_Clamped_Filtered, Bilinear_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
Gaussian17TapHShader();
|
||||
};
|
||||
|
||||
class ComputeGaussian17TapHShader : public ShaderHelperSingleton<ComputeGaussian17TapHShader, core::vector2df>, public TextureRead<Neared_Clamped_Filtered, Neared_Clamped_Filtered>
|
||||
class ComputeGaussian17TapHShader : public Shader<ComputeGaussian17TapHShader, core::vector2df>, public TextureRead<Neared_Clamped_Filtered, Neared_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
GLuint TU_dest;
|
||||
ComputeGaussian17TapHShader();
|
||||
};
|
||||
|
||||
class ComputeGaussian6HBlurShader : public ShaderHelperSingleton<ComputeGaussian6HBlurShader, core::vector2df, std::vector<float> >, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
class ComputeGaussian6HBlurShader : public Shader<ComputeGaussian6HBlurShader, core::vector2df, std::vector<float> >, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
GLuint TU_dest;
|
||||
ComputeGaussian6HBlurShader();
|
||||
};
|
||||
|
||||
class ComputeShadowBlurHShader : public ShaderHelperSingleton<ComputeShadowBlurHShader, core::vector2df, std::vector<float> >, public TextureRead<Neared_Clamped_Filtered>
|
||||
class ComputeShadowBlurHShader : public Shader<ComputeShadowBlurHShader, core::vector2df, std::vector<float> >, public TextureRead<Neared_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
GLuint TU_dest;
|
||||
ComputeShadowBlurHShader();
|
||||
};
|
||||
|
||||
class Gaussian6HBlurShader : public ShaderHelperSingleton<Gaussian6HBlurShader, core::vector2df, float>, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
class Gaussian6HBlurShader : public Shader<Gaussian6HBlurShader, core::vector2df, float>, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
Gaussian6HBlurShader();
|
||||
};
|
||||
|
||||
class HorizontalBlurShader : public ShaderHelperSingleton<HorizontalBlurShader, core::vector2df>, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
class HorizontalBlurShader : public Shader<HorizontalBlurShader, core::vector2df>, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
HorizontalBlurShader();
|
||||
};
|
||||
|
||||
class Gaussian3HBlurShader : public ShaderHelperSingleton<Gaussian3HBlurShader, core::vector2df>, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
class Gaussian3HBlurShader : public Shader<Gaussian3HBlurShader, core::vector2df>, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
Gaussian3HBlurShader();
|
||||
};
|
||||
|
||||
class Gaussian17TapVShader : public ShaderHelperSingleton<Gaussian17TapVShader, core::vector2df>, public TextureRead<Bilinear_Clamped_Filtered, Bilinear_Clamped_Filtered>
|
||||
class Gaussian17TapVShader : public Shader<Gaussian17TapVShader, core::vector2df>, public TextureRead<Bilinear_Clamped_Filtered, Bilinear_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
Gaussian17TapVShader();
|
||||
};
|
||||
|
||||
class ComputeGaussian17TapVShader : public ShaderHelperSingleton<ComputeGaussian17TapVShader, core::vector2df>, public TextureRead<Neared_Clamped_Filtered, Neared_Clamped_Filtered>
|
||||
class ComputeGaussian17TapVShader : public Shader<ComputeGaussian17TapVShader, core::vector2df>, public TextureRead<Neared_Clamped_Filtered, Neared_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
GLuint TU_dest;
|
||||
@ -501,39 +502,39 @@ public:
|
||||
ComputeGaussian17TapVShader();
|
||||
};
|
||||
|
||||
class ComputeGaussian6VBlurShader : public ShaderHelperSingleton<ComputeGaussian6VBlurShader, core::vector2df, std::vector<float> >, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
class ComputeGaussian6VBlurShader : public Shader<ComputeGaussian6VBlurShader, core::vector2df, std::vector<float> >, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
GLuint TU_dest;
|
||||
ComputeGaussian6VBlurShader();
|
||||
};
|
||||
|
||||
class ComputeShadowBlurVShader : public ShaderHelperSingleton<ComputeShadowBlurVShader, core::vector2df, std::vector<float> >, public TextureRead<Neared_Clamped_Filtered>
|
||||
class ComputeShadowBlurVShader : public Shader<ComputeShadowBlurVShader, core::vector2df, std::vector<float> >, public TextureRead<Neared_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
GLuint TU_dest;
|
||||
ComputeShadowBlurVShader();
|
||||
};
|
||||
|
||||
class Gaussian6VBlurShader : public ShaderHelperSingleton<Gaussian6VBlurShader, core::vector2df, float>, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
class Gaussian6VBlurShader : public Shader<Gaussian6VBlurShader, core::vector2df, float>, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
Gaussian6VBlurShader();
|
||||
};
|
||||
|
||||
class Gaussian3VBlurShader : public ShaderHelperSingleton<Gaussian3VBlurShader, core::vector2df>, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
class Gaussian3VBlurShader : public Shader<Gaussian3VBlurShader, core::vector2df>, public TextureRead<Bilinear_Clamped_Filtered>
|
||||
{
|
||||
public:
|
||||
Gaussian3VBlurShader();
|
||||
};
|
||||
|
||||
class PassThroughShader : public ShaderHelperSingleton<PassThroughShader, int, int>, public TextureRead<Bilinear_Filtered>
|
||||
class PassThroughShader : public Shader<PassThroughShader, int, int>, public TextureRead<Bilinear_Filtered>
|
||||
{
|
||||
public:
|
||||
PassThroughShader();
|
||||
};
|
||||
|
||||
class LayerPassThroughShader : public ShaderHelperSingleton<LayerPassThroughShader, int>
|
||||
class LayerPassThroughShader : public Shader<LayerPassThroughShader, int>
|
||||
{
|
||||
public:
|
||||
GLuint TU_texture;
|
||||
@ -542,31 +543,31 @@ public:
|
||||
LayerPassThroughShader();
|
||||
};
|
||||
|
||||
class LinearizeDepthShader : public ShaderHelperSingleton<LinearizeDepthShader, float, float>, public TextureRead<Bilinear_Filtered>
|
||||
class LinearizeDepthShader : public Shader<LinearizeDepthShader, float, float>, public TextureRead<Bilinear_Filtered>
|
||||
{
|
||||
public:
|
||||
LinearizeDepthShader();
|
||||
};
|
||||
|
||||
class LightspaceBoundingBoxShader : public ShaderHelperSingleton<LightspaceBoundingBoxShader, core::matrix4, float, float, float, float>, public TextureRead < Nearest_Filtered >
|
||||
class LightspaceBoundingBoxShader : public Shader<LightspaceBoundingBoxShader, core::matrix4, float, float, float, float>, public TextureRead < Nearest_Filtered >
|
||||
{
|
||||
public:
|
||||
LightspaceBoundingBoxShader();
|
||||
};
|
||||
|
||||
class ShadowMatrixesGenerationShader : public ShaderHelperSingleton <ShadowMatrixesGenerationShader, core::matrix4>
|
||||
class ShadowMatrixesGenerationShader : public Shader <ShadowMatrixesGenerationShader, core::matrix4>
|
||||
{
|
||||
public:
|
||||
ShadowMatrixesGenerationShader();
|
||||
};
|
||||
|
||||
class DepthHistogramShader : public ShaderHelperSingleton<DepthHistogramShader>, public TextureRead <Nearest_Filtered>
|
||||
class DepthHistogramShader : public Shader<DepthHistogramShader>, public TextureRead <Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
DepthHistogramShader();
|
||||
};
|
||||
|
||||
class GlowShader : public ShaderHelperSingleton<GlowShader>, public TextureRead<Bilinear_Filtered>
|
||||
class GlowShader : public Shader<GlowShader>, public TextureRead<Bilinear_Filtered>
|
||||
{
|
||||
public:
|
||||
GLuint vao;
|
||||
@ -574,49 +575,49 @@ public:
|
||||
GlowShader();
|
||||
};
|
||||
|
||||
class SSAOShader : public ShaderHelperSingleton<SSAOShader, float, float, float>, public TextureRead<Semi_trilinear>
|
||||
class SSAOShader : public Shader<SSAOShader, float, float, float>, public TextureRead<Semi_trilinear>
|
||||
{
|
||||
public:
|
||||
SSAOShader();
|
||||
};
|
||||
|
||||
class FogShader : public ShaderHelperSingleton<FogShader, float, core::vector3df>, public TextureRead<Nearest_Filtered>
|
||||
class FogShader : public Shader<FogShader, float, core::vector3df>, public TextureRead<Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
FogShader();
|
||||
};
|
||||
|
||||
class MotionBlurShader : public ShaderHelperSingleton<MotionBlurShader, core::matrix4, core::vector2df, float, float>, public TextureRead<Bilinear_Clamped_Filtered, Nearest_Filtered>
|
||||
class MotionBlurShader : public Shader<MotionBlurShader, core::matrix4, core::vector2df, float, float>, public TextureRead<Bilinear_Clamped_Filtered, Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
MotionBlurShader();
|
||||
};
|
||||
|
||||
class GodFadeShader : public ShaderHelperSingleton<GodFadeShader, video::SColorf>, public TextureRead<Bilinear_Filtered>
|
||||
class GodFadeShader : public Shader<GodFadeShader, video::SColorf>, public TextureRead<Bilinear_Filtered>
|
||||
{
|
||||
public:
|
||||
GodFadeShader();
|
||||
};
|
||||
|
||||
class GodRayShader : public ShaderHelperSingleton<GodRayShader, core::vector2df>, public TextureRead<Bilinear_Filtered>
|
||||
class GodRayShader : public Shader<GodRayShader, core::vector2df>, public TextureRead<Bilinear_Filtered>
|
||||
{
|
||||
public:
|
||||
GodRayShader();
|
||||
};
|
||||
|
||||
class MLAAColorEdgeDetectionSHader : public ShaderHelperSingleton<MLAAColorEdgeDetectionSHader, core::vector2df>, public TextureRead<Nearest_Filtered>
|
||||
class MLAAColorEdgeDetectionSHader : public Shader<MLAAColorEdgeDetectionSHader, core::vector2df>, public TextureRead<Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
MLAAColorEdgeDetectionSHader();
|
||||
};
|
||||
|
||||
class MLAABlendWeightSHader : public ShaderHelperSingleton<MLAABlendWeightSHader, core::vector2df>, public TextureRead<Bilinear_Filtered, Nearest_Filtered>
|
||||
class MLAABlendWeightSHader : public Shader<MLAABlendWeightSHader, core::vector2df>, public TextureRead<Bilinear_Filtered, Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
MLAABlendWeightSHader();
|
||||
};
|
||||
|
||||
class MLAAGatherSHader : public ShaderHelperSingleton<MLAAGatherSHader, core::vector2df>, public TextureRead<Nearest_Filtered, Nearest_Filtered>
|
||||
class MLAAGatherSHader : public Shader<MLAAGatherSHader, core::vector2df>, public TextureRead<Nearest_Filtered, Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
MLAAGatherSHader();
|
||||
@ -627,25 +628,25 @@ public:
|
||||
namespace UIShader
|
||||
{
|
||||
|
||||
class Primitive2DList : public ShaderHelperSingleton<Primitive2DList>, public TextureRead < Bilinear_Filtered >
|
||||
class Primitive2DList : public Shader<Primitive2DList>, public TextureRead < Bilinear_Filtered >
|
||||
{
|
||||
public:
|
||||
Primitive2DList();
|
||||
};
|
||||
|
||||
class TextureRectShader : public ShaderHelperSingleton<TextureRectShader, core::vector2df, core::vector2df, core::vector2df, core::vector2df>, public TextureRead<Bilinear_Filtered>
|
||||
class TextureRectShader : public Shader<TextureRectShader, core::vector2df, core::vector2df, core::vector2df, core::vector2df>, public TextureRead<Bilinear_Filtered>
|
||||
{
|
||||
public:
|
||||
TextureRectShader();
|
||||
};
|
||||
|
||||
class UniformColoredTextureRectShader : public ShaderHelperSingleton<UniformColoredTextureRectShader, core::vector2df, core::vector2df, core::vector2df, core::vector2df, video::SColor>, public TextureRead<Bilinear_Filtered>
|
||||
class UniformColoredTextureRectShader : public Shader<UniformColoredTextureRectShader, core::vector2df, core::vector2df, core::vector2df, core::vector2df, video::SColor>, public TextureRead<Bilinear_Filtered>
|
||||
{
|
||||
public:
|
||||
UniformColoredTextureRectShader();
|
||||
};
|
||||
|
||||
class ColoredTextureRectShader : public ShaderHelperSingleton<ColoredTextureRectShader, core::vector2df, core::vector2df, core::vector2df, core::vector2df>, public TextureRead<Bilinear_Filtered>
|
||||
class ColoredTextureRectShader : public Shader<ColoredTextureRectShader, core::vector2df, core::vector2df, core::vector2df, core::vector2df>, public TextureRead<Bilinear_Filtered>
|
||||
{
|
||||
public:
|
||||
GLuint colorvbo;
|
||||
@ -654,7 +655,7 @@ public:
|
||||
ColoredTextureRectShader();
|
||||
};
|
||||
|
||||
class ColoredRectShader : public ShaderHelperSingleton<ColoredRectShader, core::vector2df, core::vector2df, video::SColor>
|
||||
class ColoredRectShader : public Shader<ColoredRectShader, core::vector2df, core::vector2df, video::SColor>
|
||||
{
|
||||
public:
|
||||
ColoredRectShader();
|
||||
|
@ -147,7 +147,7 @@ void IrrDriver::UpdateSplitAndLightcoordRangeFromComputeShaders(size_t width, si
|
||||
glBufferData(GL_SHADER_STORAGE_BUFFER, 4 * sizeof(CascadeBoundingBox), InitialCBB, GL_STATIC_DRAW);
|
||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, CBBssbo);
|
||||
|
||||
glUseProgram(FullScreenShader::LightspaceBoundingBoxShader::getInstance()->Program);
|
||||
FullScreenShader::LightspaceBoundingBoxShader::getInstance()->use();
|
||||
FullScreenShader::LightspaceBoundingBoxShader::getInstance()->SetTextureUnits(getDepthStencilTexture());
|
||||
FullScreenShader::LightspaceBoundingBoxShader::getInstance()->setUniforms(m_suncam->getViewMatrix(), shadowSplit[1], shadowSplit[2], shadowSplit[3], shadowSplit[4]);
|
||||
glDispatchCompute((int)width / 64, (int)height / 64, 1);
|
||||
@ -158,7 +158,7 @@ void IrrDriver::UpdateSplitAndLightcoordRangeFromComputeShaders(size_t width, si
|
||||
glBufferData(GL_SHADER_STORAGE_BUFFER, 4 * 16 * sizeof(float), 0, GL_STATIC_COPY);
|
||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, tempShadowMatssbo);
|
||||
|
||||
glUseProgram(FullScreenShader::ShadowMatrixesGenerationShader::getInstance()->Program);
|
||||
FullScreenShader::ShadowMatrixesGenerationShader::getInstance()->use();
|
||||
FullScreenShader::ShadowMatrixesGenerationShader::getInstance()->setUniforms(m_suncam->getViewMatrix());
|
||||
glDispatchCompute(4, 1, 1);
|
||||
|
||||
|
@ -68,7 +68,7 @@ void STKBillboard::render()
|
||||
return;
|
||||
compressTexture(tex, true, true);
|
||||
GLuint texid = getTextureGLuint(tex);
|
||||
glUseProgram(MeshShader::BillboardShader::getInstance()->Program);
|
||||
MeshShader::BillboardShader::getInstance()->use();
|
||||
MeshShader::BillboardShader::getInstance()->SetTextureUnits(texid);
|
||||
MeshShader::BillboardShader::getInstance()->setUniforms(irr_driver->getViewMatrix(), irr_driver->getProjMatrix(), pos, Size);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
@ -274,7 +274,7 @@ void STKMeshSceneNode::render()
|
||||
glDisable(GL_CULL_FACE);
|
||||
if (update_each_frame)
|
||||
updatevbo();
|
||||
glUseProgram(MeshShader::ObjectPass1Shader::getInstance()->Program);
|
||||
MeshShader::ObjectPass1Shader::getInstance()->use();
|
||||
// Only untextured
|
||||
for (unsigned i = 0; i < GLmeshes.size(); i++)
|
||||
{
|
||||
@ -313,7 +313,7 @@ void STKMeshSceneNode::render()
|
||||
glDisable(GL_CULL_FACE);
|
||||
if (update_each_frame && !CVS->isDefferedEnabled())
|
||||
updatevbo();
|
||||
glUseProgram(MeshShader::ObjectPass2Shader::getInstance()->Program);
|
||||
MeshShader::ObjectPass2Shader::getInstance()->use();
|
||||
// Only untextured
|
||||
for (unsigned i = 0; i < GLmeshes.size(); i++)
|
||||
{
|
||||
@ -366,7 +366,7 @@ void STKMeshSceneNode::render()
|
||||
|
||||
if (irr_driver->getPhase() == GLOW_PASS)
|
||||
{
|
||||
glUseProgram(MeshShader::ColorizeShader::getInstance()->Program);
|
||||
MeshShader::ColorizeShader::getInstance()->use();
|
||||
for (u32 i = 0; i < Mesh->getMeshBufferCount(); ++i)
|
||||
{
|
||||
scene::IMeshBuffer* mb = Mesh->getMeshBuffer(i);
|
||||
@ -395,7 +395,7 @@ void STKMeshSceneNode::render()
|
||||
|
||||
if (World::getWorld() && World::getWorld()->isFogEnabled())
|
||||
{
|
||||
glUseProgram(MeshShader::TransparentFogShader::getInstance()->Program);
|
||||
MeshShader::TransparentFogShader::getInstance()->use();
|
||||
for (unsigned i = 0; i < GLmeshes.size(); i++)
|
||||
{
|
||||
GLMesh &mesh = GLmeshes[i];
|
||||
@ -439,7 +439,7 @@ void STKMeshSceneNode::render()
|
||||
}
|
||||
else
|
||||
{
|
||||
glUseProgram(MeshShader::TransparentShader::getInstance()->Program);
|
||||
MeshShader::TransparentShader::getInstance()->use();
|
||||
for (unsigned i = 0; i < GLmeshes.size(); i++)
|
||||
{
|
||||
irr_driver->IncreaseObjectCount();
|
||||
|
Loading…
x
Reference in New Issue
Block a user