Skip to content
Snippets Groups Projects
Commit d5e579f7 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

comment to explain the blending modes
parent d849d3d3
No related branches found
No related tags found
No related merge requests found
// $Id: Post.cpp,v 1.68 2004-06-04 02:07:07 geuzaine Exp $ // $Id: Post.cpp,v 1.69 2004-06-04 03:05:59 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -409,18 +409,19 @@ void Draw_Post(void) ...@@ -409,18 +409,19 @@ void Draw_Post(void)
// initialize alpha blending for transparency // initialize alpha blending for transparency
if(CTX.alpha && ColorTable_IsAlpha(&v->CT)){ if(CTX.alpha && ColorTable_IsAlpha(&v->CT)){
if(CTX.fake_transparency){ // "a la xpost" if(CTX.fake_transparency){
// simple additive blending "a la xpost"
glBlendFunc(GL_SRC_ALPHA, GL_ONE); glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
} }
else{ else{
// real translucent blending (requires back-to-front traversal)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND); glEnable(GL_BLEND);
// if we don't use vertex arrays, do a simple sort of // if we don't use vertex arrays, do the sorting here - it's
// transparent views (hybrid views will be sorted incorrectly; // incorrect for hybrid views (use Plugin(DecomposeInSimplex)
// use Plugin(DecomposeInSimplex) and View->Combine to do remedy // for that)
// this limitation)
if(!CTX.post.vertex_arrays && v->DrawScalars && if(!CTX.post.vertex_arrays && v->DrawScalars &&
(changedEye() || v->Changed)) { (changedEye() || v->Changed)) {
Msg(DEBUG, "Sorting View[%d] for transparency (NO vertex array)", v->Index); Msg(DEBUG, "Sorting View[%d] for transparency (NO vertex array)", v->Index);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment