1
0
forked from 0ad/0ad

Bind textures correctly to GLSL sampler uniforms.

This was SVN commit r11476.
This commit is contained in:
Ykkrosh 2012-04-10 21:07:52 +00:00
parent f2260892bd
commit e6a82fff48
4 changed files with 5 additions and 5 deletions

View File

@ -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);
}

View File

@ -98,7 +98,7 @@ public:
/**
* Bind rendering state (textures and blend modes).
*/
void Bind();
void Bind(const CShaderProgramPtr& shader);
/**
* Draw the vertex array.

View File

@ -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

View File

@ -127,7 +127,7 @@ void ParticleRenderer::RenderParticles(bool solidColor)
{
CParticleEmitter* emitter = m->emitters[i];
emitter->Bind();
emitter->Bind(shader->GetShader());
emitter->RenderArray(shader->GetShader());
}