Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by mikaelemtinger · Mar 16, 2017 at 01:48 PM · shadervr

Blit 2D Texture into both eyes in Single Pass Stereo

I would like to blit a 2D Texture into both eyes in Single Pass Stereo mode, but I can't seem to find the right shader algorithm to get the texture centered in the right eye. The left eye works but the right needs to be a little bit offset - with a value around 0.056.

In my Image Effect shader I do something like:

 uv.x += 0.056 * unity_StereoEyeIndex;

The 0.056-offset I've manually figured out after trying everything from measuring distance between the VRNode.LeftEye and VRNode.RightEye and the same projected in screen space. It gets close but no cigar. I've also tried to extract what is stored in unity_StereoScaleOffset but the values doesn't seem to have any correlation to 0.056. I've tried ComputeNonStereoScreenPos and ComputeGrabScreenPos in all ways I can think of, but no result.

It should be noted that 0.056 works independent of the distance between my lenses. The 0.056 translates to about 84 pixels (VRSettings.eyeTextureWidth * 0.056).

Anyone understand this value?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mikaelemtinger · Apr 07, 2017 at 06:55 PM 0
Share

Adding to the mystery: the 0.056 is for Vive. Oculus has a value around 0.135. So it depends on the hardware. I've also tried to put a plane at the camera's far clip plane with the texture and that sort of works but gives a distortion I don't fully grasp. I've also tried all the tricks described here... https://docs.unity3d.com/$$anonymous$$anual/SinglePassStereoRendering.html ...but without any luck. Anyone?

avatar image Split82 · Aug 14, 2017 at 04:35 PM 0
Share

I'm struggling with exactly the same problem :(

avatar image mikaelemtinger · Aug 14, 2017 at 05:04 PM 1
Share

Turns out the problem is related to skewed frustrums and really hard to solve "the right way". What I ended up doing, was putting the image on a huge plane at the camera far plane. Unfortunately I cannot share the code as it's part of a closed-source project.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

108 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Textures missing after extended gameplay on Playstation game,Missing Textures after extended play on Playstation 4 game 1 Answer

Transparent objects scheduling - Unity 3D - VR 0 Answers

Flip cubemap image from within the shader. 1 Answer

[Oculus Rift] AvatarSurfaceShaderSelfOcluding.shader will not import 0 Answers

What water should I use for VR specifically a google cardboard game. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges