Problem with Rendering Textures with Alpha?

I'm will need to do that too for my app, once I get there : I can't test this right now, but I know that your blend function is the key - right now you are directly blending the texture onto the surface with alpha. Try changing your blend function. I've used these in the past: glBlendFunc (GL_ONE, GL_ONE); or glBlendFunc (GL_SRC_ALPHA, GL_ONE) There is a wiki entry for texture combiners: opengl.org/wiki/Texture_Combiners.

I'm will need to do that too for my app, once I get there :/. I can't test this right now, but I know that your blend function is the key - right now you are directly blending the texture onto the surface with alpha. Try changing your blend function.

I've used these in the past: glBlendFunc (GL_ONE, GL_ONE); or glBlendFunc (GL_SRC_ALPHA, GL_ONE); There is a wiki entry for texture combiners: opengl.org/wiki/Texture_Combiners.

Thanks for your answer, but these blend functions haven't solved the problem. I had a look at the article and although helpful, I want the alpha to, for example, apply to the background of the context and any object that is behind it. Is this even possible?

– Croc Jul 25 at 15:21 I'm sure its possible but I'm no expert on blend functions. So to clarify, if you have a square with one color on it, and you have a texture with that face and some alpha on it, you want the square color to blend through on the texture's alpha, but to display the texture with an unaltered color everywhere else? – sqrfv Jul 25 at 15:25 Also, check out this thread: stackoverflow.Com/questions/2841316/… – sqrfv Jul 25 at 15:39 I've checked it out thanks, and although I remember it being important for blending textures, it hasn't resolved the problem i'm having with alpha in the texture.

– Croc Jul 25 at 16:43 When I get a chance, I'll play around with my textures; but I'm not using alpha to blend - I just am multiplying colors. You may be better off trying to do a texture mask, but I don't really have a good idea what you have in mind ;) idevgames.Com/forums/thread-899. Html – sqrfv Jul 25 at 17:53.

I kept looking through examples and other peoples problems on the Stack Overflow website, and bumped into this example: Link Using the following code from this example, before drawing the texture blended the colour pointer with the texture: glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE); glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_RGB, GL_PREVIOUS); glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_RGB, GL_TEXTURE); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_MODULATE); glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_ALPHA, GL_PREVIOUS); glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_ALPHA, GL_TEXTURE); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA); This is now the result.

I am currently designing a game engine, and I have come across a problem in my images in that the alpha value in the images is not being rendered. I am currently using an OpenGL system where each texture object has buffers for vertex, colour and texture coordinates, which are bound and drawn together in the drawRect: method. Although alpha will blend the overall image, I want the colour used to blend into the texture, as it is currently acting as a 'backing' for the texture, becoming visible in the areas of the texture that have alpha.

When the colour isn't used when drawing, any alpha areas just appear white. Any suggestions on how it can be done? I have edited the gltexEnv() function to use GL_MODULATE instead of GL_BLEND.

This has no affect on the problem I am having, although I am going to continue using GL_MODULATE for alpha blending. To explain what I exactly need, I want to mainly be able to display images with the colour pointer provided blending the texture, rather than this colour being filled behind the texture, like it currently is. The texture data is being set correctly, and I have gone through many steps to narrow the problem down.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions