Jump to content
  • Advertisement
Sign in to follow this  
LorenSoth

after VBO blending isnt working !

This topic is 4725 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, Im using multitexturing with VertexBufferObject, GL_TEXTURE0_ARB = MAINTEXTURE; GL_TEXTURE1_ARB = ALPHAMAP ; i then multiplicate them with GL_MODULATE, anyway everything is ok. but then when i use GL_BLEND (GL_ONE, GL_ONE ) (for addition) with another texture (for 2nd pass), it wont take the combination of the multitextured texture and my new texture. It was working perfect with vertex arrays anyway.. Any idea ? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Maybe I'm wrong, as I don't have too much experience with this one, but isn't GL_BLEND (GL_ONE, GL_ONE); jsut going to come out as the flat color? I thought Additive blending was something like GL_BLEND(GL_DST_ALPHA, GL_SRC_ALPHA);

Just a thought.

Share this post


Link to post
Share on other sites
No idea as to the solution to the problem. I will probably be implementing VBOs and stuff in the next week in my code, I might could help then.

The GL_ONE GL_ONE blend is something like this: (TEX1_ALPHA * TEX1_COLOR + TEX2_ALPHA * TEX2_COLOR)/2 = final color.

Share this post


Link to post
Share on other sites
Quote:
Original post by LorenSoth
...but then when i use GL_BLEND (GL_ONE, GL_ONE ) (for addition) with another texture (for 2nd pass)...
Does that texture work if you try rendering just with that (ie: don't render the multitexture pass and just render the other pass)? If not then it is not being created properly and you need to fix that before moving onto a (possible) blending problem.
Quote:
Original post by LorenSoth
...It was working perfect with vertex arrays anyway...
How are you doing it now if you aren't using vertex arrays? How is it different? Post the code that worked before and post the new code that doesn't work.


As for the blend equation, (GL_ONE, GL_ONE) is additive blending. It will be...
result = 1*source + 1*destination
where source is the incoming RGBA values and destination is the RGBA values already in the framebuffer at that pixel. So it's just the sum of source and destination, no division. A blend equation of (GL_ONE, GL_ZERO) is equivalent to having blending disabled and is the default blend equation. It is...
result = 1*source + 0*destination

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!