<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello Cyrille!<br>
<br>
Thank you again! That was the problem, you were right!! I was
searching for a bug or explanation among the wrong objects....<br>
I think it should be working now! I try to implement it to a more
complex world.<br>
<br>
Br, Michael<br>
<br>
<br>
<div class="moz-cite-prefix">-------- Original-Nachricht --------<br>
Betreff: Re: Oculus Rift shader in pd/Gem<br>
Von: Cyrille Henry <a class="moz-txt-link-rfc2396E" href="mailto:ch@chnry.net"><ch@chnry.net></a><br>
An: Michael Mihocic <a class="moz-txt-link-rfc2396E" href="mailto:michael.mihocic@oeaw.ac.at"><michael.mihocic@oeaw.ac.at></a>, pd-liste
List <a class="moz-txt-link-rfc2396E" href="mailto:PD-list@iem.at"><PD-list@iem.at></a><br>
Datum: 31.10.2013 17:13<br>
</div>
<blockquote cite="mid:527281A5.4070603@chnry.net" type="cite">hello
Michael,
<br>
<br>
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.
<br>
see this line in the vert shader :
<br>
gl_Position = gl_Vertex;
<br>
usually you have somthing like :
<br>
gl_Position = ftransform();
<br>
<br>
cheers
<br>
c
<br>
<br>
Le 31/10/2013 16:31, Michael Mihocic a écrit :
<br>
<blockquote type="cite">Hy Cyrille,
<br>
<br>
based on your example I could implement the Rift shadering and I
can render the left and right eye seperatly. Thank you once
again!
<br>
<br>
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>
<br>
Br, Michael
<br>
<br>
<br>
<br>
-------- Original-Nachricht --------
<br>
Betreff: [GEM-dev] Fwd: Re: Oculus Rift distortion/support
<br>
Datum: Sun, 27 Oct 2013 18:51:33 +0100
<br>
Von: Michael Mihocic <a class="moz-txt-link-rfc2396E" href="mailto:michael.mihocic@oeaw.ac.at"><michael.mihocic@oeaw.ac.at></a>
<br>
An: <a class="moz-txt-link-rfc2396E" href="mailto:gem-dev@iem.at"><gem-dev@iem.at></a>
<br>
<br>
<br>
Hy Cyrille,
<br>
<br>
thank you again for your quick reply!!
<br>
Good idea, I also replied to the Gem list! (I'm not registered
at the pd list...)
<br>
(Sorry, if someone might be annoyed about my attachments...)
<br>
<br>
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.... ;-)
<br>
<br>
My example consists of:
<br>
- rift_list.pd -> is the pd patch to be started,
follow the instructions on top of the file
<br>
- riftshader.pd is used for the distortion parameters, when
using the shaders:
<br>
- r4.frag/r4.vert are the shader files
<br>
- test.jpg is just any test file which will be distorted
<br>
<br>
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.
<br>
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))
<br>
-> theoretically, my perfect solution would be to apply the
distortion to "the entire stereo gemwin" somehow!? ;-)
<br>
<br>
Following the idea of your patch and introducing
gemframebuffers, do you think I can realize it that way:
<br>
- every object needs to be rendered twice instead of once, and
in a framebuffer, sent to the abstraction "gemhead_rift"
<br>
- the barrel distortion is applied in the abstraction
"gemhead_rift", the parameters depending on left or right
<br>
- instead of using "stereo", I create a wider window and add
X-axis-translation
<br>
<br>
Do you think it should work that way?
<br>
<br>
Br, Michael
<br>
</blockquote>
</blockquote>
<br>
<div class="moz-signature">-- <br>
Michael Mihocic<br>
Psychoacoustics & Experimental Audiology<br>
<a href="http://www.kfs.oeaw.ac.at/">Acoustics Research Institute</a><br>
<a href="http://www.oeaw.ac.at/">Austrian Academy Of Sciences</a><br>
Wohllebengasse 12-14 / 1<br>
A-1040 Vienna, Austria<br>
Tel: +43 (1) 51581 2515 (Office)<br>
Tel: +43 (1) 51581 2525 (Lab)<br>
Fax: +43 (1) 51581 2530<br>
<a href="mailto:michael.mihocic@oeaw.ac.at">michael.mihocic@oeaw.ac.at</a><br>
</div>
</body>
</html>