Closed timi-liuliang closed 1 year ago
Set texture size when bind texture
if (texture)
{
shaderProgram->setUniform(StringUtil::Format("u_%sSize", uniform->m_name.c_str()), &texture->getSize(), ShaderParamType::SPT_VEC2, 1);
shaderProgram->setUniform(uniform->m_name.c_str(), &textureCount, uniform->m_type, uniform->m_count);
}
https://stackoverflow.com/questions/25803909/glsl-texture-size