hello Michael,
i copy this mail to pd list, since it is of generic interest.
but first : did anyone have a working example of oculus rift in GEM?
Rendering on stereo is a nice idea, but as you noticed, in order to "sumarized" all the object it's easier to render in a framebuffer then distord this resulting image.
Ideally, you would use stereo parametter to render in a framebuffer, then render the framebuffer through a shader in the main windows (whitout stereo). but i dont thing you can do that in Gem.
Here is how i would do it. 2 framebuffer, and an abstraction that render primitive in the 2 framebuffer. then render this 2 framebuffer in the main windows with a shader, or merge this 2 FB in a 3d one and render this last FB with the shader.
some things need to be adjusted (angle of view of the virtual cam / eyes distance /framebuffer size, etc). and the shader has to be added...
Cheers c
Le 26/10/2013 17:58, Michael Mihocic a écrit :
Hi Cyrille,
I am still working on the Oculus Rift implementation and I finally managed to get some basic knowledge with shaders. However, now I know how to use shaders in Gem and on my Windows OS and I already played around with simple barrrel distortion examples... Thank you again for your previous support!!
You proposed a solution (your Email below) how to implement the barrel distortion to our virtual world: /"1st : left eye view without distortion, rendered in a frame buffer // //2nd : right eye view (no distortion / framebuffer) // //3rd : using the 2 previous texture and a shader, render the final image"/
I'm still having some questions: 1.) Our current world is using the gemwin "stereo" parameter to create 2 images (-> actually it is one Gem window, but we adjusted resolution and size to fit it to our old HMD and each eye can see only half of the image; see attachement). I'm wondering if it possible to use just ONE shader to render the entire image in one step?? But I'm not sure if this is possible with texturing?? If not: Will I still be able to use the "stereo" parameter in gemwin??
2.) As you can see in my screenshot: our world consists of many objects (cubes, lines, fadecrosses, spheres, ...). How can I summarize those objects, before processing them? Do I need to use a gemframebuffer for every single object??
My plan is to finish in 1(-2) months. If everything is working, I will provide the example patch & shaders to the pd/Gem community.
Best regards, Michael
Our current view:
Desired Rift distortion:
-------- Original-Nachricht -------- Betreff: Re: [GEM-dev] Oculus Rift distortion/support Von: Cyrille Henry ch@chnry.net An: Michael Mihocic michael.mihocic@oeaw.ac.at Kopie (CC): gem-dev@iem.at Datum: 25.07.2013 12:17
hello,
one have to use shader in order create the image distortion.
i think oculus should provide standard shader that you have to insert in your rendering process.
the only problem is that you have to do 2 rendering : one for each eye. The best solution is to do a 3 pass rendering : 1st : left eye view without distortion, rendered in a frame buffer 2nd : right eye view (no distortion / framebuffer) 3rd : using the 2 previous texture and a shader, render the final image
cheers c
Le 25/07/2013 12:04, Michael Mihocic a écrit :
Dear list,
we are using GEM with a head-mounted-display to present a virtual world to subjects performing acoustic localization experiments.
Now we plan to switch from our current HMD to Oculus Rift (an upcoming virtual reality head-mounted display). Therefore we need to modify our image and add (asymetric) barrel distortion to the represented image. (The image distortion is compensated by the lenses in Oculus Rift.)
My questions now:
- Is there an easy solution to implement barrel distortion to the rendered window in GEM?
- Does anybody of you already have some experience with GEM together with Oculus Rift?
Since attachments should be avoided in this list, I do not send any example pictures of the distortion or our current presented world. If you are interested you can either contact me and I can send you some screenshots, or you can google for example images/videos of Oculus Rift distortion.
Thanks in advance and best regards, Michael
-- Michael Mihocic Psychoacoustics & Experimental Audiology Acoustics Research Institute http://www.kfs.oeaw.ac.at/ Austrian Academy Of Sciences http://www.oeaw.ac.at/ Wohllebengasse 12-14 / 1 A-1040 Vienna, Austria Tel: +43 (1) 51581 2515 (Office) Tel: +43 (1) 51581 2525 (Lab) Fax: +43 (1) 51581 2530 michael.mihocic@oeaw.ac.at mailto:michael.mihocic@oeaw.ac.at