Jump to content
  • Advertisement
Sign in to follow this  
Gazoo

OpenGL OpenGL Vertex shader transparrency?

This topic is 4073 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

Hey Forummers, I hope you'll bare with me on this perhaps stupid endeavor... I'm having a bit of trouble alpha blending with OpenGL and Cg. I've searched this forum and found a handfull of posts, but almost all of them are related to DirectX and the rest I've been unable to gain any wisdom from. So basically I guess my question is if someone else has performed any alpha blending using only the vertex shader and OpenGL? I've tried messing a bit around with the alpha value and enabling blending in OpenGL, but so far no luck... And enabling blending in OpenGL (glEnable(GL_BLEND);) basically cuts my framerate to pieces (1/4) even if I haven't rendered a single quad... Much appreciate any hints or suggestions... Regards, Gazoo

Share this post


Link to post
Share on other sites
Advertisement
I'm not sure I get it... you're asking to perform blend w/o GL_BLEND?
That's simply impossible, unless you want to ping-pong rendertargets, something which will kill your perf anyway.

The VS by itself does know nothing about BLEND. In fact, BLEND is implemented in its own stage (the Raster Operation Unit or Output Merger, as it's called).

There's screen door-transparency, which works surprisingly well on antialiased renderings but it's still a far cry from being usable!

Share this post


Link to post
Share on other sites
do you mean that you just want to override fixed pipeline vertex shader stage? if so i everything should work like without vertexshader but you'll have to set the gl_Color varying.

Share this post


Link to post
Share on other sites
Hey,

Thanks for the response... I clearly did not express myself properly... I am by most standards an OpenGL noob :) In other words, I have never used the blending functionality.

I wasn't sure that activating GL_BLEND was the only way to achieve blending which - as far as - I know now is absolutely necessary... Yes? Anyway... I am surprised by the fact that rendering quads using blending takes so much time. But I assume this is not uncommon. I was just not expecting such a performance drop...

So uh... I think the issue is resolved... One must activate GL_BLEND and expect quite a performance hit in comparison to regular quads...

Regards,

Gazoo

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!