[GEM-dev] Oculus Rift distortion/support

Michael Mihocic michael.mihocic at oeaw.ac.at
Wed Sep 11 13:40:51 CEST 2013


Thanks again for your help!!

What I did:
- I downloaded and installed Pd-extended for Windows from here: 
http://puredata.info/downloads/pd-extended (v0.43.4, Windows Installer)
- I started pd with "pd-extended.bat" in pd folder
- When I'm running pd all GEM details are displayed (version,...) -> I 
guess GEM is loaded properly
- I opened example patch 01.simple_texture.pd in folder 
\extra\Gem\examples\10.glsl
- I can load the images but when I want to load the shader these error 
messages are displayed:
     [glsl_vertex]: error reading file
     [glsl_fragment]: error reading file
- after replacing all CRLF by CR I receive different error messages, as 
I described below!?
I could load neither .vert nor .frag files! I will send them to you in a 
seperate email.
The files are existing and found by pd, otherwise I would receive a 
different error message....

Br, Michael

-------- Original Message --------
Subject: Re: [GEM-dev] Oculus Rift distortion/support
From: Cyrille Henry <ch at chnry.net>
To: gem-dev at iem.at
Date: 11.09.2013 12:03
>
>
> Le 11/09/2013 08:35, Michael Mihocic a écrit :
>> Dear list,
>>
>> I tried to get familiar with shaders in GEM. I started with 
>> "01.simple_texture.pd" in folder 10.glsl.
>>
>> I can start rendering (checking "rendering") but I cannot load 
>> shaders. After checking the rendering checkbox 2 errors occur:
>>      [glsl_vertex]: need to load a shader
>>      [glsl_fragment]: need to load a shader
>>
>> When I try to use shaders (click on "load shader") I receive the 
>> error message:
>>      linking: link 1.5 3.5
>>      [glsl_program]: Info_log:
>>      [glsl_program]: Vertex info
>>      -----------
>>      (0) : error C5145: must write to gl_Position
>>      [glsl_program]: Link failed!
>>
>> These errors occur when I either try to open a ".vert" or a ".fraq" 
>> file! Do you have any ideas what I could try to use different 
>> shaders??? Below I'm listing my system details:
>>
> are you really sure you did not modifies oher things in the shader code?
> if so, could you send them to me so that i can check.
> c
>
>
>> - pd: 0.43.4-extended
>> - GEM: 0.93.3
>> - System: Windows 7-64
>> - Folder contains no spaces: "C:\pd-0.43.4\extra\Gem\examples\10.glsl"
>> - I replaced all CRLFs with CRs as I found in 
>> https://sourceforge.net/p/pure-data/bugs/864/?page=2 (otherwise I get 
>> the errors
>>      [glsl_vertex]: error reading file
>>      [glsl_fragment]: error reading file
>> - I also tried to run pd with Admin permissions
>>
>> Thanks in advance!!
>>
>> Br, Michael
>>
>>
>> -------- Original Message --------
>> Subject: Re: [GEM-dev] Oculus Rift distortion/support
>> From: Jack <jack at rybn.org>
>> To: gem-dev at iem.at
>> Date: 25.07.2013 12:22
>>> Hello,
>>>
>>> Yep, and if oculus doesn't provide a shader for barrel distortion, 
>>> there
>>> is plenty of example on the web.
>>> ++
>>>
>>> Jack
>>>
>>>
>>>
>>> Le 25/07/2013 12:17, Cyrille Henry a écrit :
>>>> 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
>>>>>
>>>> _______________________________________________
>>>> GEM-dev mailing list
>>>> GEM-dev at iem.at
>>>> http://lists.puredata.info/listinfo/gem-dev
>>>
>>> _______________________________________________
>>> GEM-dev mailing list
>>> GEM-dev at iem.at
>>> http://lists.puredata.info/listinfo/gem-dev
>>
>> -- 
>> 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>
>>
>>
>> _______________________________________________
>> GEM-dev mailing list
>> GEM-dev at iem.at
>> http://lists.puredata.info/listinfo/gem-dev
>>
>
> _______________________________________________
> GEM-dev mailing list
> GEM-dev at iem.at
> http://lists.puredata.info/listinfo/gem-dev

-- 
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/gem-dev/attachments/20130911/7084470c/attachment.htm>
-------------- next part --------------
// Cyrille Henry 2007

//#extension GL_ARB_texture_rectangle : enable
//uniform sampler2DRect MyTex;
uniform sampler2D MyTex;
uniform float B,C;

void main (void)
{
 vec4 color = texture2D(MyTex, (gl_TextureMatrix[0] * gl_TexCoord[0]).st);

 color *= B+1.; // brightness
 vec4 gray = vec4(dot(color.rgb,vec3(0.2125,  0.7154, 0.0721)));
 color = mix(gray, color, C+1.); // contrast
 gl_FragColor = color;
}
-------------- next part --------------
// Cyrille Henry 2007

void main()
{
    gl_TexCoord[0] = gl_MultiTexCoord0;
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

}


More information about the GEM-dev mailing list