Commit 5f7268a1 authored by unknown's avatar unknown Committed by jean-pierre charras

3d-viewer, fix again a transparency issue.

parent dcdf9066
...@@ -118,7 +118,7 @@ void EDA_3D_CANVAS::create_and_render_shadow_buffer( GLuint *aDst_gl_texture, ...@@ -118,7 +118,7 @@ void EDA_3D_CANVAS::create_and_render_shadow_buffer( GLuint *aDst_gl_texture,
// Render body and shapes // Render body and shapes
if( aDraw_body && m_glLists[GL_ID_BODY] ) if( aDraw_body && m_glLists[GL_ID_BODY] )
glCallList( m_glLists[GL_ID_BODY] ); glCallList( m_glLists[GL_ID_BODY] );
if( m_glLists[GL_ID_3DSHAPES_SOLID_FRONT] ) if( m_glLists[GL_ID_3DSHAPES_SOLID_FRONT] )
glCallList( m_glLists[GL_ID_3DSHAPES_SOLID_FRONT] ); glCallList( m_glLists[GL_ID_3DSHAPES_SOLID_FRONT] );
...@@ -587,6 +587,7 @@ void EDA_3D_CANVAS::Redraw() ...@@ -587,6 +587,7 @@ void EDA_3D_CANVAS::Redraw()
if( isEnabled( FL_MODULE ) && m_glLists[GL_ID_3DSHAPES_TRANSP_FRONT] ) if( isEnabled( FL_MODULE ) && m_glLists[GL_ID_3DSHAPES_TRANSP_FRONT] )
{ {
glEnable( GL_COLOR_MATERIAL ); glEnable( GL_COLOR_MATERIAL );
SetOpenGlDefaultMaterial();
glEnable( GL_BLEND ); glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glCallList( m_glLists[GL_ID_3DSHAPES_TRANSP_FRONT] ); glCallList( m_glLists[GL_ID_3DSHAPES_TRANSP_FRONT] );
......
...@@ -260,7 +260,7 @@ void EDA_3D_FRAME::LoadSettings( wxConfigBase* aCfg ) ...@@ -260,7 +260,7 @@ void EDA_3D_FRAME::LoadSettings( wxConfigBase* aCfg )
aCfg->Read( keyRenderShowModelBBox, &tmp, false ); aCfg->Read( keyRenderShowModelBBox, &tmp, false );
prms.SetFlag( FL_RENDER_SHOW_MODEL_BBOX, tmp ); prms.SetFlag( FL_RENDER_SHOW_MODEL_BBOX, tmp );
aCfg->Read( keyShowAxis, &tmp, true ); aCfg->Read( keyShowAxis, &tmp, true );
prms.SetFlag( FL_AXIS, tmp ); prms.SetFlag( FL_AXIS, tmp );
...@@ -324,7 +324,7 @@ void EDA_3D_FRAME::SaveSettings( wxConfigBase* aCfg ) ...@@ -324,7 +324,7 @@ void EDA_3D_FRAME::SaveSettings( wxConfigBase* aCfg )
aCfg->Write( keyRenderUseModelNormals, prms.GetFlag( FL_RENDER_USE_MODEL_NORMALS ) ); aCfg->Write( keyRenderUseModelNormals, prms.GetFlag( FL_RENDER_USE_MODEL_NORMALS ) );
aCfg->Write( keyRenderMaterial, prms.GetFlag( FL_RENDER_MATERIAL ) ); aCfg->Write( keyRenderMaterial, prms.GetFlag( FL_RENDER_MATERIAL ) );
aCfg->Write( keyRenderShowModelBBox, prms.GetFlag( FL_RENDER_SHOW_MODEL_BBOX ) ); aCfg->Write( keyRenderShowModelBBox, prms.GetFlag( FL_RENDER_SHOW_MODEL_BBOX ) );
aCfg->Write( keyShowAxis, prms.GetFlag( FL_AXIS ) ); aCfg->Write( keyShowAxis, prms.GetFlag( FL_AXIS ) );
aCfg->Write( keyShowGrid, prms.GetFlag( FL_GRID ) ); aCfg->Write( keyShowGrid, prms.GetFlag( FL_GRID ) );
aCfg->Write( keyShowGridSize, prms.m_3D_Grid ); aCfg->Write( keyShowGridSize, prms.m_3D_Grid );
......
...@@ -188,6 +188,7 @@ void S3D_MESH::openGL_Render( bool aIsRenderingJustNonTransparentObjects, ...@@ -188,6 +188,7 @@ void S3D_MESH::openGL_Render( bool aIsRenderingJustNonTransparentObjects,
printf("m_MaterialIndexPerVertex.size() %lu\n", m_MaterialIndexPerVertex.size() ); printf("m_MaterialIndexPerVertex.size() %lu\n", m_MaterialIndexPerVertex.size() );
printf("m_PerVertexNormalsNormalized.size() %lu\n", m_PerVertexNormalsNormalized.size() ); printf("m_PerVertexNormalsNormalized.size() %lu\n", m_PerVertexNormalsNormalized.size() );
printf("m_PerFaceVertexNormals.size() %lu\n", m_PerFaceVertexNormals.size() ); printf("m_PerFaceVertexNormals.size() %lu\n", m_PerFaceVertexNormals.size() );
printf("m_PerFaceNormalsNormalized.size() %lu\n", m_PerFaceNormalsNormalized.size() );
printf("smoothShapes %d\n", smoothShapes ); printf("smoothShapes %d\n", smoothShapes );
...@@ -209,26 +210,23 @@ void S3D_MESH::openGL_Render( bool aIsRenderingJustNonTransparentObjects, ...@@ -209,26 +210,23 @@ void S3D_MESH::openGL_Render( bool aIsRenderingJustNonTransparentObjects,
if( m_Materials ) if( m_Materials )
{ {
if ( m_Materials->m_ColorPerVertex == false ) bool isTransparent = m_Materials->SetOpenGLMaterial( 0, useMaterial );
{
bool isTransparent = m_Materials->SetOpenGLMaterial( 0, useMaterial );
if( isTransparent && aIsRenderingJustNonTransparentObjects ) if( isTransparent && aIsRenderingJustNonTransparentObjects )
return; return;
if( !isTransparent && aIsRenderingJustTransparentObjects ) if( !isTransparent && aIsRenderingJustTransparentObjects )
return; return;
// Skip total transparent models // Skip total transparent models
if( useMaterial ) if( useMaterial )
if( m_Materials->m_Transparency.size() > 0 ) if( m_Materials->m_Transparency.size() > 0 )
{ {
lastTransparency_value = m_Materials->m_Transparency[0]; lastTransparency_value = m_Materials->m_Transparency[0];
if( lastTransparency_value >= 1.0f ) if( lastTransparency_value >= 1.0f )
return; return;
} }
}
} }
glPushMatrix(); glPushMatrix();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment