Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Edge Blending

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

Hi everyone,

I want to do edge blending for multiple projectors. I am going to use OpenGL library. I am not very experienced with computer graphics and OpenGL. I could not find any good sources on internet. What libraries or tools should I use? 

Share this post

Link to post
Share on other sites

You want this:



The goal is to have a relative luminance of 100% (that is, the same as if everything was a single projector) everywhere. So ideally, you would just have some overlapping border region where you dim both sides by 50%. Unluckily, if you adjust your projectors so the images don't overlap perfectly, it looks absolutely horrible at the intersection line. To avoid that, you do some blending.


Basically, you draw two quads (three in the case of a "middle" projector) per screen with proper texture coordinates (0.0 and 1.0 at the extremes, and whatever fraction you chose as border for the small bit), plus this single one "mix" attribute, read a texel, multiply it with the mix value in the shader, and write it out as fragment color.


This can be achieved exploiting vertex attribute interpolation with additive blending and a single extra vertex attribute, which is either 1.0 or 0.0. If linear blend does not look good enough (though I'm almost sure it does!), you can experiment by it through smoothstep, that might give a nicer looking result.


The nice thing about exploiting vertex interpolation is that you can even account for your projectors being a little tilted or distorted, if need be. For that, just move the vertices a bit horizontally, so the border area gets tilted too, until it looks good enough.


Now, so much for the nice theoretical part. In practice, you'll probably have different projectors running with different gamma, color profiles, lamp brightness and whatnot, so you may have to add some adjusters for that, too.

Or, you'll have to be careful to properly adjust all projectors to the same physical properties (as good as you can).


All that can be done in OpenGL without any special libraries, though it may require a bit of experimentation.

Edited by samoth

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!