melonjs 20.3.0 → 20.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -19
- package/build/application/application.d.ts +0 -17
- package/build/application/application.d.ts.map +1 -1
- package/build/application/settings.d.ts +3 -0
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/backend/engine.d.ts +0 -19
- package/build/audio/backend/engine.d.ts.map +1 -1
- package/build/audio/backend/sound.d.ts +1 -51
- package/build/audio/backend/sound.d.ts.map +1 -1
- package/build/audio/backend/spatial.d.ts.map +1 -1
- package/build/audio/backend/types.d.ts +11 -1
- package/build/audio/backend/types.d.ts.map +1 -1
- package/build/audio/backend/voice.d.ts +0 -25
- package/build/audio/backend/voice.d.ts.map +1 -1
- package/build/audio/playback.d.ts.map +1 -1
- package/build/audio/procedural.d.ts.map +1 -1
- package/build/audio/state.d.ts +6 -79
- package/build/audio/state.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts +0 -68
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +86 -79
- package/build/camera/camera3d.d.ts.map +1 -1
- package/build/camera/effects/fade_effect.d.ts +0 -5
- package/build/camera/effects/fade_effect.d.ts.map +1 -1
- package/build/camera/effects/mask_effect.d.ts +0 -5
- package/build/camera/effects/mask_effect.d.ts.map +1 -1
- package/build/camera/fog.d.ts +118 -0
- package/build/camera/fog.d.ts.map +1 -0
- package/build/geometries/box3d.d.ts +0 -28
- package/build/geometries/box3d.d.ts.map +1 -1
- package/build/geometries/ellipse.d.ts +0 -20
- package/build/geometries/ellipse.d.ts.map +1 -1
- package/build/geometries/observablePoint.d.ts +0 -3
- package/build/geometries/observablePoint.d.ts.map +1 -1
- package/build/geometries/path2d.d.ts +0 -19
- package/build/geometries/path2d.d.ts.map +1 -1
- package/build/geometries/polygon.d.ts +0 -12
- package/build/geometries/polygon.d.ts.map +1 -1
- package/build/geometries/roundrect.d.ts +0 -18
- package/build/geometries/roundrect.d.ts.map +1 -1
- package/build/geometries/sphere.d.ts +0 -9
- package/build/geometries/sphere.d.ts.map +1 -1
- package/build/geometries/toarccanvas.d.ts.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2652 -413
- package/build/index.js.map +3 -3
- package/build/input/gamepad.d.ts.map +1 -1
- package/build/input/pointer.d.ts +0 -4
- package/build/input/pointer.d.ts.map +1 -1
- package/build/input/pointerevent.d.ts +0 -6
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/lang/deprecated.d.ts.map +1 -1
- package/build/level/gltf/GLTFModel.d.ts +0 -81
- package/build/level/gltf/GLTFModel.d.ts.map +1 -1
- package/build/level/gltf/GLTFScene.d.ts +1 -44
- package/build/level/gltf/GLTFScene.d.ts.map +1 -1
- package/build/level/gltf/gltf_sampler.d.ts +1 -48
- package/build/level/gltf/gltf_sampler.d.ts.map +1 -1
- package/build/level/level.d.ts +195 -113
- package/build/level/level.d.ts.map +1 -1
- package/build/level/tiled/TMXGroup.d.ts +1 -65
- package/build/level/tiled/TMXGroup.d.ts.map +1 -1
- package/build/level/tiled/TMXLayer.d.ts +0 -44
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXObject.d.ts +1 -136
- package/build/level/tiled/TMXObject.d.ts.map +1 -1
- package/build/level/tiled/TMXObjectFactory.d.ts +1 -40
- package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
- package/build/level/tiled/TMXTile.d.ts +1 -30
- package/build/level/tiled/TMXTile.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts +0 -10
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts +0 -113
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts +0 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
- package/build/level/tiled/TMXUtils.d.ts +1 -43
- package/build/level/tiled/TMXUtils.d.ts.map +1 -1
- package/build/level/tiled/factories/shape.d.ts +1 -7
- package/build/level/tiled/factories/shape.d.ts.map +1 -1
- package/build/level/tiled/factories/text.d.ts +1 -7
- package/build/level/tiled/factories/text.d.ts.map +1 -1
- package/build/level/tiled/factories/tile.d.ts +1 -7
- package/build/level/tiled/factories/tile.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +0 -60
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +0 -42
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +0 -5
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +0 -31
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts +2 -2
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/autodetect.d.ts +1 -6
- package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
- package/build/lighting/light2d.d.ts +0 -25
- package/build/lighting/light2d.d.ts.map +1 -1
- package/build/lighting/light3d.d.ts +0 -16
- package/build/lighting/light3d.d.ts.map +1 -1
- package/build/loader/loader.d.ts +42 -33
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/loadingscreen.d.ts +0 -33
- package/build/loader/loadingscreen.d.ts.map +1 -1
- package/build/loader/parsers/aseprite.d.ts +0 -13
- package/build/loader/parsers/aseprite.d.ts.map +1 -1
- package/build/loader/parsers/audio.d.ts +1 -30
- package/build/loader/parsers/audio.d.ts.map +1 -1
- package/build/loader/parsers/binary.d.ts +1 -10
- package/build/loader/parsers/binary.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -1
- package/build/loader/parsers/fontface.d.ts +1 -13
- package/build/loader/parsers/fontface.d.ts.map +1 -1
- package/build/loader/parsers/gltf.d.ts +1 -70
- package/build/loader/parsers/gltf.d.ts.map +1 -1
- package/build/loader/parsers/image.d.ts +1 -22
- package/build/loader/parsers/image.d.ts.map +1 -1
- package/build/loader/parsers/json.d.ts +1 -10
- package/build/loader/parsers/json.d.ts.map +1 -1
- package/build/loader/parsers/mtl.d.ts +1 -28
- package/build/loader/parsers/mtl.d.ts.map +1 -1
- package/build/loader/parsers/obj.d.ts +1 -59
- package/build/loader/parsers/obj.d.ts.map +1 -1
- package/build/loader/parsers/pbr.d.ts +1 -62
- package/build/loader/parsers/pbr.d.ts.map +1 -1
- package/build/loader/parsers/script.d.ts +1 -10
- package/build/loader/parsers/script.d.ts.map +1 -1
- package/build/loader/parsers/shader.d.ts +1 -52
- package/build/loader/parsers/shader.d.ts.map +1 -1
- package/build/loader/parsers/tmx.d.ts +1 -10
- package/build/loader/parsers/tmx.d.ts.map +1 -1
- package/build/loader/parsers/video.d.ts +1 -10
- package/build/loader/parsers/video.d.ts.map +1 -1
- package/build/math/color.d.ts.map +1 -1
- package/build/math/noise.d.ts +0 -40
- package/build/math/noise.d.ts.map +1 -1
- package/build/math/observableVector2d.d.ts +0 -3
- package/build/math/observableVector2d.d.ts.map +1 -1
- package/build/math/observableVector3d.d.ts +0 -3
- package/build/math/observableVector3d.d.ts.map +1 -1
- package/build/math/vector2d.d.ts +0 -6
- package/build/math/vector2d.d.ts.map +1 -1
- package/build/math/vertex.d.ts +25 -0
- package/build/math/vertex.d.ts.map +1 -1
- package/build/particles/emitter.d.ts +0 -65
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +0 -81
- package/build/particles/particle.d.ts.map +1 -1
- package/build/physics/bounds.d.ts +0 -1
- package/build/physics/bounds.d.ts.map +1 -1
- package/build/physics/broadphase/broadphase.d.ts +0 -7
- package/build/physics/broadphase/broadphase.d.ts.map +1 -1
- package/build/physics/broadphase/octree.d.ts +0 -91
- package/build/physics/broadphase/octree.d.ts.map +1 -1
- package/build/physics/broadphase/quadtree.d.ts +0 -47
- package/build/physics/broadphase/quadtree.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +2 -65
- package/build/physics/builtin/body.d.ts.map +1 -1
- package/build/physics/builtin/detector.d.ts +0 -312
- package/build/physics/builtin/detector.d.ts.map +1 -1
- package/build/physics/builtin/sat.d.ts +1 -48
- package/build/physics/builtin/sat.d.ts.map +1 -1
- package/build/physics/builtin/sat3d.d.ts +1 -56
- package/build/physics/builtin/sat3d.d.ts.map +1 -1
- package/build/physics/collision.d.ts +0 -2
- package/build/physics/collision.d.ts.map +1 -1
- package/build/physics/response.d.ts +0 -1
- package/build/physics/response.d.ts.map +1 -1
- package/build/physics/world.d.ts.map +1 -1
- package/build/renderable/anchorPoint.d.ts +1 -73
- package/build/renderable/anchorPoint.d.ts.map +1 -1
- package/build/renderable/animation.d.ts +0 -7
- package/build/renderable/animation.d.ts.map +1 -1
- package/build/renderable/colorlayer.d.ts +0 -5
- package/build/renderable/colorlayer.d.ts.map +1 -1
- package/build/renderable/container.d.ts +0 -55
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/draggable.d.ts +0 -5
- package/build/renderable/draggable.d.ts.map +1 -1
- package/build/renderable/dragndrop.d.ts +1 -12
- package/build/renderable/dragndrop.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts +0 -8
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts +0 -41
- package/build/renderable/frameAnimation.d.ts.map +1 -1
- package/build/renderable/groundshadow.d.ts +1 -91
- package/build/renderable/groundshadow.d.ts.map +1 -1
- package/build/renderable/imagelayer.d.ts +0 -29
- package/build/renderable/imagelayer.d.ts.map +1 -1
- package/build/renderable/instanced_mesh.d.ts +26 -104
- package/build/renderable/instanced_mesh.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +130 -141
- package/build/renderable/mesh.d.ts.map +1 -1
- package/build/renderable/nineslicesprite.d.ts +0 -4
- package/build/renderable/nineslicesprite.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +1 -44
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +0 -45
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +0 -95
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +0 -14
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/bitmaptextdata.d.ts +0 -22
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
- package/build/renderable/text/glyph.d.ts +1 -39
- package/build/renderable/text/glyph.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts +0 -20
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/text/textstyle.d.ts +1 -5
- package/build/renderable/text/textstyle.d.ts.map +1 -1
- package/build/renderable/trail.d.ts +0 -29
- package/build/renderable/trail.d.ts.map +1 -1
- package/build/renderable/trigger.d.ts +0 -6
- package/build/renderable/trigger.d.ts.map +1 -1
- package/build/renderable/ui/uibaseelement.d.ts +0 -40
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
- package/build/renderable/ui/uispriteelement.d.ts +0 -35
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
- package/build/state/stage.d.ts +0 -66
- package/build/state/stage.d.ts.map +1 -1
- package/build/state/state.d.ts.map +1 -1
- package/build/system/device.d.ts +0 -12
- package/build/system/device.d.ts.map +1 -1
- package/build/system/dom.d.ts +1 -8
- package/build/system/dom.d.ts.map +1 -1
- package/build/system/legacy_pool.d.ts +1 -6
- package/build/system/legacy_pool.d.ts.map +1 -1
- package/build/system/platform.d.ts +0 -1
- package/build/system/platform.d.ts.map +1 -1
- package/build/system/pool.d.ts +0 -9
- package/build/system/pool.d.ts.map +1 -1
- package/build/system/save.d.ts.map +1 -1
- package/build/system/timer.d.ts +0 -20
- package/build/system/timer.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +0 -62
- package/build/tweens/tween.d.ts.map +1 -1
- package/build/utils/array-multimap.d.ts +1 -13
- package/build/utils/array-multimap.d.ts.map +1 -1
- package/build/utils/decode.d.ts.map +1 -1
- package/build/utils/fetchdata.d.ts +1 -31
- package/build/utils/fetchdata.d.ts.map +1 -1
- package/build/utils/utils.d.ts +0 -13
- package/build/utils/utils.d.ts.map +1 -1
- package/build/video/blendmodes.d.ts +1 -106
- package/build/video/blendmodes.d.ts.map +1 -1
- package/build/video/buffer/index.d.ts +1 -39
- package/build/video/buffer/index.d.ts.map +1 -1
- package/build/video/buffer/vertex.d.ts +1 -82
- package/build/video/buffer/vertex.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +2 -23
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/canvas_factory.d.ts +1 -24
- package/build/video/canvas_factory.d.ts.map +1 -1
- package/build/video/effects/blendEffect.d.ts +0 -54
- package/build/video/effects/blendEffect.d.ts.map +1 -1
- package/build/video/effects/colorMatrix.d.ts +0 -10
- package/build/video/effects/colorMatrix.d.ts.map +1 -1
- package/build/video/effects/glsl_realization.d.ts +1 -17
- package/build/video/effects/glsl_realization.d.ts.map +1 -1
- package/build/video/effects/radialGradient.d.ts +0 -1
- package/build/video/effects/radialGradient.d.ts.map +1 -1
- package/build/video/effects/shadereffect.d.ts +0 -113
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/effects/wgsl/layout.d.ts +1 -27
- package/build/video/effects/wgsl/layout.d.ts.map +1 -1
- package/build/video/effects/wgsl/parse.d.ts +1 -8
- package/build/video/effects/wgsl/parse.d.ts.map +1 -1
- package/build/video/effects/wgsl/scaffold.d.ts +1 -42
- package/build/video/effects/wgsl/scaffold.d.ts.map +1 -1
- package/build/video/effects/wgsl_realization.d.ts +1 -82
- package/build/video/effects/wgsl_realization.d.ts.map +1 -1
- package/build/video/gpu/batcher.d.ts +1 -13
- package/build/video/gpu/batcher.d.ts.map +1 -1
- package/build/video/gpu/instancerecord.d.ts +1 -163
- package/build/video/gpu/instancerecord.d.ts.map +1 -1
- package/build/video/gpu/meshchunk.d.ts +1 -48
- package/build/video/gpu/meshchunk.d.ts.map +1 -1
- package/build/video/gpu/meshvertex.d.ts +1 -53
- package/build/video/gpu/meshvertex.d.ts.map +1 -1
- package/build/video/gpu/primitives.d.ts +1 -59
- package/build/video/gpu/primitives.d.ts.map +1 -1
- package/build/video/gpu/quadcorners.d.ts +1 -10
- package/build/video/gpu/quadcorners.d.ts.map +1 -1
- package/build/video/gpu/textureslots.d.ts +1 -121
- package/build/video/gpu/textureslots.d.ts.map +1 -1
- package/build/video/gpu/texturestore.d.ts +1 -138
- package/build/video/gpu/texturestore.d.ts.map +1 -1
- package/build/video/gpu/topology.d.ts.map +1 -1
- package/build/video/gpu/vertexformat.d.ts +0 -28
- package/build/video/gpu/vertexformat.d.ts.map +1 -1
- package/build/video/gradient.d.ts +0 -81
- package/build/video/gradient.d.ts.map +1 -1
- package/build/video/renderer.d.ts +21 -102
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/renderstate.d.ts +0 -51
- package/build/video/renderstate.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +0 -10
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/render_target_pool.d.ts +1 -82
- package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
- package/build/video/rendertarget/webglrendertarget.d.ts +1 -64
- package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/webgpurendertarget.d.ts +0 -8
- package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +1 -75
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts +0 -136
- package/build/video/texture/cache.d.ts.map +1 -1
- package/build/video/texture/frametexture.d.ts +1 -71
- package/build/video/texture/frametexture.d.ts.map +1 -1
- package/build/video/texture/noise_texture2d.d.ts +0 -43
- package/build/video/texture/noise_texture2d.d.ts.map +1 -1
- package/build/video/texture/parser/aseprite.d.ts +1 -8
- package/build/video/texture/parser/aseprite.d.ts.map +1 -1
- package/build/video/texture/parser/spritesheet.d.ts +1 -8
- package/build/video/texture/parser/spritesheet.d.ts.map +1 -1
- package/build/video/texture/parser/texturepacker.d.ts +1 -8
- package/build/video/texture/parser/texturepacker.d.ts.map +1 -1
- package/build/video/texture/resource.d.ts +0 -9
- package/build/video/texture/resource.d.ts.map +1 -1
- package/build/video/texture/texture2d.d.ts +0 -11
- package/build/video/texture/texture2d.d.ts.map +1 -1
- package/build/video/utils/autodetect.d.ts +1 -5
- package/build/video/utils/autodetect.d.ts.map +1 -1
- package/build/video/webgl/batchers/batcher.d.ts +0 -55
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_mesh_batcher.d.ts +0 -14
- package/build/video/webgl/batchers/lit_mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts +0 -72
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts +0 -89
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/mesh_batcher.d.ts +14 -343
- package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/primitive_batcher.d.ts +0 -10
- package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts +0 -30
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/buffer/index.d.ts +1 -36
- package/build/video/webgl/buffer/index.d.ts.map +1 -1
- package/build/video/webgl/buffer/instance_buffer.d.ts +1 -53
- package/build/video/webgl/buffer/instance_buffer.d.ts.map +1 -1
- package/build/video/webgl/buffer/retained_geometry.d.ts +1 -81
- package/build/video/webgl/buffer/retained_geometry.d.ts.map +1 -1
- package/build/video/webgl/buffer/uniformblock.d.ts +1 -80
- package/build/video/webgl/buffer/uniformblock.d.ts.map +1 -1
- package/build/video/webgl/buffer/vertexstate.d.ts +1 -100
- package/build/video/webgl/buffer/vertexstate.d.ts.map +1 -1
- package/build/video/webgl/glshader.d.ts +0 -49
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/lighting/pack3d.d.ts +1 -47
- package/build/video/webgl/lighting/pack3d.d.ts.map +1 -1
- package/build/video/webgl/lighting/std140.d.ts +1 -109
- package/build/video/webgl/lighting/std140.d.ts.map +1 -1
- package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +1 -103
- package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
- package/build/video/webgl/shaders/multitexture-lit.d.ts +1 -26
- package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
- package/build/video/webgl/shaders/multitexture.d.ts +1 -9
- package/build/video/webgl/shaders/multitexture.d.ts.map +1 -1
- package/build/video/webgl/texture/store.d.ts +1 -50
- package/build/video/webgl/texture/store.d.ts.map +1 -1
- package/build/video/webgl/utils/attributes.d.ts +1 -11
- package/build/video/webgl/utils/attributes.d.ts.map +1 -1
- package/build/video/webgl/utils/maxtextures.d.ts +1 -36
- package/build/video/webgl/utils/maxtextures.d.ts.map +1 -1
- package/build/video/webgl/utils/precision.d.ts +1 -14
- package/build/video/webgl/utils/precision.d.ts.map +1 -1
- package/build/video/webgl/utils/program.d.ts +1 -5
- package/build/video/webgl/utils/program.d.ts.map +1 -1
- package/build/video/webgl/utils/samplercache.d.ts +1 -68
- package/build/video/webgl/utils/samplercache.d.ts.map +1 -1
- package/build/video/webgl/utils/string.d.ts +1 -21
- package/build/video/webgl/utils/string.d.ts.map +1 -1
- package/build/video/webgl/utils/topology.d.ts +1 -23
- package/build/video/webgl/utils/topology.d.ts.map +1 -1
- package/build/video/webgl/utils/uniforms.d.ts +1 -25
- package/build/video/webgl/utils/uniforms.d.ts.map +1 -1
- package/build/video/webgl/utils/vertexformat.d.ts +1 -26
- package/build/video/webgl/utils/vertexformat.d.ts.map +1 -1
- package/build/video/webgl/webgl_renderer.d.ts +22 -285
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts +0 -6
- package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +0 -8
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/mesh_batcher.d.ts +1 -230
- package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/primitive_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -82
- package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/buffer/arena.d.ts +1 -63
- package/build/video/webgpu/buffer/arena.d.ts.map +1 -1
- package/build/video/webgpu/buffer/instance_buffer.d.ts +1 -64
- package/build/video/webgpu/buffer/instance_buffer.d.ts.map +1 -1
- package/build/video/webgpu/buffer/retained_geometry.d.ts +1 -54
- package/build/video/webgpu/buffer/retained_geometry.d.ts.map +1 -1
- package/build/video/webgpu/buffer/uniformring.d.ts +1 -67
- package/build/video/webgpu/buffer/uniformring.d.ts.map +1 -1
- package/build/video/webgpu/effect_binding.d.ts +1 -16
- package/build/video/webgpu/effect_binding.d.ts.map +1 -1
- package/build/video/webgpu/pipeline/bindgroups.d.ts +1 -32
- package/build/video/webgpu/pipeline/bindgroups.d.ts.map +1 -1
- package/build/video/webgpu/pipeline/cache.d.ts +1 -163
- package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +1 -87
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
- package/build/video/webgpu/shaders/mesh-instanced.d.ts +1 -43
- package/build/video/webgpu/shaders/mesh-instanced.d.ts.map +1 -1
- package/build/video/webgpu/texture/compressed.d.ts +1 -32
- package/build/video/webgpu/texture/compressed.d.ts.map +1 -1
- package/build/video/webgpu/texture/frametexture.d.ts +1 -62
- package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
- package/build/video/webgpu/texture/store.d.ts +1 -147
- package/build/video/webgpu/texture/store.d.ts.map +1 -1
- package/build/video/webgpu/webgpu_renderer.d.ts +0 -88
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +5 -4
- package/skills/melonjs/SKILL.md +1 -1
- package/skills/melonjs-3d/SKILL.md +301 -2
- package/skills/melonjs-3d-assets/SKILL.md +25 -6
- package/skills/melonjs-audio/SKILL.md +21 -0
- package/skills/melonjs-camera-and-drawing/SKILL.md +4 -0
- package/skills/melonjs-effects-and-shaders/SKILL.md +2 -1
- package/skills/melonjs-loading-assets/SKILL.md +30 -1
- package/skills/melonjs-performance/SKILL.md +5 -0
- package/skills/melonjs-tilemaps/SKILL.md +31 -11
- package/skills/melonjs-ui-and-text/SKILL.md +17 -127
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
export default class CanvasRenderer extends Renderer {
|
|
17
17
|
cache: TextureCache;
|
|
18
18
|
onGameReset: () => void;
|
|
19
|
-
_lightCache: WeakMap<object, any> | undefined;
|
|
20
|
-
_frameTexture: any;
|
|
21
19
|
/**
|
|
22
20
|
* set/change the current projection matrix.
|
|
23
21
|
* In Canvas mode, this applies the ortho projection as a canvas 2D transform
|
|
@@ -126,9 +124,6 @@ export default class CanvasRenderer extends Renderer {
|
|
|
126
124
|
* @param {Mesh} mesh - a Mesh renderable or compatible object
|
|
127
125
|
*/
|
|
128
126
|
drawMesh(mesh: Mesh): void;
|
|
129
|
-
_meshColorCanvas: HTMLCanvasElement | OffscreenCanvas | undefined;
|
|
130
|
-
_meshColorCtx: RenderingContext | OffscreenCanvasRenderingContext2D | null | undefined;
|
|
131
|
-
_meshSortBuf: Float64Array<ArrayBuffer> | undefined;
|
|
132
127
|
/**
|
|
133
128
|
* starts a new path by emptying the list of sub-paths. Call this method when you want to create a new path
|
|
134
129
|
* @example
|
|
@@ -197,9 +192,9 @@ export default class CanvasRenderer extends Renderer {
|
|
|
197
192
|
* @param {number} y - The y axis of the coordinate for the rectangle starting point.
|
|
198
193
|
* @param {number} width - The rectangle's width.
|
|
199
194
|
* @param {number} height - The rectangle's height.
|
|
200
|
-
* @param {number}
|
|
195
|
+
* @param {number} radii - The corner radius.
|
|
201
196
|
*/
|
|
202
|
-
roundRect(x: number, y: number, width: number, height: number, radii:
|
|
197
|
+
roundRect(x: number, y: number, width: number, height: number, radii: number): void;
|
|
203
198
|
/**
|
|
204
199
|
* stroke the given shape or the current defined path
|
|
205
200
|
* @param {Rect|RoundRect|Polygon|Line|Ellipse|Bounds} [shape] - a shape object to stroke
|
|
@@ -284,8 +279,6 @@ export default class CanvasRenderer extends Renderer {
|
|
|
284
279
|
* Draw a point at the specified coordinates
|
|
285
280
|
* @param {number} x
|
|
286
281
|
* @param {number} y
|
|
287
|
-
* @param {number} width
|
|
288
|
-
* @param {number} height
|
|
289
282
|
*/
|
|
290
283
|
fillPoint(x: number, y: number): void;
|
|
291
284
|
/**
|
|
@@ -293,10 +286,6 @@ export default class CanvasRenderer extends Renderer {
|
|
|
293
286
|
* @returns {number} global alpha value
|
|
294
287
|
*/
|
|
295
288
|
getGlobalAlpha(): number;
|
|
296
|
-
/**
|
|
297
|
-
* @ignore
|
|
298
|
-
*/
|
|
299
|
-
set lineJoin(value: string);
|
|
300
289
|
/**
|
|
301
290
|
* sets or returns the shape used to join two line segments where they meet.
|
|
302
291
|
* There are three possible values for this property: "round", "bevel", and "miter"
|
|
@@ -326,16 +315,6 @@ export default class CanvasRenderer extends Renderer {
|
|
|
326
315
|
* @param {number} [f] - the f component to multiply the current matrix by; omitted when `a` is a matrix
|
|
327
316
|
*/
|
|
328
317
|
transform(a: Matrix2d | Matrix3d | number, b?: number, c?: number, d?: number, e?: number, f?: number): void;
|
|
329
|
-
/**
|
|
330
|
-
* A mask limits rendering elements to the shape and position of the given mask object.
|
|
331
|
-
* If the drawing or rendering area is larger than the mask, only the intersecting part of the renderable will be visible.
|
|
332
|
-
* (Note Mask are not preserved through renderer context save and restore and need so be manually cleared)
|
|
333
|
-
* @see CanvasRenderer#clearMask
|
|
334
|
-
* @param {Rect|RoundRect|Polygon|Line|Ellipse} [mask] - the shape defining the mask to be applied
|
|
335
|
-
* @param {boolean} [invert=false] - either the given shape should define what is visible (default) or the opposite
|
|
336
|
-
*/
|
|
337
|
-
setMask(mask?: Rect | RoundRect | Polygon | Line | Ellipse, invert?: boolean): void;
|
|
338
|
-
_maskInvertOuterAdded: boolean | undefined;
|
|
339
318
|
}
|
|
340
319
|
import Renderer from "./../renderer.js";
|
|
341
320
|
import TextureCache from "./../texture/cache.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/canvas/canvas_renderer.js"],"names":[],"mappings":"AAcA;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH;IAiBE,oBAAmC;IAiCnC,wBAEC;IAyBD,8CAA4B;IAyE1B,mBAA0B;IA6B7B;;;;;OAKG;IACH,sBAFW,QAAQ,QAclB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,oBAHW,MAAM,GACJ,MAAM,CA2ClB;IAWD;;;;OAIG;IACH,mBAHW,KAAK,GAAC,MAAM,WACZ,OAAO,QAajB;IAED;;;;;;OAMG;IACH,aALW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QAIhB;IAED;;;;;;;;;;;OAWG;IACH,qBAVW,gBAAgB,GAAC,eAAe,GAAC,gBAAgB,GAAC,iBAAiB,GAAC,WAAW,GAAC,eAAe,GAAC,UAAU,WAC1G,MAAM,GACJ,aAAa,CAezB;IAiID;;;;;;;;OAQG;IACH,qBAPW,aAAa,KACb,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QAiBhB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAFW,IAAI,
|
|
1
|
+
{"version":3,"file":"canvas_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/canvas/canvas_renderer.js"],"names":[],"mappings":"AAcA;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH;IAiBE,oBAAmC;IAiCnC,wBAEC;IAyBD;;;OAGG;IACH,8CAA4B;IAyE1B;;;OAGG;IACH,mBAA0B;IA6B7B;;;;;OAKG;IACH,sBAFW,QAAQ,QAclB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,oBAHW,MAAM,GACJ,MAAM,CA2ClB;IAWD;;;;OAIG;IACH,mBAHW,KAAK,GAAC,MAAM,WACZ,OAAO,QAajB;IAED;;;;;;OAMG;IACH,aALW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QAIhB;IAED;;;;;;;;;;;OAWG;IACH,qBAVW,gBAAgB,GAAC,eAAe,GAAC,gBAAgB,GAAC,iBAAiB,GAAC,WAAW,GAAC,eAAe,GAAC,UAAU,WAC1G,MAAM,GACJ,aAAa,CAezB;IAiID;;;;;;;;OAQG;IACH,qBAPW,aAAa,KACb,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QAiBhB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAFW,IAAI,QAwOd;IA1LE;;;OAGG;IACH,kEAAyD;IACzD;;;OAGG;IACH,uFAA2D;IAa5D;;;OAGG;IACH,oDAAkD;IAkKpD;;;;;;;;;;;;;;;OAeG;IACH,kBAEC;IAED;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAIhB;IAED;;OAEG;IACH,6BAEC;IAED;;;;;;OAMG;IACH,sBALW,MAAM,OACN,MAAM,KACN,MAAM,KACN,MAAM,QAIhB;IAED;;;;;;;;OAQG;IACH,oBAPW,MAAM,QACN,MAAM,QACN,MAAM,QACN,MAAM,KACN,MAAM,KACN,MAAM,QAIhB;IAED;;;;;;;OAOG;IACH,UANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,UACN,MAAM,QAIhB;IAED;;;;;;OAMG;IACH,QALW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QAIhB;IAED;;;;;;;OAOG;IACH,aANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,SACN,MAAM,QAIhB;IAED;;;;OAIG;IACH,eAHW,IAAI,GAAC,SAAS,GAAC,OAAO,GAAC,IAAI,GAAC,OAAO,GAAC,MAAM,SAC1C,OAAO,QAoCjB;IAED;;;OAGG;IACH,aAFW,IAAI,GAAC,SAAS,GAAC,OAAO,GAAC,IAAI,GAAC,OAAO,GAAC,MAAM,QAIpD;IAED;;OAEG;IACH,kBAEC;IAED;;;;;;;;;OASG;IACH,aARW,MAAM,KACN,MAAM,UACN,MAAM,SACN,MAAM,OACN,MAAM,kBACN,OAAO,SACP,OAAO,QAcjB;IAED;;;;;;;;OAQG;IACH,WAPW,MAAM,KACN,MAAM,UACN,MAAM,SACN,MAAM,OACN,MAAM,kBACN,OAAO,QAIjB;IAsDD;;;;;;OAMG;IACH,iBALW,MAAM,UACN,MAAM,QACN,MAAM,QACN,MAAM,QAIhB;IAmBD;;;;OAIG;IACH,oBAHW,OAAO,SACP,OAAO,QAyBjB;IAED;;;OAGG;IACH,kBAFW,OAAO,QAIjB;IA+BD;;;;;;;;OAQG;IACH,mBAPW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,UACN,MAAM,SACN,OAAO,QAYjB;IAED;;;;;;;OAOG;IACH,iBANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,UACN,MAAM,QAIhB;IAED;;;;OAIG;IACH,eAHW,MAAM,KACN,MAAM,QAIhB;IAED;;;;OAIG;IACH,aAHW,MAAM,KACN,MAAM,QAIhB;IA+GD;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IA6BD;;;OAGG;IACH,oBAXU,MAAM,EAcf;IAjBD;;;;;OAKG;IACH,gBAHU,MAAM,CAKf;IAWD;;;;;;;;;OASG;IACH,gBAPW,QAAQ,GAAC,QAAQ,GAAC,MAAM,MACxB,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAKhB;IAED;;;;;;;;;OASG;IACH,aAPW,QAAQ,GAAC,QAAQ,GAAC,MAAM,MACxB,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QA+BhB;IA8GC;;;OAGG;IACH,2CAAkC;CAgGpC;qBA1iDoB,kBAAkB;yBACd,uBAAuB;sBAX1B,uBAAuB;0BAgBtB,iCAAiC;+BAC5B,iCAAiC;6BACnC,6BAA6B;0BAChC,4BAA4B;6BACzB,+BAA+B;4BAEhC,yBAAyB;8BADvB,wBAAwB"}
|
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Create and return a new Canvas element (or `OffscreenCanvas` when
|
|
3
|
-
* supported and `returnOffscreenCanvas` is true). The single low-level
|
|
4
|
-
* allocator used by every renderer-side scratch / fallback / render-
|
|
5
|
-
* target canvas in the engine.
|
|
6
|
-
*
|
|
7
|
-
* Lives in its own module (not on `Renderer` directly) to break the
|
|
8
|
-
* circular dependency between `Renderer` and `CanvasRenderTarget` —
|
|
9
|
-
* both can import this helper without referencing each other.
|
|
10
|
-
* `Renderer.createCanvas` re-exposes it as a static method for the
|
|
11
|
-
* public-facing API; internal callers can import it directly.
|
|
12
|
-
*
|
|
13
|
-
* Gates the OffscreenCanvas path on `device.offscreenCanvas` (the
|
|
14
|
-
* vetted capability check — actually instantiates + verifies
|
|
15
|
-
* `getContext("2d")` works inside a try/catch, covering historical
|
|
16
|
-
* Safari quirks).
|
|
17
|
-
* @param {number} width - canvas width in pixels
|
|
18
|
-
* @param {number} height - canvas height in pixels
|
|
19
|
-
* @param {boolean} [returnOffscreenCanvas=false] - return an
|
|
20
|
-
* `OffscreenCanvas` if the platform supports it
|
|
21
|
-
* @returns {HTMLCanvasElement|OffscreenCanvas} a new canvas of the given size
|
|
22
|
-
* @ignore
|
|
23
|
-
*/
|
|
24
|
-
export function createCanvas(width: number, height: number, returnOffscreenCanvas?: boolean): HTMLCanvasElement | OffscreenCanvas;
|
|
1
|
+
|
|
25
2
|
//# sourceMappingURL=canvas_factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas_factory.d.ts","sourceRoot":"","sources":["../../src/video/canvas_factory.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"canvas_factory.d.ts","sourceRoot":"","sources":["../../src/video/canvas_factory.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oCARW,MAAM,UACN,MAAM,0BACN,OAAO,GAEL,iBAAiB,GAAC,eAAe,CAuB7C"}
|
|
@@ -1,57 +1,3 @@
|
|
|
1
1
|
export const wgslFragment: "\nstruct BlendUniforms {\n\tuBlendMode : f32,\n};\n@group(3) @binding(0) var<uniform> fx : BlendUniforms;\n@group(3) @binding(1) var backdrop : texture_2d<f32>;\n@group(3) @binding(2) var backdrop_sampler : sampler;\n\n// HardLight(Cb, Cs) \u2014 also the kernel for Overlay, which the W3C spec\n// defines as HardLight with the arguments swapped\nfn ME_hardLight(b : vec3f, s : vec3f) -> vec3f {\n\tlet lo = 2.0 * b * s;\n\tlet hi = 1.0 - 2.0 * (1.0 - b) * (1.0 - s);\n\treturn mix(lo, hi, step(vec3f(0.5), s));\n}\n\nfn ME_softLight(b : vec3f, s : vec3f) -> vec3f {\n\tlet d = mix(((16.0 * b - 12.0) * b + 4.0) * b, sqrt(b), step(vec3f(0.25), b));\n\tlet lo = b - (1.0 - 2.0 * s) * b * (1.0 - b);\n\tlet hi = b + (2.0 * s - 1.0) * (d - b);\n\treturn mix(lo, hi, step(vec3f(0.5), s));\n}\n\n// Cb == 0 wins over Cs == 1, so it is applied last\nfn ME_colorDodge(b : vec3f, s : vec3f) -> vec3f {\n\tvar r = min(vec3f(1.0), b / max(1.0 - s, vec3f(1e-4)));\n\tr = mix(r, vec3f(1.0), step(vec3f(1.0), s));\n\treturn mix(r, vec3f(0.0), step(b, vec3f(0.0)));\n}\n\n// Cb == 1 wins over Cs == 0, so it is applied last\nfn ME_colorBurn(b : vec3f, s : vec3f) -> vec3f {\n\tvar r = 1.0 - min(vec3f(1.0), (1.0 - b) / max(s, vec3f(1e-4)));\n\tr = mix(r, vec3f(0.0), step(s, vec3f(0.0)));\n\treturn mix(r, vec3f(1.0), step(vec3f(1.0), b));\n}\n\nfn ME_blend(b : vec3f, s : vec3f) -> vec3f {\n\tif (fx.uBlendMode < 0.5) { return abs(b - s); }\n\tif (fx.uBlendMode < 1.5) { return ME_hardLight(s, b); }\n\tif (fx.uBlendMode < 2.5) { return ME_hardLight(b, s); }\n\tif (fx.uBlendMode < 3.5) { return ME_colorDodge(b, s); }\n\tif (fx.uBlendMode < 4.5) { return ME_colorBurn(b, s); }\n\tif (fx.uBlendMode < 5.5) { return ME_softLight(b, s); }\n\tif (fx.uBlendMode < 6.5) { return min(b, s); }\n\treturn max(b, s);\n}\n\nfn apply(color : vec4f, uv : vec2f) -> vec4f {\n\t// sampled BEFORE any branch, so plain textureSampleLevel is safe here\n\tlet Cb = textureSampleLevel(backdrop, backdrop_sampler, screen_uv, 0.0).rgb;\n\tlet a = color.a;\n\tlet Cs = color.rgb / max(a, 1e-4);\n\tlet B = clamp(ME_blend(Cb, Cs), vec3f(0.0), vec3f(1.0));\n\treturn vec4f(a * B, a);\n}\n";
|
|
2
|
-
/**
|
|
3
|
-
* The compositing shader behind the six CSS blend modes that fixed-function
|
|
4
|
-
* blending cannot express: `overlay`, `hard-light`, `color-dodge`,
|
|
5
|
-
* `color-burn`, `soft-light` and `difference`.
|
|
6
|
-
*
|
|
7
|
-
* Internal — owned by the renderer, one instance per renderer, never
|
|
8
|
-
* constructed or configured by user code. A game selects a mode the ordinary
|
|
9
|
-
* way (`sprite.blendMode = "overlay"`, or `renderer.setBlendMode("overlay")`)
|
|
10
|
-
* and the renderer drives this effect from there.
|
|
11
|
-
*
|
|
12
|
-
* ### How it composites
|
|
13
|
-
*
|
|
14
|
-
* The renderer captures the destination, renders the draw to an offscreen
|
|
15
|
-
* target, then blits that target through this effect. Everything arriving in
|
|
16
|
-
* `color` is PREMULTIPLIED (the offscreen was drawn source-over into a
|
|
17
|
-
* transparent clear), while the W3C formulas are defined on straight colour —
|
|
18
|
-
* so the body un-premultiplies, blends, and re-premultiplies.
|
|
19
|
-
*
|
|
20
|
-
* Emitting premultiplied and letting ordinary source-over run the composite
|
|
21
|
-
* yields `as*B + (1-as)*Cb` and a correct output alpha for free. It also keeps
|
|
22
|
-
* the premultiplied invariant `rgb <= a` — a texel with `rgb > a` is undefined
|
|
23
|
-
* and diverges across browsers — which is why `B` is clamped even though all
|
|
24
|
-
* six formulas land in `[0,1]` analytically.
|
|
25
|
-
*
|
|
26
|
-
* The backdrop is treated as opaque (`ab = 1`). The GL capture is an RGB
|
|
27
|
-
* texture so that is true by construction there; the WebGPU capture preserves
|
|
28
|
-
* alpha and is deliberately ignored, so the two backends agree.
|
|
29
|
-
*
|
|
30
|
-
* ### Why not the `: screen_texture` builtin
|
|
31
|
-
*
|
|
32
|
-
* That annotation wires the sampler to the renderer's SHARED capture slot,
|
|
33
|
-
* which `drawImage` already refreshes on behalf of any custom shader that
|
|
34
|
-
* samples the screen. A renderable carrying an advanced blend mode AND a
|
|
35
|
-
* screen-sampling {@link ShaderEffect} would then have the two fighting over
|
|
36
|
-
* one texture. This declares a plain sampler instead and the renderer binds
|
|
37
|
-
* its own capture, so the two are independent. Referencing `screen_uv` still
|
|
38
|
-
* activates that varying on its own.
|
|
39
|
-
* @see {@link https://www.w3.org/TR/compositing-1/#blending}
|
|
40
|
-
* @ignore
|
|
41
|
-
*/
|
|
42
|
-
export default class BlendEffect extends ShaderEffect {
|
|
43
|
-
/**
|
|
44
|
-
* @param {import("../webgl/webgl_renderer.js").default|import("../webgpu/webgpu_renderer.js").default} renderer - the renderer that owns this effect
|
|
45
|
-
*/
|
|
46
|
-
constructor(renderer: import("../webgl/webgl_renderer.js").default | import("../webgpu/webgpu_renderer.js").default);
|
|
47
|
-
/**
|
|
48
|
-
* Select which of the six formulas the shader evaluates.
|
|
49
|
-
* @param {string} mode - one of the modes in {@link ADVANCED_BLEND_MODES}
|
|
50
|
-
* @returns {boolean} false when the mode is not an advanced blend mode, in
|
|
51
|
-
* which case the uniform is left untouched
|
|
52
|
-
* @ignore
|
|
53
|
-
*/
|
|
54
|
-
setBlendMode(mode: string): boolean;
|
|
55
|
-
}
|
|
56
2
|
import ShaderEffect from "./shadereffect.js";
|
|
57
3
|
//# sourceMappingURL=blendEffect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blendEffect.d.ts","sourceRoot":"","sources":["../../../src/video/effects/blendEffect.js"],"names":[],"mappings":"AAgBA,soEAwDE;AAEF
|
|
1
|
+
{"version":3,"file":"blendEffect.d.ts","sourceRoot":"","sources":["../../../src/video/effects/blendEffect.js"],"names":[],"mappings":"AAgBA,soEAwDE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH;IACC;;OAEG;IACH,sBAFW,OAAO,4BAA4B,EAAE,OAAO,GAAC,OAAO,8BAA8B,EAAE,OAAO,EA4DrG;IAED;;;;;;;OAOG;IACH,mBANW,MAAM,GACJ,OAAO,CAYnB;CACD;yBAlMwB,mBAAmB"}
|
|
@@ -22,16 +22,6 @@ export default class ColorMatrixEffect extends ShaderEffect {
|
|
|
22
22
|
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
23
23
|
matrix?: ColorMatrix | undefined;
|
|
24
24
|
});
|
|
25
|
-
/**
|
|
26
|
-
* the internal color matrix
|
|
27
|
-
* @ignore
|
|
28
|
-
*/
|
|
29
|
-
_matrix: ColorMatrix;
|
|
30
|
-
/**
|
|
31
|
-
* Push the current matrix values to the GPU.
|
|
32
|
-
* @ignore
|
|
33
|
-
*/
|
|
34
|
-
_syncUniform(): void;
|
|
35
25
|
/**
|
|
36
26
|
* Reset the color matrix to identity (no color change).
|
|
37
27
|
* @returns {this} this instance for chaining
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorMatrix.d.ts","sourceRoot":"","sources":["../../../src/video/effects/colorMatrix.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;OAIG;IACH,sBAJW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAA8B,MAAM;KACtC,
|
|
1
|
+
{"version":3,"file":"colorMatrix.d.ts","sourceRoot":"","sources":["../../../src/video/effects/colorMatrix.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;OAIG;IACH,sBAJW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAA8B,MAAM;KACtC,EAmBA;IAPA;;;;OAIG;IACH,qBAAkD;IAInD;;;;OAIG;IACH,qBAEC;IAED;;;OAGG;IACH,SAFa,IAAI,CAMhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,WAAW,GACT,IAAI,CAMhB;IAED;;;;;OAKG;IACH,mBAHc,MAAM,EAAA,GACP,IAAI,CAMhB;CACD;yBAnKwB,mBAAmB;4BADhB,4BAA4B"}
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Assemble the complete GLSL program sources for a ShaderEffect fragment
|
|
3
|
-
* body: parse the builtins, build the vertex variant, and wrap the user's
|
|
4
|
-
* `apply()` with the texture-sampling boilerplate.
|
|
5
|
-
* @param {string} fragmentBody - the user body (GLSL, `vec4 apply(vec4, vec2)` convention)
|
|
6
|
-
* @returns {{vertex: string, fragment: string, screenTextures: Array<{name: string, repeat: string}>, noiseUV: boolean}} the assembled sources + builtin usage
|
|
7
|
-
* @ignore
|
|
8
|
-
*/
|
|
9
|
-
export function buildGLSLProgram(fragmentBody: string): {
|
|
10
|
-
vertex: string;
|
|
11
|
-
fragment: string;
|
|
12
|
-
screenTextures: Array<{
|
|
13
|
-
name: string;
|
|
14
|
-
repeat: string;
|
|
15
|
-
}>;
|
|
16
|
-
noiseUV: boolean;
|
|
17
|
-
};
|
|
1
|
+
|
|
18
2
|
//# sourceMappingURL=glsl_realization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsl_realization.d.ts","sourceRoot":"","sources":["../../../src/video/effects/glsl_realization.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"glsl_realization.d.ts","sourceRoot":"","sources":["../../../src/video/effects/glsl_realization.js"],"names":[],"mappings":"AAoHA;;;;;;;;GAQG;AACH,+CALW,MAAM,GACJ;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAC,CA8BvH"}
|
|
@@ -85,7 +85,6 @@ export default class RadialGradientEffect extends ShaderEffect {
|
|
|
85
85
|
color?: Color | undefined;
|
|
86
86
|
intensity?: number | undefined;
|
|
87
87
|
});
|
|
88
|
-
_colorBuf: Float32Array<ArrayBuffer>;
|
|
89
88
|
/**
|
|
90
89
|
* Set the center color. RGB only — alpha is ignored (the radial
|
|
91
90
|
* falloff supplies the per-pixel alpha).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radialGradient.d.ts","sourceRoot":"","sources":["../../../src/video/effects/radialGradient.js"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH;IACC;;;;;OAKG;IACH,+CAHG;QAAwB,KAAK;QACJ,SAAS;KACpC,
|
|
1
|
+
{"version":3,"file":"radialGradient.d.ts","sourceRoot":"","sources":["../../../src/video/effects/radialGradient.js"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH;IACC;;;;;OAKG;IACH,+CAHG;QAAwB,KAAK;QACJ,SAAS;KACpC,EA+DA;IAhBA;;;OAGG;IACH,qCAAoC;IAcrC;;;;OAIG;IACH,gBAFW,KAAK,QAOf;IAED;;;;OAIG;IACH,wBAFW,MAAM,QAIhB;CACD;yBA1KwB,mBAAmB;2BAIlB,qBAAqB"}
|
|
@@ -170,55 +170,6 @@ export default class ShaderEffect {
|
|
|
170
170
|
* @default false
|
|
171
171
|
*/
|
|
172
172
|
shared: boolean;
|
|
173
|
-
/**
|
|
174
|
-
* the renderer this effect was created for — kept so destroy and
|
|
175
|
-
* context-loss can release the texture units reserved on its cache
|
|
176
|
-
* for extra samplers ({@link setTexture}), and so {@link clone} can
|
|
177
|
-
* compile an independent copy
|
|
178
|
-
* @ignore
|
|
179
|
-
*/
|
|
180
|
-
_renderer: any;
|
|
181
|
-
/**
|
|
182
|
-
* the construction "recipe" (body + precision), kept VERBATIM so
|
|
183
|
-
* {@link clone} can compile an independent copy. Stored before the
|
|
184
|
-
* disabled-stub early return so cloning behaves consistently there too.
|
|
185
|
-
* @ignore
|
|
186
|
-
*/
|
|
187
|
-
_fragmentBody: string | {
|
|
188
|
-
glsl?: string;
|
|
189
|
-
wgsl?: string;
|
|
190
|
-
};
|
|
191
|
-
/** @ignore */
|
|
192
|
-
_precision: string | undefined;
|
|
193
|
-
/**
|
|
194
|
-
* extra texture samplers bound via {@link setTexture}, keyed by the
|
|
195
|
-
* uniform name → `{ image, repeat, tex }` (`tex` is the uploaded GL
|
|
196
|
-
* texture, created lazily on first draw; unused on WebGPU, where the
|
|
197
|
-
* bind group is built lazily instead)
|
|
198
|
-
* @ignore
|
|
199
|
-
*/
|
|
200
|
-
_extraTextures: Map<any, any> | undefined;
|
|
201
|
-
/**
|
|
202
|
-
* samplers annotated `: screen_texture` — the renderer checks this to
|
|
203
|
-
* know when to refresh the shared frame capture before the effect draws
|
|
204
|
-
* @type {Array<{name: string, repeat: string}>}
|
|
205
|
-
* @ignore
|
|
206
|
-
*/
|
|
207
|
-
_screenTextureUniforms: Array<{
|
|
208
|
-
name: string;
|
|
209
|
-
repeat: string;
|
|
210
|
-
}>;
|
|
211
|
-
/** @ignore */
|
|
212
|
-
_hasNoiseUV: any;
|
|
213
|
-
/** @ignore */
|
|
214
|
-
_shader: GLShader | undefined;
|
|
215
|
-
/** @ignore */
|
|
216
|
-
wgslRealization: WGSLEffectRealization | undefined;
|
|
217
|
-
/** @private */
|
|
218
|
-
private _onContextLost;
|
|
219
|
-
_enabledBeforeSuspend: boolean | undefined;
|
|
220
|
-
/** @private */
|
|
221
|
-
private _onContextRestored;
|
|
222
173
|
/**
|
|
223
174
|
* Set the uniform to the given value
|
|
224
175
|
* @param {string} name - the uniform name
|
|
@@ -249,43 +200,6 @@ export default class ShaderEffect {
|
|
|
249
200
|
* flow.setTime(me.timer.getTime() / 1000);
|
|
250
201
|
*/
|
|
251
202
|
setTime(seconds: number): ShaderEffect;
|
|
252
|
-
/**
|
|
253
|
-
* Feed the UV y-direction of the space `apply()` is about to run in:
|
|
254
|
-
* `+1` where `uv.y` grows downward (direct sprite sampling, and every
|
|
255
|
-
* WebGPU path), `-1` on the WebGL pooled-blit path, whose capture FBOs
|
|
256
|
-
* are bottom-up — there, y-directional UV arithmetic inside a body
|
|
257
|
-
* runs vertically mirrored unless compensated. Directional bodies
|
|
258
|
-
* (DropShadow) declare a `uUVYDir` uniform and multiply their y
|
|
259
|
-
* offsets with it, so "down" means down on every path of every
|
|
260
|
-
* backend. A silent no-op for bodies that don't declare the uniform.
|
|
261
|
-
* @param {number} dir - +1 (uv.y grows downward) or -1 (upward)
|
|
262
|
-
* @ignore
|
|
263
|
-
*/
|
|
264
|
-
_setUVYDir(dir: number): void;
|
|
265
|
-
_uvYDir: any;
|
|
266
|
-
/**
|
|
267
|
-
* Feed the `noise_uv` builtin's frame rect for the object about to draw:
|
|
268
|
-
* the source texture dimensions, the destination (object) dimensions, and
|
|
269
|
-
* the frame's top-left UV origin. Called by the quad batchers per draw;
|
|
270
|
-
* a no-op unless this effect's fragment actually uses `noise_uv` (the
|
|
271
|
-
* `ME_*` uniforms only exist — and are only active — then).
|
|
272
|
-
* @param {number} sourceWidth - source texture width in pixels
|
|
273
|
-
* @param {number} sourceHeight - source texture height in pixels
|
|
274
|
-
* @param {number} objectWidth - destination (object) width in pixels
|
|
275
|
-
* @param {number} objectHeight - destination (object) height in pixels
|
|
276
|
-
* @param {number} u0 - the frame's left UV coordinate (flip-normalized)
|
|
277
|
-
* @param {number} v0 - the frame's top UV coordinate (flip-normalized)
|
|
278
|
-
* @ignore
|
|
279
|
-
*/
|
|
280
|
-
_setNoiseUVRect(sourceWidth: number, sourceHeight: number, objectWidth: number, objectHeight: number, u0: number, v0: number): void;
|
|
281
|
-
/**
|
|
282
|
-
* Apply the wrap mode a `: screen_texture(<repeat>)` annotation asked for
|
|
283
|
-
* onto the live capture handle. The unit is force-activated first: the
|
|
284
|
-
* batcher's bind may have been skipped as redundant while the GL active
|
|
285
|
-
* unit points elsewhere.
|
|
286
|
-
* @ignore
|
|
287
|
-
*/
|
|
288
|
-
_applyCaptureWrap(batcher: any, glTex: any, entry: any): void;
|
|
289
203
|
/**
|
|
290
204
|
* Bind an **extra** texture to a named `sampler2D` uniform in this shader, so
|
|
291
205
|
* a custom effect can read a *second* texture — a noise map, mask, gradient,
|
|
@@ -318,17 +232,6 @@ export default class ShaderEffect {
|
|
|
318
232
|
* water.setTime(me.timer.getTime() / 1000);
|
|
319
233
|
*/
|
|
320
234
|
setTexture(name: string, image: Texture2d | HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap, repeat?: "repeat" | "repeat-x" | "repeat-y" | "no-repeat"): ShaderEffect;
|
|
321
|
-
/**
|
|
322
|
-
* (Re)bind this effect's extra textures ({@link setTexture}) to reserved GL
|
|
323
|
-
* texture units and point their sampler uniforms at them. Called by the
|
|
324
|
-
* renderer right after this effect's shader is bound — for both the
|
|
325
|
-
* post-effect blit and the single-effect `customShader` sprite path — so the
|
|
326
|
-
* bindings survive the batcher's rotating color-texture pool.
|
|
327
|
-
* @param {object} batcher - the active batcher (owns the GL texture units)
|
|
328
|
-
* @ignore
|
|
329
|
-
*/
|
|
330
|
-
_prepareTextures(batcher: object): void;
|
|
331
|
-
_textureOverflowWarned: boolean | undefined;
|
|
332
235
|
/**
|
|
333
236
|
* Create an independent copy of this effect, compiled as its own GL
|
|
334
237
|
* program. Use it when several renderables need the same effect with
|
|
@@ -355,22 +258,6 @@ export default class ShaderEffect {
|
|
|
355
258
|
* bossFlash.setUniform("uIntensity", 0.9);
|
|
356
259
|
*/
|
|
357
260
|
clone(): ShaderEffect;
|
|
358
|
-
/** @ignore */
|
|
359
|
-
bind(): void;
|
|
360
|
-
/** @ignore */
|
|
361
|
-
getAttribLocation(name: any): number;
|
|
362
|
-
/** @ignore */
|
|
363
|
-
setVertexAttributes(gl: any, attributes: any, stride: any): void;
|
|
364
|
-
/** @ignore */
|
|
365
|
-
get program(): WebGLProgram | null;
|
|
366
|
-
/** @ignore */
|
|
367
|
-
get vertex(): any;
|
|
368
|
-
/** @ignore */
|
|
369
|
-
get fragment(): any;
|
|
370
|
-
/** @ignore */
|
|
371
|
-
get attributes(): {};
|
|
372
|
-
/** @ignore */
|
|
373
|
-
get uniforms(): object;
|
|
374
261
|
/**
|
|
375
262
|
* destroy this shader effect. Idempotent — calling destroy twice
|
|
376
263
|
* is safe. Unsubscribes from the renderer's context-lost / restored
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadereffect.d.ts","sourceRoot":"","sources":["../../../src/video/effects/shadereffect.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6HG;AACH;IAiCC;;;;;;;;;;;OAWG;IACH,sBAXW,aAAa,GAAC,cAAc,GAAC,cAAc,QAC3C,MAAM,GAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,cAQrC,MAAM,
|
|
1
|
+
{"version":3,"file":"shadereffect.d.ts","sourceRoot":"","sources":["../../../src/video/effects/shadereffect.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6HG;AACH;IAiCC;;;;;;;;;;;OAWG;IACH,sBAXW,aAAa,GAAC,cAAc,GAAC,cAAc,QAC3C,MAAM,GAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,cAQrC,MAAM,EAqIhB;IA/KD;;;;;;OAMG;IACH,SAFU,OAAO,CAED;IAEhB;;;;;;;OAOG;IACH,oBAHU,OAAO,CAGC;IAElB;;;;;;;;;;OAUG;IACH,QAHU,OAAO,CAGF;IAed;;;;;;;OAOG;IACH,eAAyB;IAEzB;;;;;;OAMG;IACH;eA5ByB,MAAM;eAAS,MAAM;MA4BrB;IACzB;;;OAGG;IACH,+BAA2B;IAoB3B;;;;;;;OAOG;IACH,0CAA+B;IAQ9B;;;;;;OAMG;IACH,wBAJU,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAIK;IACpD;;;OAGG;IACH,iBAAkC;IAElC;;;OAGG;IACH,8BAKC;IAyBD;;;OAGG;IACH,mDAAkC;IAsBpC;;;;OAIG;IACH,uBAsBC;IAjBA;;;OAGG;IACH,2CAAyC;IAe1C;;;;OAIG;IACH,2BAQC;IAED;;;;OAIG;IACH,iBAHW,MAAM,SACN,MAAM,GAAC,YAAY,QAmB7B;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAbW,MAAM,GACJ,YAAY,CAuCxB;IAED;;;;;;;;;;;;OAYG;IACH,gBAJW,MAAM,QA0BhB;IAbC;;;OAGG;IACH,aAAkB;IAWpB;;;;;;;;;;;;;;OAcG;IACH,6BATW,MAAM,gBACN,MAAM,eACN,MAAM,gBACN,MAAM,MACN,MAAM,MACN,MAAM,QAqDhB;IAED;;;;;;;OAOG;IACH,8DAaC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,iBAnBW,MAAM,SACN,SAAS,GAAC,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,WAAW,WACxE,QAAQ,GAAC,UAAU,GAAC,UAAU,GAAC,WAAW,GACxC,YAAY,CA0GxB;IAED;;;;;;;;;OASG;IACH,0BAJW,MAAM,QAgGhB;IA/DI;;;OAGG;IACH,4CAAkC;IA6DvC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,SATa,YAAY,CAsDxB;IAKD;;;OAGG;IACH,aAIC;IAED;;;OAGG;IACH,qCAIC;IAED;;;OAGG;IACH,iEAIC;IAED;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,kBAEC;IAED;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,qBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;;OAIG;IACH,gBAyCC;CACD;qBA78BoB,sBAAsB;kCAET,uBAAuB;sBAHnC,yBAAyB"}
|
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* normalize the `vecN<f32>` / `matCxR<f32>` spellings onto the short forms
|
|
3
|
-
* used as TYPE_LAYOUT keys
|
|
4
|
-
* @param {string} type - a WGSL type token
|
|
5
|
-
* @returns {string} the canonical spelling
|
|
6
|
-
* @ignore
|
|
7
|
-
*/
|
|
8
|
-
export function normalizeWGSLType(type: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* Compute the uniform-buffer layout for a parsed struct member list.
|
|
11
|
-
* @param {Array<{name: string, type: string}>} members - struct members in declaration order
|
|
12
|
-
* @returns {{map: Map<string, {offset: number, size: number, type: string}>, size: number}|null}
|
|
13
|
-
* the name → placement map and the total (16-byte-rounded) struct size,
|
|
14
|
-
* or `null` when a member type is unsupported
|
|
15
|
-
* @ignore
|
|
16
|
-
*/
|
|
17
|
-
export function computeUniformLayout(members: Array<{
|
|
18
|
-
name: string;
|
|
19
|
-
type: string;
|
|
20
|
-
}>): {
|
|
21
|
-
map: Map<string, {
|
|
22
|
-
offset: number;
|
|
23
|
-
size: number;
|
|
24
|
-
type: string;
|
|
25
|
-
}>;
|
|
26
|
-
size: number;
|
|
27
|
-
} | null;
|
|
1
|
+
|
|
28
2
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/video/effects/wgsl/layout.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/video/effects/wgsl/layout.js"],"names":[],"mappings":"AAuCA;;;;;;;GAOG;AACH,wCALW,MAAM,GACJ,MAAM,CASlB;AAWD;;;;;;;;GAQG;AACH,8CAPW,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC,GACjC;IAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAC,IAAI,CAwB/F"}
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Parse a WGSL effect body's declarations.
|
|
3
|
-
* @param {string} body - the user WGSL body
|
|
4
|
-
* @returns {object} `{ok: true, layout, structSize, uniformVar, textures, builtins, maxUserBinding}`
|
|
5
|
-
* or `{ok: false, error}`
|
|
6
|
-
* @ignore
|
|
7
|
-
*/
|
|
8
|
-
export function parseWGSLBody(body: string): object;
|
|
1
|
+
|
|
9
2
|
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/video/effects/wgsl/parse.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/video/effects/wgsl/parse.js"],"names":[],"mappings":"AAwHA;;;;;;;GAOG;AACH,oCANW,MAAM,GACJ,MAAM,CAsKlB"}
|
|
@@ -1,43 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* WGSL module assembly for a ShaderEffect body — the WGSL counterpart of
|
|
3
|
-
* `glsl_realization.js`'s source templating. The user body is embedded
|
|
4
|
-
* VERBATIM (WGSL module-scope declarations are order-independent); the
|
|
5
|
-
* scaffold contributes the vertex/fragment entry points over the frozen
|
|
6
|
-
* 28-byte quad layout, the frame-globals and material groups, and the
|
|
7
|
-
* builtin declarations the parser detected.
|
|
8
|
-
*
|
|
9
|
-
* Frozen conventions carried over from the core quad shader:
|
|
10
|
-
* - clip-z remap `(z + w) * 0.5` (GL-convention [-w, w] → WebGPU [0, w])
|
|
11
|
-
* - packed-ARGB attribute read as (B,G,R,A) → `.bgr * .a` premultiply
|
|
12
|
-
* - `screen_uv` is y-down (`0.5 - ndc.y * 0.5`): WebGPU texture row 0 is
|
|
13
|
-
* the top, so the capture is sampled without any flip
|
|
14
|
-
* @ignore
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* builtin group-3 bindings are assigned ABOVE the highest user binding so
|
|
18
|
-
* they can never collide: ME uniform first, then the capture texture and
|
|
19
|
-
* its sampler variants
|
|
20
|
-
* @param {object} parsed - the parseWGSLBody result
|
|
21
|
-
* @returns {{me: number, screenTexture: number, screenSamplerClamp: number, screenSamplerRepeat: number}}
|
|
22
|
-
* assigned binding indices (-1 when the builtin is unused)
|
|
23
|
-
* @ignore
|
|
24
|
-
*/
|
|
25
|
-
export function assignBuiltinBindings(parsed: object): {
|
|
26
|
-
me: number;
|
|
27
|
-
screenTexture: number;
|
|
28
|
-
screenSamplerClamp: number;
|
|
29
|
-
screenSamplerRepeat: number;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Assemble the complete WGSL module for an effect body.
|
|
33
|
-
* @param {string} body - the user WGSL body (embedded verbatim)
|
|
34
|
-
* @param {object} parsed - the parseWGSLBody result
|
|
35
|
-
* @returns {{code: string, bindings: object}} the module text and the
|
|
36
|
-
* builtin binding assignment (consumed when building the bind group)
|
|
37
|
-
* @ignore
|
|
38
|
-
*/
|
|
39
|
-
export function buildWGSLModule(body: string, parsed: object): {
|
|
40
|
-
code: string;
|
|
41
|
-
bindings: object;
|
|
42
|
-
};
|
|
1
|
+
|
|
43
2
|
//# sourceMappingURL=scaffold.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../../src/video/effects/wgsl/scaffold.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../../src/video/effects/wgsl/scaffold.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;GASG;AACH,8CANW,MAAM,GACJ;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAA;CAAC,CA2BxG;AAED;;;;;;;;GAQG;AACH,sCAPW,MAAM,UACN,MAAM,GACJ;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,CA0G5C"}
|
|
@@ -1,83 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* The WGSL realization of a ShaderEffect — the WebGPU counterpart of the
|
|
3
|
-
* GLShader the GLSL branch compiles.
|
|
4
|
-
*
|
|
5
|
-
* WebGPU has no uniform reflection, so this object carries everything the
|
|
6
|
-
* backend needs to drive the effect: the parsed uniform layout (name →
|
|
7
|
-
* byte placement), a CPU-side mirror of the uniform block that
|
|
8
|
-
* `setUniform` writes into, the texture binding table, and the assembled
|
|
9
|
-
* module text. GPU objects (shader module, bind group layout, bind group)
|
|
10
|
-
* are built lazily by the renderer's effect path — uniform VALUES are
|
|
11
|
-
* snapshotted from the mirror into a per-frame arena at every bind, so a
|
|
12
|
-
* shared effect bound twice in a frame with different values stays
|
|
13
|
-
* correct under WebGPU's queue-write-before-draws ordering.
|
|
14
|
-
* @ignore
|
|
15
|
-
*/
|
|
16
|
-
export default class WGSLEffectRealization {
|
|
17
|
-
/**
|
|
18
|
-
* Parse + assemble; on any parse failure `valid` is false and `error`
|
|
19
|
-
* carries the reason (the effect then warns and stays disabled).
|
|
20
|
-
* @param {string} body - the user WGSL body
|
|
21
|
-
*/
|
|
22
|
-
constructor(body: string);
|
|
23
|
-
/**
|
|
24
|
-
* whether the body parsed into a realizable shape
|
|
25
|
-
* @type {boolean}
|
|
26
|
-
*/
|
|
27
|
-
valid: boolean;
|
|
28
|
-
/** @type {string|null} */
|
|
29
|
-
error: string | null;
|
|
30
|
-
/** name → {offset, size, type} placement in the uniform block */
|
|
31
|
-
layout: any;
|
|
32
|
-
/** total uniform block byte size (0 = no uniform struct) */
|
|
33
|
-
structSize: any;
|
|
34
|
-
/** user texture/sampler pairs (binding table) */
|
|
35
|
-
textures: any;
|
|
36
|
-
/** builtin usage flags */
|
|
37
|
-
builtins: any;
|
|
38
|
-
/** the complete assembled WGSL module text */
|
|
39
|
-
code: string | undefined;
|
|
40
|
-
/** builtin binding assignment (ME / capture texture / samplers) */
|
|
41
|
-
builtinBindings: object | undefined;
|
|
42
|
-
cpu: ArrayBuffer | undefined;
|
|
43
|
-
f32: Float32Array<ArrayBuffer> | undefined;
|
|
44
|
-
i32: Int32Array<ArrayBuffer> | undefined;
|
|
45
|
-
u32: Uint32Array<ArrayBuffer> | undefined;
|
|
46
|
-
meMirror: Float32Array<ArrayBuffer> | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* last user-set value per uniform name — the clone-replay source
|
|
49
|
-
* (exact values, not mirror read-back)
|
|
50
|
-
* @type {Map<string, number|number[]>}
|
|
51
|
-
*/
|
|
52
|
-
values: Map<string, number | number[]>;
|
|
53
|
-
warned: Set<any> | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* device-scoped GPU state, built lazily by the renderer's effect
|
|
56
|
-
* path and invalidated via the pipeline-cache epoch (device loss)
|
|
57
|
-
* @type {object|null}
|
|
58
|
-
*/
|
|
59
|
-
gpu: object | null;
|
|
60
|
-
/**
|
|
61
|
-
* Write a uniform value into the CPU mirror.
|
|
62
|
-
* @param {string} name - a struct member name of the body's uniform block
|
|
63
|
-
* @param {number|number[]|Float32Array|{val: Float32Array}} value - the value
|
|
64
|
-
* (objects exposing `.val` — Matrix2d/3d, ColorMatrix — are unwrapped)
|
|
65
|
-
* @returns {boolean} true when the name exists and the value was written
|
|
66
|
-
*/
|
|
67
|
-
setUniform(name: string, value: number | number[] | Float32Array | {
|
|
68
|
-
val: Float32Array;
|
|
69
|
-
}): boolean;
|
|
70
|
-
/**
|
|
71
|
-
* whether the uniform block declares the given member (the WGSL
|
|
72
|
-
* counterpart of the GLSL active-uniform check `setTime` relies on)
|
|
73
|
-
* @param {string} name - member name
|
|
74
|
-
* @returns {boolean} true when present
|
|
75
|
-
*/
|
|
76
|
-
hasUniform(name: string): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* drop device-scoped state (device loss / destroy) — the CPU mirror
|
|
79
|
-
* and values survive, so nothing needs replaying on restore
|
|
80
|
-
*/
|
|
81
|
-
releaseGPU(): void;
|
|
82
|
-
}
|
|
1
|
+
|
|
83
2
|
//# sourceMappingURL=wgsl_realization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wgsl_realization.d.ts","sourceRoot":"","sources":["../../../src/video/effects/wgsl_realization.js"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"wgsl_realization.d.ts","sourceRoot":"","sources":["../../../src/video/effects/wgsl_realization.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH;IACC;;;;OAIG;IACH,kBAFW,MAAM,EA2DhB;IAtDA;;;OAGG;IACH,OAFU,OAAO,CAEc;IAC/B,0BAA0B;IAC1B,OADW,MAAM,GAAC,IAAI,CAC+B;IAMrD,iEAAiE;IACjE,YAA2B;IAC3B,4DAA4D;IAC5D,gBAAmC;IACnC,iDAAiD;IACjD,cAA+B;IAC/B,0BAA0B;IAC1B,cAA+B;IAG/B,8CAA8C;IAC9C,yBAAuB;IACvB,mEAAmE;IACnE,oCAAsC;IAGtC,6BAAwD;IACxD,2CAAqC;IACrC,yCAAmC;IACnC,0CAAoC;IAIpC,gDAAmC;IAEnC;;;;OAIG;IACH,QAFU,GAAG,CAAC,MAAM,EAAE,MAAM,GAAC,MAAM,EAAE,CAAC,CAEf;IAIvB,6BAAuB;IAEvB;;;;OAIG;IACH,KAFU,MAAM,GAAC,IAAI,CAEN;IAGhB;;;;;;OAMG;IACH,iBALW,MAAM,SACN,MAAM,GAAC,MAAM,EAAE,GAAC,YAAY,GAAC;QAAC,GAAG,EAAE,YAAY,CAAA;KAAC,GAE9C,OAAO,CAwDnB;IAED;;;;;OAKG;IACH,iBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;OAGG;IACH,mBAEC;CACD"}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* additional import for TypeScript
|
|
3
|
-
* @import Renderer from "../renderer.js";
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Default maximum number of vertices per batch.
|
|
7
|
-
* At 4096 vertices (1024 quads), the vertex buffer is ~80 KB (5 floats × 4 bytes × 4096),
|
|
8
|
-
* which balances draw call reduction with safe buffer upload sizes on mobile tile-based GPUs.
|
|
9
|
-
* Within the Uint16 index limit (65,535) — a deliberate capacity choice
|
|
10
|
-
* (smaller index uploads), not an API constraint.
|
|
11
|
-
* @ignore
|
|
12
|
-
*/
|
|
13
|
-
export const DEFAULT_MAX_VERTICES: 4096;
|
|
1
|
+
|
|
14
2
|
/**
|
|
15
3
|
* Backend-neutral base class for renderer batchers.
|
|
16
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batcher.d.ts","sourceRoot":"","sources":["../../../src/video/gpu/batcher.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"batcher.d.ts","sourceRoot":"","sources":["../../../src/video/gpu/batcher.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,mCAAoC,IAAI,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAMC;;;;;;OAMG;IACH,eAFW,QAAQ,QAQlB;IALA;;;OAGG;IACH,+BAAwB;IAGzB;;OAEG;IACH,aAAS;IAET;;OAEG;IACH,eAAW;IAEX;;OAEG;IACH,cAAU;IAEV;;OAEG;IACH,cAAU;IAEV;;OAEG;IACH,gBAAY;CACZ;;0BA/EwB,gBAAgB"}
|