nenge123 / emulatorjs

https://emulatorjs.com/
15 stars 12 forks source link

Why not use webgl2 to build? #9

Closed rexhang closed 1 year ago

rexhang commented 1 year ago

Others' websites use webgl2 for rendering, which has better performance, smoother operation, and lower hardware usage, Also supports high frame rate.

image

And our canvas currently uses webgl to render instead of webgl2.

image

Here to upgrade the rendering method to webgl2, is it necessary to re-make C language make to wasm files?

Hope to get your reply support.

thanks.

nenge123 commented 1 year ago

you can replace '"webgl"' to '"webgl2"' in retroarch.js .than will webgl2

nenge123 commented 1 year ago

image

rexhang commented 1 year ago

image

How did you do it?

nenge123 commented 1 year ago

replace js if u use .4.99. find "wasmAsmjs" add at the end wasmAsmjs = wasmAsmjs.replace('"webgl"','"webgl2"')

0.5.8 find 'WASM_JS'

WASM_JS = WASM_JS.replace('"webgl"','"webgl2"')

if use arcade-data.zip unfile , replace the "retroarch.js"

rexhang commented 1 year ago

replace js if u use .4.99. find "wasmAsmjs" add at the end wasmAsmjs = wasmAsmjs.replace('"webgl"','"webgl2"')

0.5.8 find 'WASM_JS'

WASM_JS = WASM_JS.replace('"webgl"','"webgl2"')

if use arcade-data.zip unfile , replace the "retroarch.js"

how to run arcade games? visit /arcade.html ?

nenge123 commented 1 year ago

arcade.html is test to run,u must edit index.html to run arcade

rexhang commented 1 year ago

arcade.html is test to run,u must edit index.html to run arcade

arcade game seems to need url to load file or blobObject can't

nenge123 commented 1 year ago
<script type="text/javascript">
    var EJS_DEBUG_ = true;
    var EJS_EMU = new EJS('#game',{
        gameUrl:'kof97.zip',
        system:'arcade',
        biosurl:'bios/arcade.7z', //set bios
    });
</script>

rexhang commented 1 year ago

'bios/arcade.7z'

Error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')

nenge123 commented 1 year ago

I'm sorry, I ignored the capitalisation, which led to an error.

nenge123 commented 1 year ago
rexhang commented 1 year ago

image

Upgraded to webgl2

Thank you.

nenge123 commented 1 year ago

Can webgl2 reduce the power consumption of mobile phones?

l using the steamdeck,so it is longtime not use web play in iphone

rexhang commented 1 year ago

Can webgl2 reduce the power consumption of mobile phones?

l using the steamdeck,so it is longtime not use web play in iphone

Judging from my current performance data, no conclusion can be reached yet. It seems that it is only backward compatible, maybe it needs to change the calling API or something else?