glsl top with htc vive?

Hello, so still experimenting with htc vive here. Going Glsl slightly! since otherwise really not enough power to animate much even with strong graphic card.

Now if you want a realistic shader you need to recompose image from several render tops to one glsl multy. Then you get control over refraction, color, fresnel…

I’d love to use this with the headset, but really not sure how to connect these things together or if its even possible.

When you open open vr render you connect geometry to the ‘render left eye’ then it transform to right eye and you get also eyeR and eyeL that are calculated according to position of headset in space.
Is there a way of connecting geo to ‘renderLeft’ and apply all the top stuff on these eyeR and EyeL? How do you do that? or maybe its not possible to connect after render composting to cameras. a bit lost here. I explained best I can, not sure if you’ll make sense out of it! thx anyway

I’m not quite sure what you mean with ‘realistic shader’.
Shaders exist in all size and sorts. You can have a GLSL material which applies to a Geometry, or you can have a fullscreen effect in a GLSL TOP.

For a fullscreen effect you always need to apply your GLSL TOP after the Render TOP (because Render TOP has to render your fullscreen image first, so you can apply your effect to it afterwards).
In this case, as you have two eyes, you need to use 2 GLSL TOPS. Place one after the Render TOP (“renderleft”),and place the other after the Render Select (“renderright”). The outputs of your shaders go into the OpenVR Out TOP.

Slight thread-jack:

My gut says you’re probably bottle-necking your CPU before you’re reaching your GPU. If you’re animating a lot of things in 3D, you should try to avoid animating SOPS, and instead either animate Geo COMPs or use instancing.

Hello, thx for reply, I’m a bit busy right now so not had time to mess more with it after all your clarifications.
Ok so it is possible using two gls top one for each eye. That is good news, not figured out how to connect all that for now that is why I was asking.
the composting technic; well you get a render for each color buffer then you add them all together for your final image (photorealistic or almost) then apply to each eye.
I’d share the file but I think its one of the strong points of this course I paid for, I respect my teacher’s work.

the machine here is quad core i7 (m6600 i think)
32gb ram and gtx1080,you think that could bottleneck al lot?
shit, in that case we need dual processor motherboard!

nettoyeur, you will recognise this patch! thx again for your help on that one.
Now I got the previous version(non glsl) running in vr with kinect controls.
now the mission will be connecting these glsl tops to each eye.

youtube.com/watch?v=69sgWC2eV1s&t=98s

:smiley: best thing i’ve heard all day. no worries.

Dual proc motherboard won’t help as much, because most of the elements in TouchDesigner that would cause a CPU bottleneck are single threaded, so having 1x fast i7 quad-core is often more bang for buck than having dual xeons that have a lower clock speed.

cool thx for tip.
what i dont understand is there is a switch to enforce 90fps.
should that thing not be turned on by default, saving time for all users!

Well only projects which use a Vive have to run at 90fps - so it would be a bit weird to set the TD default framerate to 90fps when most people use 30fps or 60 fps for their installations.

Hi greenpattern,
Just wondering what course where you following GLSL & VR sounds like an interesting course.

thanks.

Hi Oliviano
You put your finger on it, there is none combining both!
dig and dig more until you get fed up. or come back in a year. I’m only half joking.

github.com/nVoid/Introduction-to-touchdesigner
is the best I eventualy found for GLSL.
I did take a 2 course from Stanislav Glazov wich is where i got the most info about GLSL and a lot of other stuff very usefull. (I recomend these courses)
But it was still a bit hard to understand sometimes at least for me.

then you can find on forum some stuff about vive. just type vive in search

I am willing to learn like you but honestly dont have that much time to dedicate to patch up all info, I will probably come back to it later, I wish info was more clear and centralised.
maybe Linda course will make it simple fr us, lets see.
For me that is the most interesting part of touch designer but majority seems to do other things on it.

“Now if you want a realistic shader you need to recompose image from several render tops to one glsl multy. Then you get control over refraction, color, fresnel…”

Not sure if I understand clearly but after your render and before your openVR out you can composite whatever you want but you have to do it in the same fashion for both eyes.

You can copy the renderTOP duo, use the same cameras but different geometries and recompose that over your main renders. Then send both recomposed eyes to your openVR out.

It’s pretty simple really, but some things do not work. For example a feedbackTOP effect will not leave trails ‘in space’. You will juste have the feeling that pixels are stuck on your headset lenses and out of focus.

If you can share a simplified .toe to clarify the issues maybe I can help (i’m not good with glsl though).

as for fps, make sure your vsync is off, and your fps set to 90
Else it might cap at 60fps because of your maximum refresh rate on your monitor.

Hi Sidecarstudio. great tip the Vsynch off.
that is the thing if you want enough power to move a lot in VR it has to be GLSL from what I see.
since the gtx1080 here is showing first signs of lag. no king of optimisation either here.
So that recomposition of the image like you said is where I have problems.

Basically cannot figure out how to connect that to the 2 eyes(cameras).
I wish someone would share an example of that, I tried allsorts of connections here and I’m sure I’m very close.
other GLSl non top is cool that works well, very entertaining trying some shadertoys code in vr.

I’m still not sure what you’re trying to do :stuck_out_tongue:

Here’s some examples that might help
pushpinsvr.4.toe (14.3 KB)
vr composite test.toe (9.03 KB)

Waw that gives me a better idea, the setup i have in patch is a bit different.
is there a way I can send you a file in person on this chat?

cool we can send privat messages!