Open BeezBumba opened 3 months ago
Sorry I forgot the actual link. https://developer.chrome.com/blog/from-webgl-to-webgpu
The WebGPU using a different shading language than WebGL, but the concepts are fairly the same.
I saw shader_frag and shader_vert files in the code directory. WebGL can't support geometry shaders. so could there have been a shader_geo.hlsl file? That might be easier if it's possible.
those shaders are just used for the emulator overlay menu - "New Game, Save State, etc..." it's not used by the emulator itself
So what is your option on the whole conversion? Do you think it's possible at all?
My knowledge of shaders unfortunately is quite basic - so I would really not know
Its not to much about shaders. It's just the conversion from WebGL to WebGPU.
Well can I ask what spots you changed so the emulator uses webGL?
and the spots where you are using the webgl context
The emulator uses WebGL because that is what emscripten translates to when compiling from OpenGL. See this article -
https://emscripten.org/docs/porting/multimedia_and_graphics/OpenGL-support.html
Here in the code is where it sets up the OpenGL Context -
So I don't actually use any WebGL commands, it's just straight up OpenGL which the compiler at a lower level turns into WebGL. I'm not sure how you would get it to use something else, the emulator would have to be rewritten to use something other than OpenGL - which in Desktop could use different backends (Vulkan, Direct3D, etc...) but on the web you don't have those options. So don't really think this is possible in my opinion.
Do you know how to disable the emulator emulating lag?
Emulators do that just for the pure accuracy.
I don't believe there is any lag, the main tool for maintaining correct framerate is by syncing to the refresh rate of the monitor. this is done using the emscripten_set_main_loop() function:
you can read about it here
https://emscripten.org/docs/api_reference/emscripten.h.html
one thing you can experiment with is setting the variable doubleSpeed to true here -
that will attempt to run 2 frames for every 1 frame of time, however on slow machines it won't be able to keep up and won't yield any benefit.
I asked this because some games on Ipad are a lot better now with vertex buffer objects. but that update still did something with safari.
new update: the parallel graphics plugin is actually the inaccurate one. I tested it on retroarch and it gave me the same problems.
The parallel one is the only one i could find that was open source.
I found this one on gitlab https://gitlab.com/parallel-launcher/parallel-n64
interesting, ok good to know it wasn't something specific to the web version.
It says it’s used specifically for the parallel launcher and that one works fine. So should you try it?
I used the one that was already built into the parallel core in retroarch. Not sure how this one is different or if it's feasible to integrate it but if I have time I'll take a look
Should I add anything for the new mupen64plus-video-gliden64 plugin code wise? Wondering what this video plugin might offer.
You can try experimenting with if you like, I unfortunately have not had time to look at it been busy with work
I've been working on getting the Rice plugin working - stay tuned I will link to a version you can try and let me know if it fixes the issue.
Nice! can't wait to see that!
ok give this page a try -
It works!
the ongoing visual bugs are very minor and not as big so thats good.
can you link the code?
I haven't published the code yet I'm still cleaning it up a bit. I should have it published in a few days and will link you to it as soon as it's available.
ok here is the checkin with the code -
https://github.com/nbarkhina/N64Wasm/commit/3056c89d73efea037aa5653a065ab65947e00149
There is this thing where the whole game covers about 1/4 of the screen it might be a resolution issue?
It might be lines 390 and 391 in RiceConfig.cpp i have to change to global width/height?
screen_width = 640;
screen_height = 480;
Yes try updating those lines
I found an article that talks about the conversion from WebGL to WebGPU. WebGPU is said to have compute shaders and geometry shaders. Geometry shaders are what the emulator needs because, with them, every triangle has a shader that finds the right pixel colors. This explains why there is no color in the images. I posted this in a new issue since the other one was pretty long.