News for hackers. Stuff that matters.
Re:Show HN: Unity like game editor running in pure WASM by sansseriff on Tuesday September 26, 2023 @03:51PM (#37664951)
This is hitting my gpu super hard (Radeon Pro 560X, near-4k) with just the default ball scene. Frame rates are dipping very low just orbiting around. Does anyone know if there could be a WebGL optimization issue?
Re:Show HN: Unity like game editor running in pure WASM by TrevorSundberg on Tuesday September 26, 2023 @03:52PM (#37664966)
It almost sounds like it’s not using your dedicated graphics card. Do other WebGL demos run alright for you?
Re:Show HN: Unity like game editor running in pure WASM by sansseriff on Tuesday September 26, 2023 @04:02PM (#37665079)
Yes I can run about 200 jellyfish in this demo with similar GPU load, resolution, and frame rate. https://akirodic.com/p/jellyfish/

Maybe not the most helpful comparison haha. Anyways, great work, this is very impressive

Re:Show HN: Unity like game editor running in pure WASM by h4zel on Tuesday September 26, 2023 @04:52PM (#37665664)
Same experience here. I'm able to run other webgl projects fine, including the jellyfish project you linked, but this engine blows up my gpu. Strange
Re:Show HN: Unity like game editor running in pure WASM by Narishma on Tuesday September 26, 2023 @06:23PM (#37666572)
That's WebGL. This engine seems to use WebGL2.
Re:Show HN: Unity like game editor running in pure WASM by a_JIT_pie on Tuesday September 26, 2023 @05:38PM (#37666131)
I'm getting a really nice smooth experience on my Intel HD Graphics 620 (7th gen intel integrated graphics, old and slow). Also just looking at the default ball scene, and I was really impressed how smooth it was on my system. I'm using chrome.
Re:Show HN: Unity like game editor running in pure WASM by meheleventyone on Tuesday September 26, 2023 @06:34PM (#37666718)
I suspect this is possibly down to the use of readPixels and how slow that is on various devices. The engine seems to run and render to an offscreen canvas then transfer the image data in JS to the main thread before drawing it to a canvas there.
Re:Show HN: Unity like game editor running in pure WASM by TrevorSundberg on Tuesday September 26, 2023 @07:17PM (#37667213)
The transfer of image data only happens when we yield inside the engine which only occurs when you hit a breakpoint in script. Otherwise we're just rendering to the OffscreenCanvas and letting the normal flow blit it to the screen (not doing any copying).

I just did some profiling on Firefox and I feel like the profiling result doesn't quite make sense but it's saying that the majority of time is spent calling Performance.now() from the clock calls in C++. I'm wondering if that's because we're calling it too many times and maybe we should just call it once per frame.

Re:Show HN: Unity like game editor running in pure WASM by meheleventyone on Wednesday September 27, 2023 @01:24AM (#37670543)
FWIW my poor performance is in Chrome on Apple Silicon not Firefox.
Re:Show HN: Unity like game editor running in pure WASM by TrevorSundberg on Wednesday September 27, 2023 @06:03PM (#37681997)
Hey all, if you’re willing to try again we just put out a fix that dramatically helps performance on some machines. Since this was a port to WASM from a native game engine, it turns out the issue was in our frame rate limiting code which wasn’t playing well with browser timing APIs: https://raverie-us.github.io/raverie-engine/