#WASM Graphical Rendering
53 messages · Page 1 of 1 (latest)
you want to look into webgpu tech
it will be significantly lower level than canvas
Okay thank you. Are there any good places to start for that? And also, is it well supported?
My goal is to skip the syscall/js calls because they are slower than just doing it in js
And also they are all synchronous
Which is bad when I’m trying to run a socket and use inputs too
im not terribly familiar, sorry
how i do my stuff is all of my business logic is in go
and i just push objects showing the new state for the game and get some js framework to render it
but its for a card game so.. no need for 60fps or whatever
True
this has to be able to run at close to 60fps on even crappy laptops or phones
which is annoying
https://github.com/rajveermalviya/go-webgpu looking at this, and it's a bit weird cuz it rewuires these wgsl files
I really just want something that's simple but doesn't interract with syscall/js
WebGL is tough because it's very very difficult to use for me for such a game
wgsl is your shaders, your code that runs on the gpu (aka.. webgpu). unfortunately yeah it'll be hard. unfortunately go isn't the best tool
Rip lmao
I've been looking at https://github.com/hajimehoshi/ebiten this
My only issue with this is I can't get text to work
stuff about go module not found
Issue is this
The package exists
you dont go get that particular package
you just need to go get ebiten/v2
and then you can import it
the issue with that is this
are you following a particular example?
Not exactly, but if I copy-paste their text example code, it still errors
can you share
yes ofc my bad lol
Even if I try running that file from github
it fails
also an issue with this is that a 9.6mb wasm file isn't good for loading
it seems the issue is that the examples are new and that there hasn't been a new enough release of ebiten to reflect those examples just yet. if you want, you can try the older example at https://github.com/hajimehoshi/ebiten/tree/15147490418eba1b073807bf5328cd55d6bee04f/examples/text/main.go
or use the latest version which isn't tagged yet by import github.com/hajimehoshi/ebiten/v2@main
if you use brotli compression you can get that very low
Is there a way to automatically add that when I compile it?
strange
no, its a thing you do with your web server (or something like cloudflare or nginx)
alr
Ngl im considering switching to C for the client but that ain't consistent with the golang server
take a look at this
it sent 4mb over the network
and uncompressed it back to its original size of 20mb
yeesh
fun fac,t this isn't even the max level of compression. brotli max level gets me down to 2.9mb
if you have wsl, you can test this yourself using brotli -Z <your wasm file>