3D-Viewer: Bind to a texture so glTextEnv will work.

Fixes https://gitlab.com/kicad/code/kicad/issues/11641
This commit is contained in:
Mario Luzeiro 2022-12-21 11:22:11 +00:00 committed by Mike Williams
parent 5d94d2634e
commit 089d8b9cc1
2 changed files with 1 additions and 1 deletions

View File

@ -439,7 +439,6 @@ void MODEL_3D::Draw( bool aTransparent, float aOpacity, bool aUseSelectedMateria
glTexEnvfv( GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, (const float*)&param.x );
// BeginDrawMulti();
for( const MODEL_3D::MATERIAL& mat : m_materials )
{
if( ( mat.IsTransparent() != aTransparent )

View File

@ -905,6 +905,7 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
// Enables Texture Env so it can combine model transparency with each footprint opacity
glEnable( GL_TEXTURE_2D );
glActiveTexture( GL_TEXTURE0 );
glBindTexture( GL_TEXTURE_2D, m_circleTexture ); // Uses an existent texture so the glTexEnv operations will work
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
glTexEnvf( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_INTERPOLATE );