Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Kabutak · May 04, 2017 at 12:43 AM · androidrenderingbugvrpost processing

[BUG] Can't use postprocessing with single-pass stereo rendering enabled (5.6, GearVR)

Whenever building any application for GearVR (Presumably any Android VR application) it is impossible to use any post processing. I have tried it with Unity's legacy image effects, other plugins like AmplifyColor, and the new PostProcessing stack. All of these things claim to have been updated to support single-pass stereo rendering.

If I build with multi-pass, everything compiles fine and works fine on the app. If I build with single-pass, the screen is white or mostly white, depending on the effect. With a noise effect I can see extremely large pixels bouncing around, so something is running. Of note is the fact that many of the unity default and included shaders throw an error when single-pass is enabled and compiled.

 Shader error in 'Hidden/Post FX/Uber Shader': undeclared identifier 'sampler_CameraDepthTexture' at line 191 (on gles3)
 
 Compiling Vertex program with STEREO_MULTIVIEW_ON DEPTH_OF_FIELD_COC_VIEW
 Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_MOBILE UNITY_HARDWARE_TIER2 UNITY_COLORSPACE_GAMMA

This error shows up in every shader, included or custom, that runs SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv); This includes the built-in shaders, which I cannot modify. I have checked every shader that I can, and the variables are indeed declared; not to mention that they work fine when compiled in multi-pass. It seems like single-pass stereo rendering is revoking access to the depth texture, which causes any post processing to render directly on top of the camera, causing the white or broken view.


Reproduction steps (GearVR):

  • Make any unity project

  • Import any post-processing effects. (Eg. The legacy image effects or the new PostProcessing stack)

  • Add any effect(s) to the camera.

  • Build with multi-pass rendering, observe that it works fine.

  • Build with single-pass stereo rendering, test the app on GearVR and see the problems. Also note the new errors in the shaders which appear in the unity console output. Those do not happen in multi-pass.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kabutak · May 04, 2017 at 06:09 PM 0
Share

Note: It seems unity was well aware of this issue already, and have marked it as lower priority. There is a workaround available, which is to just not use it. You can track the issue here, hopefully with enough pressure they will speed up the fixing of this issue. It's definitely a development problem.

2 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by Arkade · Jan 31, 2018 at 08:09 PM

To fix any shader with the "`undeclared identifier 'sampler_CameraDepthTexture'`" error, swap the declaration of the sampler from:

uniform sampler2D_float _CameraDepthTexture;

to

UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture);

Caveat: I've not checked that this makes post FX work with single-pass VR but since I came across this question while investigating that error, I thought I'd post that part of the answer here. HTH :-)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image lijiatao · May 08, 2018 at 03:31 AM 0
Share

hi Arkade

did you fixed that problem. i change sampler2D to sampler2D_float but not solve that.

avatar image
0

Answer by EpicCubeGroup · Jun 18, 2017 at 10:49 AM

Hi, I've tried to run Post Processing Stack on my GearVR app, but no post processing is done (multi-pass rendering set). Why? Any particular setting is needed?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

149 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Change which eye is rendered on desktop in VR? 3 Answers

Unity Rending Mobile Bug (Android Pixel 4) 0 Answers

Unity 2019.3 URP VR [Htc Vive] - post-processing not working properly 0 Answers

Unity Vr [Google Cardboard]- UI Render issue 1 Answer

Universal Render Pipeline grey screen on android 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges