Archived

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

discman1028

Texture Mapping Question

Recommended Posts

Hi all. When I dont use LoadGLTextures(), my texture-mapped triangle strips (particles from particle engine) show up as squares, and a not-texture-mapped quad (or a ground surface) show up as a square. This is fine and I understand why. What I do not understand is why when I use LoadGLTextures(), my particles get mapped with a texture (that''s good), but my quad disappears completely. (That''s bad) I have tried many things. Commenting out glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); brings back my quad, but I obviously lose my particle texture mapping then, too. This is probably a beginner''s question; so be it. THANKS A TON, -awesome site nehe!- --== discman1028 ==--

Share this post


Link to post
Share on other sites
Particles. Uhm. I guess you got a texture which is transparent at the edges and then you got a non textured quad.
Is texturing disabled before texturing the quad?
If you do not, what will happen is that all the quad vertices will get the same texcoord and it turns out that, very probably, this texcoord maps to RGBA (?,?,?,0) (where ''?'' means "don''t care"). This is because the texcoord will be something like ST (1,1), referring to the particle texture, which I guess has transparent borders.

Share this post


Link to post
Share on other sites
You are absolutely right. Adding "glDisable(GL_TEXTURE_2D);" before my quad and "glEnable(GL_TEXTURE_2D);" aftrwards, I get the solid surface and the transparent textured particles. THANKS!

Also what works instead, is right at the center of the texture it is bright white, so saying "glTexCoord2d(0.5,0.5);" right before drawing the quad makes it visible. "glTexCoord2d(0.75,0.75);" makes it slightly less visibale cuz the texture fades toward the edges.

Great and THANKS!!

Will return to offer help and ask for it.

--== discman1028 ==--

Share this post


Link to post
Share on other sites