Skip to main content
gamedev.net
🔒 Locked

Texture Mapping Question

Started by discman1028 2 replies 450+ views
Original Post
discman1028
discman1028
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 ==--
--== discman1028 ==--
davepermen
davepermen
disable texturing after drawing the quads? (glDisable(GL_TEXTURE_2D) ?)

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia
My Page davepermen.net | My Music on Bandcamp and on Soundcloud
Krohm
Krohm
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.
Previously "Krohm"
discman1028
discman1028
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 ==--
--== discman1028 ==--

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.