Skip to content
Snippets Groups Projects
Commit f469dff6 authored by Anakin's avatar Anakin
Browse files

added transparency support,

need to sort the transparent things to the back
parent 930c49e9
No related branches found
No related tags found
No related merge requests found
...@@ -11,5 +11,7 @@ varying vec2 v_texcoord; ...@@ -11,5 +11,7 @@ varying vec2 v_texcoord;
void main() void main()
{ {
// Set fragment color from texture // Set fragment color from texture
gl_FragColor = texture2D(texture, v_texcoord); vec4 finalColor = vec4(texture2D(texture, v_texcoord));
gl_FragColor = finalColor;
} }
...@@ -187,7 +187,11 @@ void OglViewerWidget::initializeGL() ...@@ -187,7 +187,11 @@ void OglViewerWidget::initializeGL()
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
// Enable back face culling // Enable back face culling
glEnable(GL_CULL_FACE); //glEnable(GL_CULL_FACE);
// Enable transparency
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
m_dataEngine = new GeometryEngine(this); m_dataEngine = new GeometryEngine(this);
setConnections(); setConnections();
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment