🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Multitexturing point sprites

Started by
2 comments, last by lc_overlord 16 years, 7 months ago
I am having some trouble with point sprites. I am trying to use point sprites along with a 1d texture for coloring. I can either get one or the other to work, but not both at the same time. My code looks like: glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_1D); glBindTexture(GL_TEXTURE_1D, tex_1d); glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); glEnable(GL_POINT_SPRITE_ARB); glBindTexture(GL_TEXTURE_2D, tex_sprite); glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE); And then I begin to draw the points. The funny thing about this is it works on some graphics cards, but not on others (even though multitexturing and point sprites are available on all of them). Thanks for the help.
Advertisement
What do you mean when you say it doesn't work? Are the points just not there at all?

Luke.
Member of the NeHe team.
Correct. The points do not display at all. If I turn off the 1d texture, the points display but obviously they are all the same color. As I mentioned, this appears to only be a problem on some cards. I would like to blame it on ATI cards in general, but that is not the case. Some ATI cards work and some don't. All NVIDIA cards I have tested appear to work just fine. I'm beginning to think it may be a driver issue.
Point sprites are not perfect and has never really been that supported, but there are two ways around this.

1. set the base color for each particle manually, either by using glColor or a color array buffer.

2. use shaders and do it though that.

Generally i would advice against using point sprites, doing it manually (or though a vertex shader) is still pretty fast and you have full control over it.
Lighthouse3D has a pretty good tutorial on this.

This topic is closed to new replies.

Advertisement