if ( toupper( gl_monolightmap->string[0] ) == 'A' )
{
gl_lms.internal_format = gl_tex_alpha_format;
}
/*
** try to do hacked colored lighting with a blended texture
*/
else if ( toupper( gl_monolightmap->string[0] ) == 'C' )
{
gl_lms.internal_format = gl_tex_alpha_format;
}
else if ( toupper( gl_monolightmap->string[0] ) == 'I' )
{
gl_lms.internal_format = GL_INTENSITY8;
}
else if ( toupper( gl_monolightmap->string[0] ) == 'L' )
{
gl_lms.internal_format = GL_LUMINANCE8;
}
else
{
gl_lms.internal_format = gl_tex_solid_format;
}
GL_Bind( gl_state.lightmap_textures + 0 );
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
qglTexImage2D( GL_TEXTURE_2D,
0,
gl_lms.internal_format,
BLOCK_WIDTH, BLOCK_HEIGHT,
0,
GL_LIGHTMAP_FORMAT,
GL_UNSIGNED_BYTE,
dummy );qglTexImage2D与glTexImage2D相同。
问题出在调试过程中,我看到qglTexImage2D的第三个参数( internalFormat )的输入值是gl_tex_solid_format,也就是3。3是参数internalFormat的有效值吗?
发布于 2013-01-28 23:12:38
对于internalFormat,3是一个完全合法的值。
从the glTexImage2D() documentation
internalFormat:指定纹理中颜色分量的数量。必须是1、2、3或4,或者是以下符号常量之一:...
发布于 2013-01-28 23:07:00
变量gl_tex_solid_format的值来自哪里?是否确定已将GL_RGBA赋值给变量gl_tex_solid_format?也许您将3赋给了变量gl_tex_solid_format。
https://stackoverflow.com/questions/14017452
复制相似问题