subpixel
Re: Edge-blended projectors using OGL?
Reply #1 - Mar 23rd , 2010, 9:15pm
I don't know how to set it up and make it work from Java, but I'm thinking you could do it with a pixel shader (maybe using an extra texture). Output 'looks like' this (single wide image, left side will go to left projector, right side will go to right projector) AAAAAAAaaa|bbbBBBBBBB AAAAAAAaaa|bbbBBBBBBB AAAAAAAaaa|bbbBBBBBBB AAAAAAAaaa|bbbBBBBBBB A: source pixels displayed 'as-is' a: source pixels 'fading out' (going to the right) b: source pixels 'fading in' (going to the right) B: source pixels displayed 'as-is' b & B: source pixels displaced horizontally (grabbed from lesser x coordinate) So, what do we need? Dimming and x-displacement. Easy enough. Create a texture that uses, say, red and green channels to indicate dimming and displacement, or perhaps some parameters to the shader which allow it to calculate for itself how much overlap to use and the falloff gradients - this is probably more practical, so you can adjust the overlap to match the projectors instead of the other way around! I have a feeling it may be convenient to displace BOTH sides towards the centre (that is, displace the left display towards the right and the right display towards the left), especially if you are rendering 3D, else the vanishing point won't be in the middle. You might have some problems with the falloff gradients - if you use a linear gradient, I'm guessing that won't account for brighter colours not being (visibly) linearly brighter than darker colours. Maybe it isn't so bad, and maybe you already have this problem sorted! (If so, do share.) -spxl