googlevr / cardboard

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

How to force the Render Scale on the Cardboard XR Plugin #221

Open danilofaugusto opened 3 years ago

danilofaugusto commented 3 years ago

Hello folks,

I'm building a very simple scene (1k vertices and 9 draw calls) on an S8 that has a pretty high-resolution display... and boy you can imagine how GPU bound I am right now, specifically the fill rate is killing me, frames are very inconsistent, dropping to 10-15 often, and for VR you know this is not acceptable. What I want to do is lower the render scale so I can get more performance.

Forcing the Render Scale in my URP asset will affect anything as the XR Settings overrides. I've also tried Dynamic Resolution, and Fixed DPI (this really screws up the camera output).

Well, I hope someone could shine a light on me, I'd really appreciate it.

Thanks!

jballoffet commented 3 years ago

Thanks for reaching out to us, @danilofaugusto! Sorry for the delay here. Since you're mentioning the Unity XR Settings, I wanted to double check whether you're using the Cardboard XR Plugin or the old Cardboard/GVR SDK embedded in Unity.

Bear in mind that GVR and the old Cardboard SDK have been deprecated and this new version should be used instead. Furthermore, Unity's XR Settings option has also been deprecated and it is removed from Unity 2020.1 onwards. Thanks!

danilofaugusto commented 3 years ago

Thanks for the reply @jballoffet! I'm using the Cardboard XR Plugin, if the XR Settings is deprecated, do you know what should I use to force a lower scale?

Thanks!

Mandelbrow commented 3 years ago

Hi danilofaugusto, have you tried other options to optimize the game? For example changing the overall Quality Settings, using simpler shaders, lower resolution textures, or better compression for them?

danilofaugusto commented 3 years ago

Hi @Mandelbrow,

absolutely, the scene is ridiculously simple: 1k vertices, 9 draw calls, no post-processing, plain color default shaders (only opaque), 3 light sources with no shadows.

Controlling the resolution should be an available option for cardboard development as there are many devices with different resolutions with various processing power. Even in an S21, I have here the framerate isn't being good.

If resolution control is something quick to develop into the plugin, this would be for sure a quick win in performance!

Thanks everybody :)

dipaw commented 2 years ago

Thanks for reaching out to us, @danilofaugusto! Sorry for the delay here. Since you're mentioning the Unity XR Settings, I wanted to double check whether you're using the Cardboard XR Plugin or the old Cardboard/GVR SDK embedded in Unity. Bear in mind that GVR and the old Cardboard SDK have been deprecated and this new version should be used instead. Furthermore, Unity's XR Settings option has also been deprecated and it is removed from Unity 2020.1 onwards. Thanks!

Greetings. Is there a way to reduce the resolution? I used XRSettings.renderViewportScale and Screen.SetResolution but the result comes out like this: eaa39911e8b43baf9d5139ea6928a517