[PD] Oculus Rift shader in pd/Gem

Michael Mihocic michael.mihocic at oeaw.ac.at
Fri Nov 1 10:32:40 CET 2013

Hello Cyrille!

Thank you again! That was the problem, you were right!! I was searching 
for a bug or explanation among the wrong objects....
I think it should be working now! I try to implement it to a more 
complex world.

Br, Michael

-------- Original-Nachricht --------
Betreff: Re: Oculus Rift shader in pd/Gem
Von: Cyrille Henry <ch at chnry.net>
An: Michael Mihocic <michael.mihocic at oeaw.ac.at>, pd-liste List 
<PD-list at iem.at>
Datum: 31.10.2013 17:13
> hello Michael,
> translate did not work because the shader did not use the 
> transformation matrix (that translate, scale etc are modifying). the 
> shader use texture corrdinate as vertex position.
> see this line in the vert shader :
>     gl_Position = gl_Vertex;
> usually you have somthing like :
>     gl_Position = ftransform();
> cheers
> c
> Le 31/10/2013 16:31, Michael Mihocic a écrit :
>> Hy Cyrille,
>> based on your example I could implement the Rift shadering and I can 
>> render the left and right eye seperatly. Thank you once again!
>> But the two shadered images (left and right) are behind each other 
>> and I cannot use "translateXYZ" (x-axis translation) to move them to 
>> their sides!? Do you have any idea?? The attached example 
>> (rift_example.pd) includes more comments and is probably a better 
>> explanation...
>> Br, Michael
>> -------- Original-Nachricht --------
>> Betreff:     [GEM-dev] Fwd: Re: Oculus Rift distortion/support
>> Datum:     Sun, 27 Oct 2013 18:51:33 +0100
>> Von:     Michael Mihocic <michael.mihocic at oeaw.ac.at>
>> An:     <gem-dev at iem.at>
>> Hy Cyrille,
>> thank you again for your quick reply!!
>> Good idea, I also replied to the Gem list! (I'm not registered at the 
>> pd list...)
>> (Sorry, if someone might be annoyed about my attachments...)
>> Attached you can find my progress so far but I have to mention that 
>> my scripts are still "under construction" - and not only the 
>> parameters far from optimized.... ;-)
>> My example consists of:
>> - rift_list.pd        -> is the pd patch to be started, follow the 
>> instructions on top of the file
>> - riftshader.pd is used for the distortion parameters, when using the 
>> shaders:
>> - r4.frag/r4.vert are the shader files
>> - test.jpg is just any test file which will be distorted
>> I'm not using gemframebuffers in my patch. Currently I am simply 
>> loading 2 times the same image and processing the barrel distortions 
>> on each half of the image, left and right.
>> But as I described below, our actual world does not consist of one 
>> image but of many objects (spheres, cubes, lines,...) within a big 
>> sphere, and the user can rotate his head inside the sphere. 
>> ((tracking will not be done with Oculus Rift tracker))
>> -> theoretically, my perfect solution would be to apply the 
>> distortion to "the entire stereo gemwin" somehow!? ;-)
>> Following the idea of your patch and introducing gemframebuffers, do 
>> you think I can realize it that way:
>> - every object needs to be rendered twice instead of once, and in a 
>> framebuffer, sent to the abstraction "gemhead_rift"
>> - the barrel distortion is applied in the abstraction "gemhead_rift", 
>> the parameters depending on left or right
>> - instead of using "stereo", I create a wider window and add 
>> X-axis-translation
>> Do you think it should work that way?
>> Br, 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 at oeaw.ac.at <mailto:michael.mihocic at oeaw.ac.at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20131101/7f823492/attachment.htm>

More information about the Pd-list mailing list