Jump to content

OpenGL VR shaders


Guest tar

Recommended Posts

Quick question. Is there any barrier to having a VR lens shader in the OpenGL viewport?

Shader Toy talks about it:

Shadertoy shaders can create images for Virtual Reality (VR) mediums seamlessly. For that shaders must implement the mainVR() entry point, which is optional and has this prototype:

void mainVR( out vec4 fragColor, in vec2 fragCoord, in vec3 fragRayOri, in vec3 fragRayDir )

where fragCoord and fracColor work the same as in regular 2D image shaders: they contain the pixel coordinates in surface space and the output pixel color.

the variables fragRayOri and fragRayDir contain the ray origin and ray direction of the ray that goes through that pixel in the virtual world, given in tracker space. The shader is expected to transform these values into camera space if a moving camera is to be moved though the virtual world. The ray origin is given as variable and not uniform for VR systems where the camera is not modelled as a pinhole camera.

Shaders that implement the mainVR entrypoint will automatically be flagged as VR ready and will be searchable though the filter system under the VR qualifier.

https://www.shadertoy.com/howto

Link to comment
Share on other sites

The main barrier is performance, the lens shaders themselves are pretty simple. Maintaining 90fps at all times when we don't have any control over what is displayed, is the main problem. I suspect we'd have to severely restrict how things are displayed when in any sort of "VR" mode (shaded only, normal quality lighting, no visualizers, etc).

Link to comment
Share on other sites

Cool. Thanks! Makes sense. Found a 3d roller coaster examples at https://vr.chromeexperiments.com/

Using Nuke's CaraVR tools I'm kind of getting used to looking at LatLongs in the 2d viewport to make some judgments. Crazy thoughts but could that every happen in the Houdini viewport? a LatLong openGL shader even if it's low performance.

Screen Shot 2016-07-21 at 9.02.26 am.png

Link to comment
Share on other sites

  • 3 weeks later...

i second that Marty !

Having the ability to open a VR preview canvas, that open an OpenGL view with a camera compatible with standard HMD would be great.

To have those 2 option would be cool :

1 - Direct HMD access from houdini like UE4 VR preview

https://docs.unrealengine.com/latest/INT/Platforms/Oculus/QuickStart/5/index.html

2 - Extend display with standard Android sensor recognition 

https://developer.android.com/guide/topics/sensors/sensors_motion.html

 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...