cancel
Showing results for 
Search instead for 
Did you mean: 

renderViewportScale and eyeTextureResolutionScale performance

eVInteractive
Protege

I was playing with some dynamic resolution control using XRSettings.renderViewportScale and XRSettings.eyeTextureResolutionScale (Unity). Essentially, I set eyeTextureResolutionScale=2.0 right when the app starts, and then dynamically change renderViewportScale. Everything functions properly.

However, setting a large eyeTextureResolutionScale seems to have a pretty serious impact on frame rate, even if I'm just rendering to a small part of the viewport. For example, eyeTextureResolutionScale=2.0 and renderViewportScale = 0.5 works fine, but is much, much slower than "normal."

Is this a known / understood problem? Is there something about large eye buffers that needs to be accounted for?

Thanks much!

2 REPLIES 2

koujaku
Protege

Setting the texture resolution scale to 2x means your device is rendering 4x the number of pixels per-frame! In a worst-case scenario, that could mean your frame takes 4x longer to draw.

There's some interesting relevant discussion on the topic over on this thread, which suggests 1.7 as a better number for texture scale:
PSA: With Link v23, to achieve true 1:1 app-to-display pixel ratio, you need to set 5408x2736 for th...

But if you're running natively on Quest 2, I'd recommend against this unless you're very familiar with graphics optimization. If you really want to do it anyhow, start first by optimizing your pixel shaders! In particular, just switch as much as you can to Unlit, and definitely avoid PBR shaders.

Thanks.  I do understand all that.  (Very familiar with graphics optimization.)

 

The problem is that even when rendering to a subset of the eye buffer (with renderViewportScale), the fact that the eye buffer is larger seems to have a pretty significant performance impact.

 

"For example, eyeTextureResolutionScale=2.0 and renderViewportScale = 0.5 works fine, but is much, much slower than "normal."

 

In my example above, the "normal" resolution of 1440x1584 is produced, but the performance is lower even though the same number of pixels are being rendered and eye-warped.