Added alpha shading.

This commit is contained in:
Fabian Klemp 2014-11-17 16:15:42 +01:00
parent 29f24d6f05
commit 3086f98ecd
2 changed files with 4 additions and 2 deletions

View File

@ -38,6 +38,6 @@ void main()
}
vec3 finalColor = specularColor + diffuseColor + ambientColor;
vec3 texture = texture(uTexture, vTexCoord).rgb;
oColor = vec4(finalColor*texture, 1.0 );
vec4 texture = texture(uTexture, vTexCoord).rgba;
oColor = vec4(finalColor, 1.0f)*texture;
}

View File

@ -112,6 +112,8 @@ int main( int argc, char *argv[] )
//
glClearColor( 0.0, 0.0, 0.0, 1.0 );
glEnable( GL_DEPTH_TEST );
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
app.init();
int frameCount = 0;