Page 1 of 1
Shader for rear sphere projection
Posted: 05 Dec 2013, 14:46
by in_ty
Hi everybody! I need to create a content for the rear projection sphere. So I need to put everything to the render target and then apply a shader, which transforms coordinates to polar, to the texture. I am absolutly nube in shaders and have no time to learn them before the event, maybe somebody can give an advice, what is the best way to solve a problem? I've found this shader for vvvv
http://vvvv.org/tiki-download_file.php?fileId=2063 but it doesn't work correct in ventuz, or maybe I am doing smth wrong...
Re: Shader for rear sphere projection
Posted: 06 Dec 2013, 12:57
by Götz_B
Hi,
how should your expected result look? And how does it differ from the shader output?
Can you post a pre-post picture as an example?
Regards,
Götz
Re: Shader for rear sphere projection
Posted: 06 Dec 2013, 19:35
by joysprod
Im guessing that In ty is wanting to do something similar to the "Pufferfish" sphere projection?
http://wiki.openstreetmap.org/wiki/Pufferfish_Display
Pufferfish is a system of using a media server (Coolux have written a distort filter) to project inside a sphere with an extremely wide angle lens from a single projector. To make this work you have to take an Equi-rectangular-projection and convert it to an earth-azimuthal-projection. It should then project correctly inside the sphere.
I dont know what is coming in the later version of Ventuz with warping and blending?
Regards
Peter
Re: Shader for rear sphere projection
Posted: 06 Dec 2013, 20:04
by in_ty
Yes, joysprod is absolutly right! Here is my example in vvvv

Re: Shader for rear sphere projection
Posted: 09 Dec 2013, 11:22
by Götz_B
Ok... i just asked because thats exactly the output your posted shader produces.
You probably did not set all needed input values properly. The Shader need a Texture and a Matrix. The texture comes from a Texture Loader of course. I took a Camera to provide a standard ViewMatrix to the shader.
MipMaps can produce unwanted effects here, so try to set GenMipMaps to False on the TextureLoader.
BUT:
You can achieve almost the same result without the need for a shader. Just take a Circle and set the Texture from Flat to Wrap. You need to increase the Tesselation to get proper results. Plus, i needed to adjust the Scaling of the Texture Mapping to -1 because the texture was mirrored. If needed, scale the Circle according to the aspect ratio of your texture.
The result is the same, but without the distorted parts that are not part of the picture anyway.