melonjs 20.3.0 → 20.5.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 +7 -2
- 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/audio/types.d.ts +22 -0
- package/build/audio/types.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts +28 -68
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +110 -82
- 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 +7 -13
- 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 +5 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3697 -563
- package/build/index.js.map +4 -4
- 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 +44 -82
- 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 +20 -63
- package/build/lighting/light3d.d.ts.map +1 -1
- package/build/loader/loader.d.ts +146 -37
- 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 +21 -13
- 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 +27 -60
- 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 +55 -108
- package/build/renderable/instanced_mesh.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +257 -231
- 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 +18 -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 +12 -97
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +32 -21
- 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 +75 -20
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/text/textmetrics.d.ts +2 -0
- package/build/renderable/text/textmetrics.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 +5 -50
- package/build/state/stage.d.ts.map +1 -1
- package/build/state/state.d.ts.map +1 -1
- package/build/system/device.d.ts +1 -13
- 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 +44 -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/mesh_splice.d.ts +2 -0
- package/build/video/effects/mesh_splice.d.ts.map +1 -0
- 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 +12 -241
- 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 +15 -77
- 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 +101 -77
- 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 +7 -51
- 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 +7 -231
- 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 +1 -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 +453 -5
- package/skills/melonjs-3d-assets/SKILL.md +164 -6
- package/skills/melonjs-audio/SKILL.md +38 -0
- package/skills/melonjs-camera-and-drawing/SKILL.md +49 -0
- package/skills/melonjs-effects-and-shaders/SKILL.md +95 -2
- package/skills/melonjs-loading-assets/SKILL.md +127 -2
- package/skills/melonjs-performance/SKILL.md +60 -1
- package/skills/melonjs-physics/SKILL.md +78 -0
- package/skills/melonjs-renderables/SKILL.md +63 -1
- package/skills/melonjs-renderer-backends/SKILL.md +19 -0
- package/skills/melonjs-scenes-and-state/SKILL.md +56 -0
- package/skills/melonjs-tilemaps/SKILL.md +31 -11
- package/skills/melonjs-ui-and-text/SKILL.md +131 -117
|
@@ -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,CAoCvH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh_splice.d.ts","sourceRoot":"","sources":["../../../src/video/effects/mesh_splice.js"],"names":[],"mappings":"AA4EA;;;;;;;;;;;;GAYG;AACH,6CAPW,MAAM,+BAEN,MAAM,GACJ,MAAM,GAAC,IAAI,CAmCvB;AAED;;;;;;GAMG;AACH,yCALW,MAAM,GACJ,OAAO,CAWnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qCANW,MAAM,QACN,MAAM,GACJ,MAAM,GAAC,IAAI,CAgBvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,kCANW,MAAM,SACN,MAAM,GACJ,MAAM,CAWlB"}
|
|
@@ -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"}
|
|
@@ -1,129 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A simplified shader class for applying custom fragment effects to renderables.
|
|
3
|
-
* Only requires a fragment `apply()` function — the vertex shader, uniforms, and
|
|
4
|
-
* texture sampling boilerplate are handled automatically.
|
|
5
|
-
*
|
|
6
|
-
* ## Dual-language bodies
|
|
7
|
-
*
|
|
8
|
-
* An effect body is written in the active renderer's shading language:
|
|
9
|
-
* GLSL on the WebGL renderer, WGSL on the WebGPU renderer. Pass a plain
|
|
10
|
-
* string for a GLSL-only effect (the historical form), or one body per
|
|
11
|
-
* language for an effect that runs on both backends:
|
|
12
|
-
*
|
|
13
|
-
* ```js
|
|
14
|
-
* new ShaderEffect(renderer, { glsl: glslBody, wgsl: wgslBody });
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* The renderer compiles the body matching its
|
|
18
|
-
* {@link Renderer#shaderLanguage}. When no matching body exists — a
|
|
19
|
-
* GLSL-only effect on the WebGPU renderer, any effect on the Canvas
|
|
20
|
-
* renderer — the effect warns once and stays **disabled**
|
|
21
|
-
* (`enabled === false`, every method a safe no-op): the scene renders
|
|
22
|
-
* without the effect, it never breaks.
|
|
23
|
-
*
|
|
24
|
-
* ## The WGSL convention
|
|
25
|
-
*
|
|
26
|
-
* A WGSL body mirrors the GLSL one — declarations plus an apply function,
|
|
27
|
-
* compiled verbatim inside engine boilerplate:
|
|
28
|
-
*
|
|
29
|
-
* - `fn apply(color : vec4f, uv : vec2f) -> vec4f` — required; receives
|
|
30
|
-
* the sampled, tinted pixel and its UV, returns the modified color.
|
|
31
|
-
* - Uniforms are the members of ONE struct bound as
|
|
32
|
-
* `@group(3) @binding(0) var<uniform> fx : MyUniforms;` — member names
|
|
33
|
-
* are the {@link ShaderEffect#setUniform} names, so a dual-language
|
|
34
|
-
* effect uses the same uniform names in both bodies and one
|
|
35
|
-
* `setUniform` call serves both. Supported member types: `f32`, `i32`,
|
|
36
|
-
* `u32`, `vec2f`, `vec3f`, `vec4f`, `mat3x3f`, `mat4x4f`,
|
|
37
|
-
* `array<vec4f, N>`.
|
|
38
|
-
* - Extra {@link ShaderEffect#setTexture} samplers are texture/sampler
|
|
39
|
-
* pairs at explicit consecutive group-3 bindings (from 1):
|
|
40
|
-
* `@group(3) @binding(1) var uNoise : texture_2d<f32>;`
|
|
41
|
-
* `@group(3) @binding(2) var uNoiseSampler : sampler;`
|
|
42
|
-
* - The source texture is available as `uTexture` with `uSampler`
|
|
43
|
-
* (`textureSample(uTexture, uSampler, uv)` — the WGSL spelling of
|
|
44
|
-
* GLSL's `texture2D(uSampler, uv)`), and the interpolated tint as
|
|
45
|
-
* `vColor`, under the same names as the GLSL side.
|
|
46
|
-
* - The shader builtins keep their names: `screen_uv`, `noise_uv`, and
|
|
47
|
-
* `screen_texture` — sampled through `screen_sampler` (clamped) or
|
|
48
|
-
* `screen_sampler_repeat` (wrapping), replacing the GLSL
|
|
49
|
-
* `: screen_texture(repeat)` annotation.
|
|
50
|
-
* - Porting note: a texture sampled after a non-uniform `return` or
|
|
51
|
-
* inside a varying branch must use
|
|
52
|
-
* `textureSampleLevel(uTexture, uSampler, uv, 0.0)` (a WGSL
|
|
53
|
-
* uniform-control-flow rule; identical output for sprite textures).
|
|
54
|
-
*
|
|
55
|
-
* ## Directional UV arithmetic (`uUVYDir`)
|
|
56
|
-
*
|
|
57
|
-
* The vertical orientation of `apply()`'s UV space depends on the draw
|
|
58
|
-
* path: sampling the sprite directly, `uv.y` grows downward, but the
|
|
59
|
-
* WebGL multi-effect (pooled) path composites through capture FBOs whose
|
|
60
|
-
* rows are bottom-up — there `uv.y` grows upward. A body that offsets its
|
|
61
|
-
* sampling coordinate vertically (a drop shadow, a directional smear)
|
|
62
|
-
* would render mirrored on that path. Declare a `float uUVYDir` uniform
|
|
63
|
-
* (WGSL: `uUVYDir : f32` in the uniform struct) and multiply vertical UV
|
|
64
|
-
* offsets by it: the renderer feeds `+1` where `uv.y` grows downward —
|
|
65
|
-
* including every WebGPU path — and `-1` on the WebGL pooled path, so
|
|
66
|
-
* "down" stays down everywhere. Initialize it to `1.0` with `setUniform`;
|
|
67
|
-
* bodies that don't declare it are unaffected. The built-in
|
|
68
|
-
* {@link DropShadowEffect} is the reference use.
|
|
69
|
-
* @category Rendering
|
|
70
|
-
* @example
|
|
71
|
-
* // one effect, both backends: dual-language body
|
|
72
|
-
* const fx = new ShaderEffect(renderer, {
|
|
73
|
-
* glsl: `
|
|
74
|
-
* uniform float uStrength;
|
|
75
|
-
* vec4 apply(vec4 color, vec2 uv) {
|
|
76
|
-
* return vec4(color.rgb * uStrength, color.a);
|
|
77
|
-
* }
|
|
78
|
-
* `,
|
|
79
|
-
* wgsl: `
|
|
80
|
-
* struct Fx { uStrength : f32, };
|
|
81
|
-
* @group(3) @binding(0) var<uniform> fx : Fx;
|
|
82
|
-
* fn apply(color : vec4f, uv : vec2f) -> vec4f {
|
|
83
|
-
* return vec4f(color.rgb * fx.uStrength, color.a);
|
|
84
|
-
* }
|
|
85
|
-
* `,
|
|
86
|
-
* });
|
|
87
|
-
* mySprite.addPostEffect(fx);
|
|
88
|
-
* fx.setUniform("uStrength", 0.5); // sets either backend
|
|
89
|
-
* @example
|
|
90
|
-
* // create a grayscale effect
|
|
91
|
-
* mySprite.addPostEffect(new ShaderEffect(renderer, `
|
|
92
|
-
* vec4 apply(vec4 color, vec2 uv) {
|
|
93
|
-
* float gray = dot(color.rgb, vec3(0.299, 0.587, 0.114));
|
|
94
|
-
* return vec4(vec3(gray), color.a);
|
|
95
|
-
* }
|
|
96
|
-
* `));
|
|
97
|
-
* @example
|
|
98
|
-
* // create an effect with a custom uniform
|
|
99
|
-
* const pulse = new ShaderEffect(renderer, `
|
|
100
|
-
* uniform float uTime;
|
|
101
|
-
* vec4 apply(vec4 color, vec2 uv) {
|
|
102
|
-
* float brightness = 0.8 + 0.2 * sin(uTime * 3.0);
|
|
103
|
-
* return vec4(color.rgb * brightness, color.a);
|
|
104
|
-
* }
|
|
105
|
-
* `);
|
|
106
|
-
* mySprite.addPostEffect(pulse);
|
|
107
|
-
* // update the uniform each frame
|
|
108
|
-
* pulse.setUniform("uTime", time);
|
|
109
|
-
* @example
|
|
110
|
-
* // Shader builtins — no JS plumbing, no UV math:
|
|
111
|
-
* // `: screen_texture` keeps the sampler filled with everything drawn so
|
|
112
|
-
* // far (a back-buffer copy; one screen copy per draw of the effect),
|
|
113
|
-
* // `screen_uv` is this fragment's 0..1 screen position, and `noise_uv`
|
|
114
|
-
* // runs 0..1 across the sprite regardless of its atlas frame.
|
|
115
|
-
* const water = new ShaderEffect(renderer, `
|
|
116
|
-
* uniform sampler2D uNoise;
|
|
117
|
-
* uniform sampler2D screenTex : screen_texture;
|
|
118
|
-
* uniform float uTime;
|
|
119
|
-
* vec4 apply(vec4 color, vec2 uv) {
|
|
120
|
-
* vec2 flow = texture2D(uNoise, noise_uv + uTime * 0.25).rg;
|
|
121
|
-
* vec4 refracted = texture2D(screenTex, screen_uv + flow * 0.005);
|
|
122
|
-
* return refracted * texture2D(uSampler, uv + flow * 0.005);
|
|
123
|
-
* }
|
|
124
|
-
* `);
|
|
125
|
-
* water.setTexture("uNoise", noiseTexture.getTexture(), "repeat");
|
|
126
|
-
*/
|
|
127
1
|
export default class ShaderEffect {
|
|
128
2
|
/**
|
|
129
3
|
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
@@ -170,61 +44,22 @@ export default class ShaderEffect {
|
|
|
170
44
|
* @default false
|
|
171
45
|
*/
|
|
172
46
|
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
47
|
/**
|
|
223
48
|
* Set the uniform to the given value
|
|
224
49
|
* @param {string} name - the uniform name
|
|
225
|
-
* @param {
|
|
50
|
+
* @param {number|boolean|number[]|Float32Array|object} value - the value to assign to that
|
|
51
|
+
* uniform. Scalars (`float`, `int`, `bool`) take a number or a boolean;
|
|
52
|
+
* vectors and matrices take an array, a `Float32Array`, or any object
|
|
53
|
+
* exposing `toArray()` — which is every {@link Vector2d},
|
|
54
|
+
* {@link Vector3d}, {@link Color} and {@link Matrix3d}.
|
|
55
|
+
* @example
|
|
56
|
+
* // a scalar the body declares as `uniform float uStrength;`
|
|
57
|
+
* fx.setUniform("uStrength", 0.5);
|
|
58
|
+
* // a vec3 — an array, or anything with toArray()
|
|
59
|
+
* fx.setUniform("uTint", [1.0, 0.82, 0.55]);
|
|
60
|
+
* fx.setUniform("uOrigin", new me.Vector2d(0.5, 0.5));
|
|
226
61
|
*/
|
|
227
|
-
setUniform(name: string, value:
|
|
62
|
+
setUniform(name: string, value: number | boolean | number[] | Float32Array | object): void;
|
|
228
63
|
/**
|
|
229
64
|
* Set the shader's `uTime` uniform (elapsed time, in seconds). A convenience
|
|
230
65
|
* over `setUniform("uTime", ...)`; call it once per frame from your update
|
|
@@ -249,43 +84,6 @@ export default class ShaderEffect {
|
|
|
249
84
|
* flow.setTime(me.timer.getTime() / 1000);
|
|
250
85
|
*/
|
|
251
86
|
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
87
|
/**
|
|
290
88
|
* Bind an **extra** texture to a named `sampler2D` uniform in this shader, so
|
|
291
89
|
* a custom effect can read a *second* texture — a noise map, mask, gradient,
|
|
@@ -318,17 +116,6 @@ export default class ShaderEffect {
|
|
|
318
116
|
* water.setTime(me.timer.getTime() / 1000);
|
|
319
117
|
*/
|
|
320
118
|
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
119
|
/**
|
|
333
120
|
* Create an independent copy of this effect, compiled as its own GL
|
|
334
121
|
* program. Use it when several renderables need the same effect with
|
|
@@ -355,22 +142,6 @@ export default class ShaderEffect {
|
|
|
355
142
|
* bossFlash.setUniform("uIntensity", 0.9);
|
|
356
143
|
*/
|
|
357
144
|
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
145
|
/**
|
|
375
146
|
* destroy this shader effect. Idempotent — calling destroy twice
|
|
376
147
|
* 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":"
|
|
1
|
+
{"version":3,"file":"shadereffect.d.ts","sourceRoot":"","sources":["../../../src/video/effects/shadereffect.js"],"names":[],"mappings":"AAiJA;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,EAiKhB;IA3MD;;;;;;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;IAE/B;;;;;OAKG;IACH,0CAA+B;IAE/B;;;;OAIG;IACH,8BAAgC;IAQ/B;;;;;;OAMG;IACH,wBAJU,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAIK;IACpD;;;OAGG;IACH,iBAAkC;IAClC;;;;;;OAMG;IACH,eAA6B;IAC7B;;;OAGG;IACH,mBAAqC;IAErC;;;OAGG;IACH,8BAKC;IAyBD;;;OAGG;IACH,mDAAkC;IAsBpC;;;;OAIG;IACH,uBAsBC;IAjBA;;;OAGG;IACH,2CAAyC;IAe1C;;;;OAIG;IACH,2BAQC;IAED;;;;;;;;;;;;;;OAcG;IACH,iBAbW,MAAM,SACN,MAAM,GAAC,OAAO,GAAC,MAAM,EAAE,GAAC,YAAY,GAAC,MAAM,QAsCrD;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAbW,MAAM,GACJ,YAAY,CAoDxB;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;qBAjhCoB,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"}
|