Game Development Community

rendering problem

by Architecture@Uni Melbourne · in Torque Game Engine · 01/07/2002 (6:07 pm) · 2 replies

Please can u tell me why this happens??

parts of it seem to be not rendered or something.

http://homepages.ihug.co.nz/~aravinth/problem.jpg

i would appreciate any help.

thank you in advance

#1
01/07/2002 (6:25 pm)
Do you have the latest drivers for your video card?


Dark
#2
01/07/2002 (7:31 pm)
this only started when i added the alpha code in interiorrender.cc (shown below)

"Fixed it!

I opened up interiorRender.cc and changed any instances of

glBlendFunc(GL_ONE, GL_ZERO);

to

glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER,0.f);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

and any instances of

glDisable(GL_BLEND);

to

glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
glBlendFunc(GL_ONE, GL_ZERO);


what this does is enables alpha blending on the card, and draws the texture using it's alpha value (if a texture has no alpha channel, it is drawn solid).

Managed to get a chain link fence working!

The alpha_test and alphaFunc stuff - this stops pixels being drawn that are completely invisible. If you don't do this, you might not necessarily be able to see interior objects through your alpha'd interior. In the case of my fence, I was unable to see through the holes to the fences behind.


thanks
-Mark"