xyonico / CameraPlus

Plugin for Beat Saber for a smoother and wider FOV camera
MIT License
77 stars 59 forks source link

Performance #7

Closed JetForMe closed 6 years ago

JetForMe commented 6 years ago

First, let me say I love this plugin. It's really good for recording games.

But I'm noticing some performance hit in VR when I have the third-person camera enabled. I can see the judder in the blocks as they get near. I have an 8-core Ryzen Threadripper and nVidia Titan Xp graphics card. I'm using OBS to record, but that doesn't seem to be the complicating factor, as the frame rate doesn't improve when it's not running.

I also have a 1080 Ti sitting in a box dying to be added to the system, but I don't know if there's any way to offload third-person rendering to that without support from Beat Saber.

Is there any way to perhaps reduce the third-person camera's resolution, or do something else to reduce the performance impact of it?

Thanks!

AlinaNova21 commented 6 years ago

The view window resolution can be changed in beat sabers settings, although that shouldn't be an issue unless you are rendering at 4k or something, my rog laptop with a 4th gen i7 and 770m runs it just fine at a solid 60fps at 1600x900 (No OBS though)

JetForMe commented 6 years ago

In some recent update, the game started showing the view window full-screen (it used to be a relatively small window); I don't know what resolution that's actually running at. I'll have to check.

xyonico commented 6 years ago

Like @ags131 said, CameraPlus will render at the resolution of the Beat Saber window, so changing that will affect performance. If you're only having problems with third person, then it's likely the preview window on the camera cube causing the issue. Though it's only rendering at 256x256, it'll still have some overhead.

So I can add a config option to disable that preview and also have it only render if it's in view of the player.

Another thing I can take a look at is limiting the framerate of the camera.

xyonico commented 6 years ago

Version 2.0.0 addresses the performance issues and gives you more control over quality settings for the camera itself, including FPS, anti-aliasing and resolution scale.

JetForMe commented 6 years ago

Excellent, I'll try it right now. Couple questions about your previous comment:

If you're only having problems with third person, then it's likely the preview window on the camera cube causing the issue.

I see the performance problem as judder/dropped frames in the HMD. I don't mind if there are performance problems in the third-person view.

What's the "camera cube?"

xyonico commented 6 years ago

When you turn on third person mode a white cube with a little preview window next to it will appear in-game where the third person camera is. You can move this cube around by pointing the controller laser at it and holding trigger to grab.

In older versions of the plugin, the preview was rendered separately from the actual view shown on the desktop so that's why the game would have worse performance with third person compared to first person. 2.0.0 now uses the same view shown on the desktop as for the preview, so it only has to render the view once, instead of twice like before.

You'll never see only worse performance from CameraPlus and good performance in VR. It's all on the same hardware, so if CameraPlus has bad performance, it'll drag VR performance down with it. You can however reduce the framerate of CameraPlus to save a couple of frames.