Forum Discussion
Fiore
12 years agoHonored Guest
Different geometry rendered to each eye
Is it possible to have 2 pieces of geometry in Unity, and have each one only viewable from a single eye?
I do not have a rift to test, but am looking at ways to use one billboard for each eye, each with offset pre-rendered image that would represent a single 3D object when viewed through the rift.
I do not have a rift to test, but am looking at ways to use one billboard for each eye, each with offset pre-rendered image that would represent a single 3D object when viewed through the rift.
31 Replies
Replies have been turned off for this discussion
- AnotherAtreyuExpert ProtegeDang that's an interesting idea Fiore. I'm not sure though, it sounds somewhat 'headachy' to me, but perhaps I just don't grasp the concept in it's entirety.
I'm curious to know how it works out! - owenwpExpert ProtegeEasy to do, just put a call in OnPreRender on each eye that sets a global shader constant for the eye number, and use it as a branch condition or texture offset. Check the docs for the shader class.
- ScsiOverdriveExplorerAnother solution:
- Create two new layers named "left eye" and "right eye"
- Adjust what layers each camera has visibility to (left camera cant see right eye, etc.)
- Assign the special billboarded textures to each eye - cyberealityGrand ChampionI had the idea of stereoscopic billboards for a while now, but I haven't seen them used yet.
Would be awesome if you got this working. - sh0v0rProtege
"scsioverdrive" wrote:
Another solution:
- Create two new layers named "left eye" and "right eye"
- Adjust what layers each camera has visibility to (left camera cant see right eye, etc.)
- Assign the special billboarded textures to each eye
Yeah this is the simplest way to control what a camera renders. - judivaHonored GuestI tried to "OnPreRender" approach without success.
I am using Unity 5.1.1f1 with a pre 0.6.0.1 SDK (the one just before, can't remember the number). I'm not using the latest SDK because I can't get it to display the dual view inside the Unity editor.
Anyway, I'm seeing that the onPreRender callbacks are called, but they have no effect on the rendering.
I have set it up so that the geometry is rendered in red on left eye and blue on right eye (using a material shader parameter).
Anyway, what I am seeing in the GearVR is that both cameras render the scene in blue (meaning that only the shader settings from the right eye are taken into account). Since right eye is rendered after left eye, I'm guessing my callback is overwriting the shader's value, so both eyes get the same value.
Has anyone been successful with this approach?
I'm considering trying this out with sdk 0.6.0.1, but the fact that I can't get OVR initialized in the editor and get no dual view is a real pain... - judivaHonored GuestOk I did run a test with SDK 0.6.0.1 / Unity 5.1.1 and it works :)
- AlfredoCarsiHonored GuestHow did you access to the sdk directly from unity???
- cyberealityGrand ChampionYou can't use the SDK directly in Unity. You'd use the integration or (preferably) the utilities.
- TomGExplorer
"judiva" wrote:
Ok I did run a test with SDK 0.6.0.1 / Unity 5.1.1 and it works :)
Could you share some example code on how to accomplish this? i went ahead and added a new camera on to each eye anchor and removed some code in OVRCameraRig so they would not get disabled in the 6.0.1 tools.
This works and stereoscopic bilboards are great to look at, but i would like to avoid the 2 extra cameras.
Also for some reason, movement seems a bit wonky, where the default OVRPlayerController would not walk perfectly in the direction you're looking. when i disable my 2 new cams and just enable the center one, the movement is as expected.
a movieMaterial where the offset can be controlled acording to the eye that is rendering at that time would be great. I'm just starting unity (coming from the flash world) but if you want to go Oculus.... (and have a comunity that is still arround :-) ) go Unity :-)
Thanks in advance for any more detailed pointers on how to accomplish this.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 2 years ago
- 8 months ago