Facepunch / sbox-issues

177 stars 12 forks source link

Camera Preview In Editor Causes Performance Drop / RenderSceneToPixmap Assert #4644

Open ScoutWozniak opened 10 months ago

ScoutWozniak commented 10 months ago

Describe the bug

Whenever the camera preview is shown, performance decreases massively.

To Reproduce

  1. Add a camera to the scene
  2. Make sure the preview is open

Expected behavior

Shouldn't cause performance to drop

Media/Files

https://github.com/Facepunch/sbox-issues/assets/99102549/0146e168-a907-4dcb-9788-b093a16027d9

Additional context

No response

garrynewman commented 10 months ago

You're meant to have a camera preview tool pop up - do you see that anywhere?

ScoutWozniak commented 10 months ago

It's there for me, I guess it just didn't show up in the recording.

handsomematt commented 10 months ago

Can you post your hardware specs? It's likely a problem with Vulkan but I can't start debugging any of this stuff properly without narrowing down what devices it affects

ScoutWozniak commented 10 months ago

I'm using a Ryzen 7 3700X, RTX 3060 on Windows 10 with 16 gigs of RAM. Need anything else?

handsomematt commented 10 months ago

I think I've got it on a similar machine now, is your console getting spammed with anything?

Could you also try with this enabled

image

garrynewman commented 10 months ago

This might be related to the thing I just added, where we wait manually for the pixmap to get written

MrBrax commented 10 months ago

it's rendering the scene twice, isn't this what should happen? been like that for me since it was added, didn't think anything of it

Jerichos commented 10 months ago

I had similar issue few days ago when I opened s&box and created an empty project with default scene. Scene view had 1fps (game view completely fine when switched tab). When I get home I will check it again and update comment.

jacobc16 commented 10 months ago

https://github.com/Facepunch/sbox-issues/assets/20746458/0f00d25f-ae67-4e04-970f-847f5296d9b3 I took a video of it happening, it is kind of hard to tell the fps drop on the video, the tools performance jumps up to 30ms when the camera is selected. I also included the verbose console output, and used the following specs:

128gb ram, 3080ti, ryzen 9 5950x

Jerichos commented 10 months ago

Tested today again and there was still significant frame drop in scene view. Resolved by updating graphics driver. It's now smooth as baby butt

ScoutWozniak commented 10 months ago

Graphics drivers are up to date now but after testing it again I'm still experiencing the lag. I'll attach more footage of the editor and the log file (the camera preview doesn't seem to show up in obs but it is still there in editor).

https://github.com/Facepunch/sbox-issues/assets/99102549/4da5e7d2-bb37-4db6-87d0-9acce402ee98

Log.log

MrBrax commented 10 months ago

1706704380492

i think the driver version check needs some more logic

DoctorGurke commented 10 months ago

Game ready drivers are on version 551.23

image

MrBrax commented 10 months ago

if you have a still supported gpu that is, a nag for something i can't solve doesn't really help. 474.64 is the latest one i can download

DoctorGurke commented 10 months ago

What nag? If your gpu doesn't support the recommended driver version idk what to tell you

MrBrax commented 10 months ago

the dialog box above that opens every time i start the game. i can't do anything about it so it's just a nag. the game still works on this machine in a pinch.

Dickarus666 commented 9 months ago

image i'm also having this problem now.

running: ryzen 9 5900x RTX 3080 32 gigs of RAM windows 10

running latest drivers but also was having the issue before updating image

log: Log.log

any ideas of possible cause? everything is quite smooth except for during the camera preview. then it drops to something like 2-3 fps in the scene.

garrynewman commented 8 months ago

This has been happening for a month now @samzanemesis - any ideas? Did you look into it?

samzanemesis commented 8 months ago

A little bit, haven't forgotten about it but dealing with light culling got me carried away, I'll finish it and get that sorted next

Dickarus666 commented 7 months ago

reminder bump

Dickarus666 commented 5 months ago

wanted to post an update, this problem might not be related to the s&box editor as much as it relates to local system graphics configurations. today i ran into trouble with my vulkan drivers on a separate game, and ended up using wagnard's display driver uninstaller to do a deep removal of driver settings in an attempt to fix the vulkan issues. after doing this and then manually reinstalling the newest graphics drivers, this seems to inadvertently helped the s&box camera preview issue as well.

it's not entirely fixed, but it's gone from 2-3 fps to just a stutter every few seconds now, which is much much better. i'm suspecting the remaining stutter might just be from some further nvidia configuration needed on my part.

tl;dr: corrupted vulkan graphics drivers may have been the issue. a deep cleaning with DDU followed by a reinstall has (almost) fixed the problem for me.