bs-community / skinview3d

Three.js powered Minecraft skin viewer.
https://skinview3d-demo.vercel.app
MIT License
542 stars 90 forks source link

Hardware Acceleration Issue with sv3d #119

Open bribes opened 2 years ago

bribes commented 2 years ago

If you have Hardware Acceleration off then skinview3d will cause your CPU usage to go to 100% and if you turn it on then it'll go to normal CPU usage this is not normal with other three.js programs.

Hacksore commented 2 years ago

@bribes could you please include some benchmarks and a code example to reproduce?

My guess it's related to the hardware you're using but I can try on my systems.

bribes commented 2 years ago

You can just test turning on and off hardware acceleration on your browser here. https://bs-community.github.io/skinview3d/ and check your task manager.

bribes commented 2 years ago

Any updates?

Hacksore commented 2 years ago

@bribes, you will probably get more traction on this issue when you include at least some of the following.

bribes commented 2 years ago

@bribes, you will probably get more traction on this issue when you include at least some of the following.

  • benchmarks
  • browsers tested
  • hardware specs

Bruh ok but this is a issue for like all browsers and hardware and like everything if you turn off hardware acceleration but sure

tcrch commented 1 year ago

these issues are still present

conarin commented 1 year ago

I am suffering from the same issue. The preview is always rendering even when it is stationary, which always results in 100% CPU usage. I think it should be like the "NameMC" skin viewer, which does not render while stationary, but only when animations or camera operations are performed.

Translated by Deepl translation. Sorry if the text is not correct.

Hacksore commented 1 year ago

Indeed does look like an issue when hardware acceleration is turned off in Chrome.

image

Tested Edge as well and got the same issue as Chrome.

image

Tested in Firefox and don't see the same issue though 🤔.

image

Since both Chrome/Edge had this issue it's perhaps something related to Chromium and not specifically skinview3d. To rule out Skinview3d I visited a few of these threejs demos and the CPU would spike in Chrome/Edge.

I had a brief look for an upstream issue on threejs and chromium but found nothing related.

tcrch commented 1 year ago

A good idea would to display a static model if hardware acceleration is turned off using something like https://github.com/pmndrs/detect-gpu until this issue is resolved. if that's even possible to resolve this.

When hardware acceleration is off, on lower end hardware, the model absolutely destroys performance.

Hacksore commented 1 year ago

@tcrch that is a fair solution.

If anyone has bandwidth to throw something together to detect if you have hardware acceleration enabled and raise a PR that would be appreciated.

Hacksore commented 1 year ago

Found this thread which talks about implementing on-demand rendering.

https://discourse.threejs.org/t/fans-blowing-up-high-cpu-usage/15949/5