• Advertisement

Archived

This topic is now archived and is closed to further replies.

Transparensy f***** problem..... not working

This topic is 5591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

f****, f*****, f*****, this problem i have all the time, the alpha not affect the transparensy, transparensy is constant any time.... the code is this: glLoadIdentity(); glTranslatef(HumoTanKe.Devolver(i,3) ,HumoTanKe.Devolver(i,4),HumoTanKe.Devolver(i,5)); glScalef(HumoTanKe.Devolver(i,2) ,HumoTanKe.Devolver(i,2),HumoTanKe.Devolver(i,2)); HumoTanKe.Calcular(i); HumoTanKe.MoverParticula(i,3,0.02f); glRotatef(Tanke.DevVal(4),0.0f,0.0f,1.0f); glEnable(GL_BLEND); glDepthMask(GL_FALSE); glBlendFunc(GL_SRC_ALPHA,GL_ONE); GLdouble alpha=HumoTanKe.Devolver(i,1); glColor4d(1.0f,1.0f,1.0f,alpha); glCallList(smoke); ....... Transparensy one stays equal ... not change. In the InitGL the code is this: int InitGL(GLvoid) { glLightfv (GL_LIGHT0, GL_AMBIENT, Ambient0); glLightfv (GL_LIGHT0, GL_DIFFUSE, Diffuse0); glLightfv (GL_LIGHT0, GL_SPECULAR, Specular0); glLightfv (GL_LIGHT0, GL_POSITION, posicion0); glLightf (GL_LIGHT0, GL_CONSTANT_ATTENUATION,4.0f); glLightf (GL_LIGHT0,GL_LINEAR_ATTENUATION,0.02f); glLightf (GL_LIGHT0,GL_QUADRATIC_ATTENUATION,0.0f); // glLightModelfv(GL_LIGHT_MODEL_AMBIENT, zero); // glLightfv (GL_LIGHT0, GL_SPOT_DIRECTION,direccion0); glLightfv (GL_LIGHT1, GL_AMBIENT, Ambient1); glLightfv (GL_LIGHT1, GL_DIFFUSE, Diffuse1); glLightfv (GL_LIGHT1, GL_SPECULAR, Specular1); glLightfv (GL_LIGHT1, GL_POSITION, posicion1); glLightf (GL_LIGHT1, GL_CONSTANT_ATTENUATION,8.0f); glLightfv (GL_LIGHT2, GL_AMBIENT, Ambient2); glLightfv (GL_LIGHT2, GL_DIFFUSE, Diffuse2); glLightfv (GL_LIGHT2, GL_SPECULAR, Specular2); glLightfv (GL_LIGHT2, GL_POSITION, posicion2); glLightf (GL_LIGHT2, GL_CONSTANT_ATTENUATION,8.0f); // glLightfv (GL_LIGHT1, GL_SPOT_DIRECTION,direccion1); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glEnable(GL_ALPHA_TEST ); glAlphaFunc(GL_GREATER,0.3f); Torre1p1=Gen3DObjectListTorre1p1(); Torre1p2=Gen3DObjectListTorre1p2(); Torre1p3=Gen3DObjectListTorre1p3(); Torre1p4=Gen3DObjectListTorre1p4(); if(!initMultitexture()) exit(1); Terreno=Gen3DObjectListTerreno(); Tanke_canon=Gen3DObjectListTcanon(); Tanke_soporte=Gen3DObjectListTsoporte(); Tanke_canon2=Gen3DObjectListTcanon2(); glEnable (GL_LIGHTING); glEnable (GL_LIGHT0); Jeep=Gen3DObjectList(); Halo=Gen3DObjectListHalo(); TMisil=Gen3DObjectListTMisil(); smoke1=Gen3DObjectListParticula1(); smoke2=Gen3DObjectListParticula2(); smoke3=Gen3DObjectListParticula3(); smoke4=Gen3DObjectListParticula4(); smoke5=Gen3DObjectListParticula5(); Explosion=Gen3DObjectListExplosion(); } the alpha test disable or enable not change anythink... Please.....hhhheeeeeeeellllpppp..

Share this post


Link to post
Share on other sites
Advertisement
Well
your code appears to be fine.
What does
HumoTanKe.Devolver(i,1);

return. Also, for transparency you could try using Colour Keying.
Look into that

Share this post


Link to post
Share on other sites
check the faq www.opengl.org download the pdf,
lighting + colors dont mix, see the faq section lighting

Share this post


Link to post
Share on other sites

  • Advertisement