|
|
|
|
|
by Flux159
499 days ago
|
|
This is super cool & I'm impressed that it's working with WebGL. From reading the code & seeing the examples in the sandbox, it looks like the sprite layer is defined one time (initialization) with specific sprite & animation properties that are exposed to JS via the SpriteGPULayer config https://github.com/phaserjs/phaser/blob/v4.0.0-beta.5/src/ga... , then that class passes the info over to the vertex shader which has ifdefs to determine which animation, other features are enabled for a given SpriteGPULayer - https://github.com/phaserjs/phaser/blob/v4.0.0-beta.5/src/re... This way you don't end up having to do any updates per frame on the CPU and it remains one draw call for the entire layer right? Are there other use cases besides from large scale sprite/animated backgrounds that you've thought of? |
|