googlevr / cardboard

Open source Cardboard SDK and samples
Other
1.48k stars 253 forks source link

Question. Which eye is currently being rendered - define(s) - shader level - using Unity #195

Closed Ste-RH closed 3 years ago

Ste-RH commented 3 years ago

I am requiring a define that I can use at shader level to determine whether the Google Cardboard XR Plugin is active.

At the core I am wanting to determine which eye is being rendered at vertex shader level. Unity has an in-built variable 'unity_StereoEyeIndex' that can be used. I can use the define 'UNITY_SINGLE_PASS_STEREO' to determine it's validity when using other VR solutions, and it indeed the variable is valid when using the Google Cardboard XR Plugin. But as I am in common code, I require a define to determine if it is valid.

Can anyone help?

jballoffet commented 3 years ago

Thanks for reaching out to us! Sorry for the long delay here. Given that this issue is highly related to #146, I'm marking this issue as a duplicate. I have left some pointers in the aforementioned issue, and please reach out to us again there if needed. Thanks!