Click here to Skip to main content
15,922,630 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Does OpenGL do alpha or not? Pin
Swinefeaster7-Nov-05 8:55
Swinefeaster7-Nov-05 8:55 
GeneralRe: Does OpenGL do alpha or not? Pin
El Corazon7-Nov-05 9:16
El Corazon7-Nov-05 9:16 
GeneralRe: Does OpenGL do alpha or not? Pin
Swinefeaster7-Nov-05 12:41
Swinefeaster7-Nov-05 12:41 
GeneralRe: Does OpenGL do alpha or not? Pin
El Corazon7-Nov-05 13:57
El Corazon7-Nov-05 13:57 
GeneralRe: Does OpenGL do alpha or not? Pin
Swinefeaster14-Nov-05 15:40
Swinefeaster14-Nov-05 15:40 
GeneralRe: Does OpenGL do alpha or not? Pin
El Corazon14-Nov-05 17:08
El Corazon14-Nov-05 17:08 
GeneralRe: Does OpenGL do alpha or not? Pin
Swinefeaster15-Nov-05 8:49
Swinefeaster15-Nov-05 8:49 
GeneralRe: Does OpenGL do alpha or not? Pin
El Corazon15-Nov-05 16:17
El Corazon15-Nov-05 16:17 
Choice of your blending function depends on what result you want. Once again, this is point where OpenGL is more than a draw-and-forget system.

Try a couple of these examples for blending and see how they do:
http://www.opengl.org/resources/code/basics/redbook/[^]
http://nehe.gamedev.net/lesson.asp?index=02[^]
http://nehe.gamedev.net/lesson.asp?index=07[^]
(blender.c)[^]

I tend to use the following sequence only for alpha blended objects (inside your if statement)

<br />
    // gen triangles left to right;<br />
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);   // I don't care which way the glass faces, blend it!<br />
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ;  // my personal favorite blending function<br />
    glEnable(GL_BLEND);        // blend! yeah!<br />
    glShadeModel(GL_SMOOTH);  // only matters if you have multiple colors, I do<br />
    glEnable(GL_DEPTH_TEST);  // absolutely depth-test against existing objects<br />
    glDisable(GL_LIGHTING);  // never did care for illuminated glass effects, but that is me<br />
    glDepthMask(0);    // alpha objects should not write to the depth buffer for multiple blending effects<br />



without knowing what you are expecting in the alpha blending, I don't know if you should use my model or another. There are several alpha-blending methods. In fact I used to know where a demo was of all the alpha-blending modes so you could see what each did as an effect and choose the function that was most like what you expected to see. Unfortunately, I have been searching for it without any luck.

_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
QuestionLPSAFEARRAY issues Pin
Axonn Echysttas4-Nov-05 9:46
Axonn Echysttas4-Nov-05 9:46 
AnswerRe: LPSAFEARRAY issues Pin
Mircea Puiu4-Nov-05 23:31
Mircea Puiu4-Nov-05 23:31 
GeneralRe: LPSAFEARRAY issues Pin
Axonn Echysttas5-Nov-05 10:51
Axonn Echysttas5-Nov-05 10:51 
GeneralRe: LPSAFEARRAY issues Pin
Axonn Echysttas5-Nov-05 21:23
Axonn Echysttas5-Nov-05 21:23 
QuestionLinker Error Pin
Maskarat4-Nov-05 7:54
Maskarat4-Nov-05 7:54 
AnswerRe: Linker Error Pin
Blake Miller4-Nov-05 10:49
Blake Miller4-Nov-05 10:49 
GeneralRe: Linker Error Pin
Maskarat6-Nov-05 4:01
Maskarat6-Nov-05 4:01 
QuestionHelp me :What is wrong here???? Pin
Member 18584504-Nov-05 7:26
Member 18584504-Nov-05 7:26 
QuestionRe: Help me :What is wrong here???? Pin
David Crow4-Nov-05 7:51
David Crow4-Nov-05 7:51 
QuestionA different registry question - edit offline? Pin
charlieg4-Nov-05 7:24
charlieg4-Nov-05 7:24 
QuestionRe: A different registry question - edit offline? Pin
David Crow4-Nov-05 7:50
David Crow4-Nov-05 7:50 
AnswerRe: A different registry question - edit offline? Pin
charlieg4-Nov-05 8:03
charlieg4-Nov-05 8:03 
QuestionRe: A different registry question - edit offline? Pin
David Crow4-Nov-05 8:08
David Crow4-Nov-05 8:08 
AnswerRe: A different registry question - edit offline? Pin
charlieg4-Nov-05 8:20
charlieg4-Nov-05 8:20 
QuestionRe: A different registry question - edit offline? Pin
David Crow4-Nov-05 9:01
David Crow4-Nov-05 9:01 
AnswerRe: A different registry question - edit offline? Pin
Maximilien4-Nov-05 7:56
Maximilien4-Nov-05 7:56 
GeneralRe: A different registry question - edit offline? Pin
charlieg4-Nov-05 8:05
charlieg4-Nov-05 8:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.