Sign in to follow this  
ucanbizon

OpenGL Edge Blending

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:

[attachment=17070:path4437.png]

 

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this