04-28-2003, 05:05 PM
Hi http://www.opengl.org/discussion_boards/ubb/smile.gif. I've done some C programming before and I'm starting to tinker around with OpenGL (mostly for fun) and I've got a few questions.
1) Most of the things I've read about blending say you have to turn off depth testing to get it to work properly -- otherwise, the polygons behind will disappear rather than blend. But, if you have to do this, then how do you depth test it with OTHER objects? For example, if I have a particle system that uses blending, it appears everywhere no matter how many polygons are between me and it (or it always appears behind other objects, no matter how far in front of them it is). Do I have to keep track of the location of all my objects and depth test them manually? This seems very complicated -- do real OpenGL apps just not use blending at all?
2) I have a simple model that I loaded from a file, and I then added lighting to my scene. For some reason, the same side of the model is lit no matter where the model is with respect to the light. It is always lit on the negative-z side of the model, even if that is the side facing away from the light, or even if it is sideways from the light. I think this is because I'm doing something wrong, but I can't figure out what it is.
Thanks if you can answer my questions.
1) Most of the things I've read about blending say you have to turn off depth testing to get it to work properly -- otherwise, the polygons behind will disappear rather than blend. But, if you have to do this, then how do you depth test it with OTHER objects? For example, if I have a particle system that uses blending, it appears everywhere no matter how many polygons are between me and it (or it always appears behind other objects, no matter how far in front of them it is). Do I have to keep track of the location of all my objects and depth test them manually? This seems very complicated -- do real OpenGL apps just not use blending at all?
2) I have a simple model that I loaded from a file, and I then added lighting to my scene. For some reason, the same side of the model is lit no matter where the model is with respect to the light. It is always lit on the negative-z side of the model, even if that is the side facing away from the light, or even if it is sideways from the light. I think this is because I'm doing something wrong, but I can't figure out what it is.
Thanks if you can answer my questions.