OSVR / OSVR-Unity

Package for authoring OSVR experiences with Unity.
Apache License 2.0
99 stars 38 forks source link

Duplicate eye surface #111

Closed DuFF14 closed 8 years ago

DuFF14 commented 8 years ago

An attempt at making sure VRSurfaces have image effects/components copied to them.

DuFF14 commented 8 years ago

I've added a VREye (with a VRSurface child) next to VRViewer in the VRDisplayTracked prefab. If the configuration calls for one eye, it uses this one and doesn't create any new objects at runtime. If the configuration calls for more than one eye (and there is a VREye found in the scene), it duplicates the VReye that is found, which also duplicates the VRSurface and all of its components and image effects that a developer might want on there for their game.

Should probably add in some error checking for if the number of VRViewers or VREyes in the scene exceeds that number of VRViewers or VREyes expected from the DisplayConfig (same for VRSurfaces).

DuFF14 commented 8 years ago

Attempts to solve https://github.com/OSVR/OSVR-Unity/issues/75

JeroMiya commented 8 years ago

This looks good to me on a sight review.

DuFF14 commented 8 years ago

This passed my tests, using a "Particles.unity" scene distributed with Unity's Standard Assets package. The image effects seem to work just fine (depth of field, vignette and chromatic abberation, color correction curves).