Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualharshman_chris

Posted 13 March 2013 - 05:02 PM

Your loading code looks correct enough (you might want to revisit how you're handling sampler objects, but that's for another topic).

 

Are you calling glEnable (GL_BLEND) anywhere, and are you setting glBlendFunc?  It's not enough to just load a texture with alpha, you need these too.

 

Yes I am, but given that the colour of the texture is off (GL_BLEND wont do this), it has to be something within the texture loading code as far as I can see.

 

Edit:

 

So after playing around a bit, I at least found some of the issue, rather than swapping bytes in the image, I just tell the image that it is GL_BGRA and that solves the colour issue, but the background is still visible. in addition to blending all my particles are deferred to draw after all other 3 components. In the shader, adjusting the alpha does work, the particles do fade out over there life time.

 

Edit:

 

So I resolved the issue not, I added a discard to the fragment shader and now it works.


#4harshman_chris

Posted 13 March 2013 - 04:59 PM

Your loading code looks correct enough (you might want to revisit how you're handling sampler objects, but that's for another topic).

 

Are you calling glEnable (GL_BLEND) anywhere, and are you setting glBlendFunc?  It's not enough to just load a texture with alpha, you need these too.

 

Yes I am, but given that the colour of the texture is off (GL_BLEND wont do this), it has to be something within the texture loading code as far as I can see.

 

Edit:

 

So after playing around a bit, I at least found some of the issue, rather than swapping bytes in the image, I just tell the image that it is GL_BGRA and that solves the colour issue, but the background is still visible. in addition to blending all my particles are deferred to draw after all other 3 components. In the shader, adjusting the alpha does work, the particles do fade out over there life time.


#3harshman_chris

Posted 13 March 2013 - 04:58 PM

Your loading code looks correct enough (you might want to revisit how you're handling sampler objects, but that's for another topic).

 

Are you calling glEnable (GL_BLEND) anywhere, and are you setting glBlendFunc?  It's not enough to just load a texture with alpha, you need these too.

 

Yes I am, but given that the colour of the texture is off (GL_BLEND wont do this), it has to be something within the texture loading code as far as I can see.

 

Edit:

 

So after playing around a bit, I at least found some of the issue, rather than swapping bytes in the image, I just tell the image that it is GL_BGRA and that solves the colour issue, but the background is still visible. in addition to blending all my particles are deferred to draw after all other 3 components.


#2harshman_chris

Posted 13 March 2013 - 04:57 PM

Your loading code looks correct enough (you might want to revisit how you're handling sampler objects, but that's for another topic).

 

Are you calling glEnable (GL_BLEND) anywhere, and are you setting glBlendFunc?  It's not enough to just load a texture with alpha, you need these too.

 

Yes I am, but given that the colour of the texture is off (GL_BLEND wont do this), it has to be something within the texture loading code as far as I can see.

 

Edit:

 

So after playing around a bit, I at least found some of the issue, rather than swapping bytes in the image, I just tell the image that it is GL_BGRA and that solves the colour issue, but the background is still visible.


#1harshman_chris

Posted 13 March 2013 - 04:44 PM

Your loading code looks correct enough (you might want to revisit how you're handling sampler objects, but that's for another topic).

 

Are you calling glEnable (GL_BLEND) anywhere, and are you setting glBlendFunc?  It's not enough to just load a texture with alpha, you need these too.

 

Yes I am, but given that the colour of the texture is off (GL_BLEND wont do this), it has to be something within the texture loading code as far as I can see.


PARTNERS