Use SPTextureManager to get displace.png

This will allow using texture compression for it
This commit is contained in:
Benau 2018-01-26 16:02:51 +08:00
parent 97fd634ed8
commit a10b62b894
2 changed files with 7 additions and 10 deletions

View File

@ -199,12 +199,9 @@ void displaceShaderInit(SPShader* shader)
g_stk_sbr->getRTTs()->getFBO(FBO_DISPLACE).bind(),
glClear(GL_COLOR_BUFFER_BIT);
}, RP_RESERVED);
shader->addCustomPrefilledTextures(ST_BILINEAR,
GL_TEXTURE_2D, "displacement_tex", []()->GLuint
{
return irr_driver->getTexture(FileManager::TEXTURE,
"displace.png")->getOpenGLTextureName();
}, RP_RESERVED);
SPShaderManager::addPrefilledTexturesToShader(shader,
{{ "displacement_tex", "displace.png", false/*srgb*/, ST_BILINEAR }},
RP_RESERVED);
shader->addCustomPrefilledTextures(ST_BILINEAR,
GL_TEXTURE_2D, "mask_tex", []()->GLuint
{

View File

@ -108,10 +108,6 @@ private:
const std::array<PassInfo, 2>& pi,
const UniformAssigners& ua,
bool skinned);
// ------------------------------------------------------------------------
static void addPrefilledTexturesToShader(SPShader* s,
const std::vector<std::tuple<std::string, std::string, bool,
SamplerType> >& t, RenderPass rp);
public:
// ------------------------------------------------------------------------
@ -130,6 +126,10 @@ public:
m_spsm = NULL;
}
// ------------------------------------------------------------------------
static void addPrefilledTexturesToShader(SPShader* s,
const std::vector<std::tuple<std::string, std::string, bool,
SamplerType> >& t, RenderPass rp);
// ------------------------------------------------------------------------
SPShaderManager();
// ------------------------------------------------------------------------
~SPShaderManager();