- Home /
Problem using effects on Google Cardboard camera
Hey there! I'm building a mobile Unity project using the default Google Cardboard assets package, and I want to use some image effects on it.
I noticed that every time I run the application, it instantiates this script on right and left cameras: "RadialUndistortionEffect" I understand that this is automatic and necessary for adjusting the image for the device lens.
Here's the problem: when also I add any image effect script (Grayscale, for instance), the "Radial Undistortion Effect" doesn't seem to work on any Android device, though it did work on Unity. It seems like the Grayscale script is somehow overwriting the RadialUndistortionEffect.
Any idea how to solve this? Every help is welcome, I'm a noob when it comes to programming (just learning C#).
Thanks a lot!
Which version of Unity are you using and is it Free / Personal, or Pro?
Answer by fiete-groth · Jun 02, 2015 at 11:20 AM
To make the image effects work, make sure you disable "Direct Render" at the StereoController script attached to the main camera.
Since the image effects are worked of in queue, it is important to keep the right order for execution:
The RadialUndistortionEffect script always needs to be the last in line. So, in the inspector, add (or move up) your image effect script (i.e. grayscale) before these scripts on both cameras (left and right).
$$anonymous$$inor correction: If you use image effects, disable the "Direct Render" option. ($$anonymous$$any image effects don't work right unless the entire screen is being drawn, but in stere, you only draw one half at a time. Turning off Direct Render causes the camera to render to a temporary texture with a fullscreen viewport, and then that is blitted to the framebuffer.)
Oh yeah, I totally mixed that up. I changed the post text, thx dolims!
Perhaps i'm mistaken, or perhaps you're talking about a previous SD$$anonymous$$ (i see this post is from 2015) but in the current SD$$anonymous$$ the cameras are only generated upon entering play mode & disappear when you stop... any ideas on a new workflow?
Answer by Nieder · Jun 03, 2015 at 02:05 PM
It works. Thanks a lot. Btw, I'm using the free version.
Your answer
