Bind textures correctly to GLSL sampler uniforms.
This was SVN commit r11476.
This commit is contained in:
parent
f2260892bd
commit
e6a82fff48
@ -162,9 +162,9 @@ void CParticleEmitter::UpdateArrayData()
|
||||
m_VertexArray.Upload();
|
||||
}
|
||||
|
||||
void CParticleEmitter::Bind()
|
||||
void CParticleEmitter::Bind(const CShaderProgramPtr& shader)
|
||||
{
|
||||
m_Type->m_Texture->Bind();
|
||||
shader->BindTexture("baseTex", m_Type->m_Texture);
|
||||
pglBlendEquationEXT(m_Type->m_BlendEquation);
|
||||
glBlendFunc(m_Type->m_BlendFuncSrc, m_Type->m_BlendFuncDst);
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public:
|
||||
/**
|
||||
* Bind rendering state (textures and blend modes).
|
||||
*/
|
||||
void Bind();
|
||||
void Bind(const CShaderProgramPtr& shader);
|
||||
|
||||
/**
|
||||
* Draw the vertex array.
|
||||
|
@ -68,7 +68,7 @@ void CDecalRData::Update()
|
||||
|
||||
void CDecalRData::Render(const CShaderProgramPtr& shader, bool isDummyShader)
|
||||
{
|
||||
m_Decal->m_Decal.m_Texture->Bind(0);
|
||||
shader->BindTexture("baseTex", m_Decal->m_Decal.m_Texture);
|
||||
|
||||
// TODO: Need to handle floating decals correctly. In particular, we need
|
||||
// to render non-floating before water and floating after water (to get
|
||||
|
@ -127,7 +127,7 @@ void ParticleRenderer::RenderParticles(bool solidColor)
|
||||
{
|
||||
CParticleEmitter* emitter = m->emitters[i];
|
||||
|
||||
emitter->Bind();
|
||||
emitter->Bind(shader->GetShader());
|
||||
emitter->RenderArray(shader->GetShader());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user