wow
04-17-2004, 12:03 AM
hi all, I want to produce the sun effect. however, i don't know if my blending setting is wrong, even I have been the "circle" texture, the blending still have some prblem
//first blending: for the outermost layer of sun
glEnable(GL_BLEND);
glBlendFunc(GL_DST_COLOR, GL_SRC_ALPHA ); glBindTexture(GL_TEXTURE_2D,g_Texture[NEBULA_ID]);
float sun_flare_size = 700;
glColor4f(1,.5f,0,.5f);
glBegin(GL_QUADS);
.......
glEnd();
//second blending: for the innermost layer of sun
glBlendFunc(GL_SRC_ALPHA, GL_DST_COLOR);
sun_flare_size = 50;
glColor4f(1,.5f,0, 0.3);
glBegin(GL_QUADS);
...
glEnd();
After doing the above code, the effect is like:
this (http://www.csis.hku.hk/~pytang/blend.JPG)
Would anyone kindly point out my mistakes? Thanks
//first blending: for the outermost layer of sun
glEnable(GL_BLEND);
glBlendFunc(GL_DST_COLOR, GL_SRC_ALPHA ); glBindTexture(GL_TEXTURE_2D,g_Texture[NEBULA_ID]);
float sun_flare_size = 700;
glColor4f(1,.5f,0,.5f);
glBegin(GL_QUADS);
.......
glEnd();
//second blending: for the innermost layer of sun
glBlendFunc(GL_SRC_ALPHA, GL_DST_COLOR);
sun_flare_size = 50;
glColor4f(1,.5f,0, 0.3);
glBegin(GL_QUADS);
...
glEnd();
After doing the above code, the effect is like:
this (http://www.csis.hku.hk/~pytang/blend.JPG)
Would anyone kindly point out my mistakes? Thanks