feat(flame_3d): Add experimental web support using webgpu backend#3930
feat(flame_3d): Add experimental web support using webgpu backend#3930wolfenrain wants to merge 7 commits into
web support using webgpu backend#3930Conversation
| vec3 positions[MAX_LIGHTS]; | ||
| vec4 colors[MAX_LIGHTS]; | ||
| float intensities[MAX_LIGHTS]; | ||
| vec4 intensities[MAX_LIGHTS]; |
There was a problem hiding this comment.
@luanpotter I know this looks odd but because of how it works on impeller with striding and the fact that webgpu does not allow float arrays this is actually the exact same code :P
There was a problem hiding this comment.
cries in the corner
we also can't have list of structs, so it is already ugly anyway :/
There was a problem hiding this comment.
maybe just leave a comment justifying so no one "cleans it up" later?
…3d)--Add-experimental-`web`-support-using-`webgpu`-backend
| magFilter: 'nearest', | ||
| minFilter: 'nearest', | ||
| addressModeU: 'clamp-to-edge', | ||
| addressModeV: 'clamp-to-edge', |
There was a problem hiding this comment.
@luanpotter this matches what happens on the FlutterGPU side, long term however we should make this configurable and then pass a SampleOptions to the _renderPass.bindTexture on the FlutterGPU backend as well:
Preferably per texture.
| tilesets # plural of tileset | ||
| truecolor # truecolor rendering | ||
| tweening # the process of tween | ||
| uncapturederror # dumb webgpu javascript name |
There was a problem hiding this comment.
lol
I wonder if we should have a specific dict for language keywords, like we have one for dart
since these are not broadly standard gamedev terms
| @@ -0,0 +1,37 @@ | |||
| { | |||
There was a problem hiding this comment.
similar to shaderbundle, we should have some CI to check this (bc no one will)
for now we could mark on git attributes as generated?
| some tea instead because you have to do some reading first! | ||
| **STOP**, we know you are hyped up and want to start coding some funky 3D stuff | ||
| but we first have to set your expectations and clarify some things. So turn down | ||
| your music, put away the coffee and make some tea instead because you have to do |
There was a problem hiding this comment.
coffee is perfect for reading or anything btw :P (jk)
| import '_build_wgslbundle.dart' as wgslbundle; | ||
|
|
||
| void main(List<String> arguments) async { | ||
| final withWebGpu = arguments.contains('--with-web-gpu'); |
There was a problem hiding this comment.
does it make sense to generalize as --platforms? or is the shaderbundle needed for both and webgpu just needs an additional file?
Description
Adding experimental web support using
webgpu, it serves as a showcase for the backend API working as intended and as a way to bring web into the mix.Checklist
docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues