Discuss Scratch

ajskateboarder
Scratcher
1000+ posts

Migrate to WebGPU

TL;DR for the non-tech-savvy: Scratch does not support rendering things with modern GPU interfaces*, so using WebGPU will let Scratch leverage modern GPU interfaces, such as DirectX 12+

WebGPU is a newly announced graphics interface that can outperform WebGL 1 - the technology scratch-vm uses - by a wide margin.

This is possible due to WebGPU being able to access the GPU directly with modern APIs like DirectX 12 to run graphic computations, as compared to WebGL which is just a wrapper around a single graphics layer with no specific optimizations. As a result, Scratch may experience a massive performance boost in intensive things like raycasting while using WebGPU

Some current issues (which might resolve over time):
  • Only supported by desktop browsers
  • Breaks compatibility with considerably old mobile/desktop GPUs (WebGL could be used as a fallback until such GPUs are truly dead)

To solve possible compatibility issues, here's a good test:

ssvbxx2 wrote:

My solution to that is to make a browser test to see if the client browser can support WebGPU; if not, then test if it can support WebGL 2, and if not that, then test it for WebGL 1 support. If all of the tests fail, then that browser can't run Scratch at all.

Last edited by ajskateboarder (April 16, 2024 20:59:55)

Gamer_Logan819
Scratcher
1000+ posts

Migrate to WebGPU

Support, because of reasons provided
cs3868895
Scratcher
1000+ posts

Migrate to WebGPU

Will that lead to Scratch idk, 3.5-ish?

Probably idk 3.01?

Idk but that has to be in maintenance for a long time.
ajskateboarder
Scratcher
1000+ posts

Migrate to WebGPU

cs3868895 wrote:

Will that lead to Scratch idk, 3.5-ish?

Probably idk 3.01?

Idk but that has to be in maintenance for a long time.
Goodness god, three IDKs?
I think Scratch would schedule this for version 4.0 development

Last edited by ajskateboarder (May 17, 2023 21:25:41)

cs3868895
Scratcher
1000+ posts

Migrate to WebGPU

ajskateboarder wrote:

cs3868895 wrote:

Will that lead to Scratch idk, 3.5-ish?

Probably idk 3.01?

Idk but that has to be in maintenance for a long time.
Goodness god, three IDKs?
I think Scratch would schedule this for version 4.0 development
3.0 isn't even out yet Lol
PaperMarioFan2022
Scratcher
1000+ posts

Migrate to WebGPU

cs3868895 wrote:

ajskateboarder wrote:

cs3868895 wrote:

Will that lead to Scratch idk, 3.5-ish?

Probably idk 3.01?

Idk but that has to be in maintenance for a long time.
Goodness god, three IDKs?
I think Scratch would schedule this for version 4.0 development
3.0 isn't even out yet Lol

Well, not technically lol, ST we’re behind schedule with 3.0 since Adobe Flash died out.
-Valtren-
Scratcher
1000+ posts

Migrate to WebGPU

Support, I often work with GPU intensive projects. And if this was implemented, it would likely be cause for 4.0.
-ElectronicArts-
Scratcher
1000+ posts

Migrate to WebGPU

Very cool! it can perform better and drastically for projects.
OhOkSir12345
Scratcher
1000+ posts

Migrate to WebGPU

support because of the reasons above however there could be a new bug called your web browser does not support WebGPU (unlikely) but still
-ElectronicArts-
Scratcher
1000+ posts

Migrate to WebGPU

Yeah it probably will be some problems with webgpu on older browsers.
https://caniuse.com/webgpu
IceCreamTub
Scratcher
1000+ posts

Migrate to WebGPU

HeII yeah! Support!
Due to the reasons the OP has already stated
ajskateboarder
Scratcher
1000+ posts

Migrate to WebGPU

Bump
ajskateboarder
Scratcher
1000+ posts

Migrate to WebGPU

bump
Vadik1
Scratcher
500+ posts

Migrate to WebGPU

ajskateboarder wrote:

… WebGPU also supports more GPUs, …
This is wrong. WebGPU will only be supported on modern GPUs.





WebGL 1 is very basic and limited in terms of what it can do and how it can do it, and as a result it can run on almost anything. Scratch is still using WebGL 1 for compatibility reasons, despite WebGL 2 also being widely supported and having new features that could speed up rendering. WebGPU will have higher GPU minimum specs and feature requirements than even WebGL 2.
ajskateboarder
Scratcher
1000+ posts

Migrate to WebGPU

Vadik1 wrote:

ajskateboarder wrote:

… WebGPU also supports more GPUs, …
This is wrong. WebGPU will only be supported on modern GPUs.
I meant to say WebGPU will provide better support for newer GPUs, as outlined by current documentation.
WebGL 1 is very basic and limited in terms of what it can do and how it can do it, and as a result it can run on almost anything. Scratch is still using WebGL 1 for compatibility reasons, despite WebGL 2 also being widely supported and having new features that could speed up rendering. WebGPU will have higher GPU minimum specs and feature requirements than even WebGL 2.
That's why I suggested this as a future priority, for when such GPUs become deprecated. Thanks for informing me though, I'll put this in the OP
me_on_a_gopro
New Scratcher
36 posts

Migrate to WebGPU

No support, not everyone has a gpu, https://www.youtube.com/watch?v=oca_eiI9VnA
ajskateboarder
Scratcher
1000+ posts

Migrate to WebGPU

me_on_a_gopro wrote:

No support, not everyone has a gpu, https://www.youtube.com/watch?v=oca_eiI9VnA
You need a GPU to access Scratch already. Plus, there are different types of graphic rendering:
  • Using a CPU
  • Integrated GPUs
  • Discrete GPUs
and most people use one of them. (Oh and WebGL 1 can be a fallback)

Last edited by ajskateboarder (May 20, 2023 16:04:05)

ajskateboarder
Scratcher
1000+ posts

Migrate to WebGPU

bump
ajskateboarder
Scratcher
1000+ posts

Migrate to WebGPU

bump
ajskateboarder
Scratcher
1000+ posts

Migrate to WebGPU

large bump

Powered by DjangoBB