4

Image Effects from Standard Assets in Unity3D are awesome. They make our games beautiful. But sadly, I couldn't get it to work with Google VR (Cardboard) SDK.

enter image description here

When I run the game without Image Effects, everything is good.

enter image description here

When I run it with Image Effects, it merges the left and the right eye camera.

I have tried:

  • Adding two effects(Blur and Glow) to my terrain
  • Adding Component -> Image Effects -> Camera -> Motion Blur to my camera

I want to make my game look beautiful. Any help would be appreciated :)

Dheerendra Jeevani
  • 601
  • 1
  • 6
  • 15
  • Kinda OT, but motion blur in a VR app sounds like a really bad idea. – Cubic May 29 '16 at 15:37
  • 1
    Yeah I kinda realized it after doing it. But depth of field looks cool :D But on a bigger picture, I got color bloom, glow and color adjustment effects to work as well. – Saurav Bajracharya May 29 '16 at 16:03

2 Answers2

4

After crawling through a few links, I got the following link: Google Cardboard Unity 5 no stereoscopy

Though it was answered in a different context, it solves this current problem. Turning off Direct Render in StereoControllers of Main Camera helped me solve this problem.

The lamest thing one can do in stack overflow is answer his own question. But I hope this post is kept alive so that future developers do not face this problem.

Keeping the Image Effects component above StereoController component seems to help in some cases.

Community
  • 1
  • 1
  • 2
    "The lamest thing one can do in stack overflow is answer his own question" Actually, if you head to the FAQ you'll find that answering your own questions if you're able to is explicitly encouraged - for the reason you mentioned yourself. This isn't a helpdesk site, but a large scale problem/solution documentation effort, which is why we're so anal about question and answer quality. – Cubic May 29 '16 at 21:43
1

EDIT (Unity 5.6 and GVR SDK 1.3):

In the latest SDK you can simply put Image Effects on the main camera. However, they will not be visible in Unity's play mode (since it relies on two separate cameras created by the SDK). In the build, it uses Unity's native VR rendering and renders the Image Effects correctly. But be careful, some Image Effects cause visual artifacts / flickering / ...

(https://forum.unity3d.com/threads/image-effects-with-daydream-work-but-lead-to-flickering.443478/) (https://github.com/googlevr/gvr-unity-sdk/issues/448)

ORIGINAL ANSWER

Turning off the Direct Render checkbox on the StereoController of the MainCamera solves the problem. Also make sure to replicate the ImageEffects on both cameras and keep them in the same order.

ImageEffects in Unity only work correctly if the camera that is using them is drawing to the full screen. With cardboard (or VR in general) you have 2 cameras both only drawing half the screen which breaks the ImageEffects. It results in one of the eye's being stretched across both screens.

The problem can be solved by first drawing to a temporary texture that represents the full screen and afterwards splitting that texture to both cameras. Keep in mind that that has a performance impact (additional to the cost of the ImageEffects).

Further reference: https://developers.google.com/vr/unity/guide#deferred_rendering_and_image_effects

lcs.bdr
  • 388
  • 1
  • 9
  • 1
    I am using latest google vr sdk. and there is no option for Direct Render in StereoController. – Vishal Apr 05 '17 at 13:25
  • My answer worked for an older version. In the latest SDK you can simply put Image Effects on the main camera. However, they will not be visible in Unity's play mode (since it relies on two separate cameras created by the SDK). In the build, it uses Unity's native VR rendering (given that you use Unity 5.6) and renders the Image Effects correctly. But be careful, some Image Effects cause visual artifacts / flickering / ... (https://forum.unity3d.com/threads/image-effects-with-daydream-work-but-lead-to-flickering.443478/) – lcs.bdr Apr 11 '17 at 11:12