@luma.gl/engine 9.0.0-beta.3 → 9.0.0-beta.4
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/dist/dist.dev.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/lib/clip-space.d.ts +1 -1
- package/dist/lib/clip-space.d.ts.map +1 -1
- package/dist/lib/clip-space.js +1 -0
- package/dist/lib/clip-space.js.map +1 -1
- package/dist.min.js +3 -1
- package/package.json +5 -5
- package/src/lib/clip-space.ts +2 -1
package/dist/dist.dev.js
CHANGED
package/dist/index.cjs
CHANGED
package/dist/lib/clip-space.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ import { Model, ModelProps } from '../model/model';
|
|
|
4
4
|
* A flat geometry that covers the "visible area" that the GPU renders.
|
|
5
5
|
*/
|
|
6
6
|
export declare class ClipSpace extends Model {
|
|
7
|
-
constructor(device: Device, opts
|
|
7
|
+
constructor(device: Device, opts: Omit<ModelProps, 'vs' | 'vertexCount' | 'geometry'>);
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=clip-space.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clip-space.d.ts","sourceRoot":"","sources":["../../src/lib/clip-space.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,MAAM,EAAO,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,KAAK,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"clip-space.d.ts","sourceRoot":"","sources":["../../src/lib/clip-space.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,MAAM,EAAO,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,KAAK,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAwBjD;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBACtB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,aAAa,GAAG,UAAU,CAAC;CAqBtF"}
|
package/dist/lib/clip-space.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clip-space.js","names":["glsl","Model","Geometry","CLIPSPACE_VERTEX_SHADER","POSITIONS","ClipSpace","constructor","device","opts","TEX_COORDS","map","coord","vs","vertexCount","geometry","topology","attributes","aClipSpacePosition","size","value","Float32Array","aTexCoord","aCoordinate"],"sources":["../../src/lib/clip-space.ts"],"sourcesContent":["\n// ClipSpace\nimport {Device, glsl} from '@luma.gl/core';\nimport {Model, ModelProps} from '../model/model';\nimport {Geometry} from '../geometry/geometry';\n\nconst CLIPSPACE_VERTEX_SHADER = glsl`\\\nin vec2 aClipSpacePosition;\nin vec2 aTexCoord;\nin vec2 aCoordinate;\n\nout vec2 position;\nout vec2 coordinate;\nout vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n`;\n\n/* eslint-disable indent, no-multi-spaces */\nconst POSITIONS = [-1, -1, 1, -1, -1, 1, 1, 1];\n\n/**\n * A flat geometry that covers the \"visible area\" that the GPU renders.\n */\nexport class ClipSpace extends Model {\n constructor(device: Device, opts
|
|
1
|
+
{"version":3,"file":"clip-space.js","names":["glsl","Model","Geometry","CLIPSPACE_VERTEX_SHADER","POSITIONS","ClipSpace","constructor","device","opts","TEX_COORDS","map","coord","vs","vertexCount","geometry","topology","attributes","aClipSpacePosition","size","value","Float32Array","aTexCoord","aCoordinate"],"sources":["../../src/lib/clip-space.ts"],"sourcesContent":["\n// ClipSpace\nimport {Device, glsl} from '@luma.gl/core';\nimport {Model, ModelProps} from '../model/model';\nimport {Geometry} from '../geometry/geometry';\n\nconst CLIPSPACE_VERTEX_SHADER = glsl`\\\n#version 300 es\nin vec2 aClipSpacePosition;\nin vec2 aTexCoord;\nin vec2 aCoordinate;\n\nout vec2 position;\nout vec2 coordinate;\nout vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n`;\n\n/* eslint-disable indent, no-multi-spaces */\nconst POSITIONS = [-1, -1, 1, -1, -1, 1, 1, 1];\n\n/**\n * A flat geometry that covers the \"visible area\" that the GPU renders.\n */\nexport class ClipSpace extends Model {\n constructor(device: Device, opts: Omit<ModelProps, 'vs' | 'vertexCount' | 'geometry'>) {\n const TEX_COORDS = POSITIONS.map((coord) => (coord === -1 ? 0 : coord));\n\n super(\n device,\n {\n ...opts,\n vs: CLIPSPACE_VERTEX_SHADER,\n vertexCount: 4,\n geometry: new Geometry({\n topology: 'triangle-strip',\n vertexCount: 4,\n attributes: {\n aClipSpacePosition: {size: 2, value: new Float32Array(POSITIONS)},\n aTexCoord: {size: 2, value: new Float32Array(TEX_COORDS)},\n aCoordinate: {size: 2, value: new Float32Array(TEX_COORDS)}\n }\n })\n }\n );\n }\n}\n"],"mappings":"AAEA,SAAgBA,IAAI,QAAO,eAAe;AAAC,SACnCC,KAAK;AAAA,SACLC,QAAQ;AAEhB,MAAMC,uBAAuB,GAAGH,IAAK;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAGD,MAAMI,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAK9C,OAAO,MAAMC,SAAS,SAASJ,KAAK,CAAC;EACnCK,WAAWA,CAACC,MAAc,EAAEC,IAAyD,EAAE;IACrF,MAAMC,UAAU,GAAGL,SAAS,CAACM,GAAG,CAAEC,KAAK,IAAMA,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,GAAGA,KAAM,CAAC;IAEvE,KAAK,CACHJ,MAAM,EACN;MACE,GAAGC,IAAI;MACPI,EAAE,EAAET,uBAAuB;MAC3BU,WAAW,EAAE,CAAC;MACdC,QAAQ,EAAE,IAAIZ,QAAQ,CAAC;QACrBa,QAAQ,EAAE,gBAAgB;QAC1BF,WAAW,EAAE,CAAC;QACdG,UAAU,EAAE;UACVC,kBAAkB,EAAE;YAACC,IAAI,EAAE,CAAC;YAAEC,KAAK,EAAE,IAAIC,YAAY,CAAChB,SAAS;UAAC,CAAC;UACjEiB,SAAS,EAAE;YAACH,IAAI,EAAE,CAAC;YAAEC,KAAK,EAAE,IAAIC,YAAY,CAACX,UAAU;UAAC,CAAC;UACzDa,WAAW,EAAE;YAACJ,IAAI,EAAE,CAAC;YAAEC,KAAK,EAAE,IAAIC,YAAY,CAACX,UAAU;UAAC;QAC5D;MACF,CAAC;IACH,CACF,CAAC;EACH;AACF"}
|
package/dist.min.js
CHANGED
|
@@ -256,7 +256,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
256
256
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sm(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Om(t){if(Array.isArray(t))return Gn(t)}function Qs(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=zn(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
257
257
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(t)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function tr(t,e){return Am(t)||Em(t,e)||zn(t,e)||Pm()}function Pm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
258
258
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zn(t,e){if(t){if(typeof t=="string")return Gn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gn(t,e)}}function Gn(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Em(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,u=[],s=!0,f=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(p){f=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(f)throw i}}return u}}function Am(t){if(Array.isArray(t))return t}function Xs(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ot(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xs(Object(r),!0).forEach(function(n){Tm(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xs(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Tm(t,e,r){return e=tu(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tu(n.key),n)}}function km(t,e,r){return e&&$s(t.prototype,e),r&&$s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function tu(t){var e=Mm(t,"string");return er(e)==="symbol"?e:String(e)}function Mm(t,e){if(er(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(er(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Im(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var le=2,Rm=1e4,bt=function(){function t(r,n){var i,o,a;Im(this,t),this.device=void 0,this.id=void 0,this.vs=void 0,this.fs=void 0,this.pipelineFactory=void 0,this.userData={},this.parameters=void 0,this.topology=void 0,this.bufferLayout=void 0,this.vertexCount=void 0,this.instanceCount=0,this.indexBuffer=null,this.bufferAttributes={},this.constantAttributes={},this.bindings={},this.uniforms={},this.vertexArray=void 0,this.transformFeedback=null,this.pipeline=void 0,this.shaderInputs=void 0,this._uniformStore=void 0,this._pipelineNeedsUpdate="newly created",this._attributeInfos={},this._gpuGeometry=null,this._getModuleUniforms=void 0,this.props=void 0,this._lastLogTime=0,this._logOpen=!1,this._drawCount=0,this.props=Ot(Ot({},t.defaultProps),n),n=this.props,this.id=n.id||X("model"),this.device=r,Object.assign(this.userData,n.userData);var u=Object.fromEntries(((i=this.props.modules)===null||i===void 0?void 0:i.map(function(P){return[P.name,P]}))||[]);this.setShaderInputs(n.shaderInputs||new Cr(u));var s=this.device.info.type==="webgpu";if(this.props.source){if(s){var f;(f=this.props).shaderLayout||(f.shaderLayout=Tr(this.props.source))}this.props.fs=this.props.source,this.props.vs=this.props.source}if(s&&typeof this.props.vs!="string"){var p;(p=this.props).shaderLayout||(p.shaderLayout=Tr(this.props.vs.wgsl))}var d=Lm(r),g=(((o=this.props.modules)===null||o===void 0?void 0:o.length)>0?this.props.modules:(a=this.shaderInputs)===null||a===void 0?void 0:a.getModules())||[],S=this.props.shaderAssembler.assembleShaders(Ot(Ot({platformInfo:d},this.props),{},{modules:g})),x=S.vs,O=S.fs,A=S.getUniforms;if(this.vs=x,this.fs=O,this._getModuleUniforms=A,this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,n.geometry&&(this._gpuGeometry=this.setGeometry(n.geometry)),this.pipelineFactory=n.pipelineFactory||Je.getDefaultPipelineFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=r.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),n.vertexCount&&this.setVertexCount(n.vertexCount),n.instanceCount&&this.setInstanceCount(n.instanceCount),n.indices)throw new Error("Model.props.indices removed. Use props.indexBuffer");n.indexBuffer&&this.setIndexBuffer(n.indexBuffer),n.attributes&&this.setAttributes(n.attributes),n.constantAttributes&&this.setConstantAttributes(n.constantAttributes),n.bindings&&this.setBindings(n.bindings),n.uniforms&&this.setUniforms(n.uniforms),n.moduleSettings&&(Y.warn("Model.props.moduleSettings is deprecated. Use Model.shaderInputs.setProps()")(),this.updateModuleSettings(n.moduleSettings)),n.transformFeedback&&(this.transformFeedback=n.transformFeedback),Object.seal(this)}var e=t.prototype;return e.destroy=function(){this.pipelineFactory.release(this.pipeline),this._uniformStore.destroy()},e.predraw=function(){this.updateShaderInputs()},e.draw=function(n){this.predraw();try{this._logDrawCallStart(),this.pipeline=this._updatePipeline(),this.pipeline.setBindings(this.bindings),this.pipeline.setUniforms(this.uniforms);var i=this.vertexArray.indexBuffer,o=i?i.byteLength/(i.indexType==="uint32"?4:2):void 0;this.pipeline.draw({renderPass:n,vertexArray:this.vertexArray,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:o,transformFeedback:this.transformFeedback})}finally{this._logDrawCallEnd()}this._logFramebuffer(n)},e.setGeometry=function(n){var i=n&&zs(this.device,n);return this.setTopology(i.topology||"triangle-list"),this.bufferLayout=Zs(i.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(i),i},e._setGeometryAttributes=function(n){for(var i=this,o=Ot({},n.attributes),a=function(){var p=tr(s[u],1),d=p[0];!i.pipeline.shaderLayout.attributes.find(function(g){return g.name===d})&&d!=="positions"&&delete o[d]},u=0,s=Object.entries(o);u<s.length;u++)a();this.vertexCount=n.vertexCount,this.setIndexBuffer(n.indices),this.setAttributes(n.attributes,"ignore-unknown"),this.setAttributes(o)},e.setTopology=function(n){n!==this.topology&&(this.topology=n,this._setPipelineNeedsUpdate("topology"))},e.setBufferLayout=function(n){this.bufferLayout=this._gpuGeometry?Zs(n,this._gpuGeometry.bufferLayout):n,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)},e.setParameters=function(n){Ne(n,this.parameters,2)||(this.parameters=n,this._setPipelineNeedsUpdate("parameters"))},e.setVertexCount=function(n){this.vertexCount=n},e.setInstanceCount=function(n){this.instanceCount=n},e.setShaderInputs=function(n){this.shaderInputs=n,this._uniformStore=new mn(this.shaderInputs.modules);for(var i=0,o=Object.keys(this.shaderInputs.modules);i<o.length;i++){var a=o[i],u=this._uniformStore.getManagedUniformBuffer(this.device,a);this.bindings["".concat(a,"Uniforms")]=u}},e.setShaderModuleProps=function(n){var i=this._getModuleUniforms(n),o=Object.keys(i).filter(function(p){var d=i[p];return!mt(d)&&typeof d!="number"&&typeof d!="boolean"}),a={},u=Qs(o),s;try{for(u.s();!(s=u.n()).done;){var f=s.value;a[f]=i[f],delete i[f]}}catch(p){u.e(p)}finally{u.f()}},e.updateShaderInputs=function(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues())},e.updateModuleSettings=function(n){Y.warn("Model.updateModuleSettings is deprecated. Use Model.shaderInputs.setProps()")();var i=vn(this._getModuleUniforms(n)),o=i.bindings,a=i.uniforms;Object.assign(this.bindings,o),Object.assign(this.uniforms,a)},e.setBindings=function(n){Object.assign(this.bindings,n)},e.setUniforms=function(n){this.pipeline.setUniforms(n),Object.assign(this.uniforms,n)},e.setIndexBuffer=function(n){this.vertexArray.setIndexBuffer(n)},e.setTransformFeedback=function(n){this.transformFeedback=n},e.setAttributes=function(n,i){var o=this;n.indices&&Y.warn("Model:".concat(this.id," setAttributes() - indexBuffer should be set using setIndexBuffer()"))();for(var a=function(){var d=tr(s[u],2),g=d[0],S=d[1],x=o.bufferLayout.find(function(I){return Js(I).includes(g)});if(!x)return Y.warn("Model(".concat(o.id,'): Missing layout for buffer "').concat(g,'".'))(),"continue";for(var O=Js(x),A=!1,P=0,M=O;P<M.length;P++){var k=M[P],L=o._attributeInfos[k];L&&(o.vertexArray.setBuffer(L.location,S),A=!0)}!A&&i!=="ignore-unknown"&&Y.warn("Model(".concat(o.id,'): Ignoring buffer "').concat(S.id,'" for unknown attribute "').concat(g,'"'))()},u=0,s=Object.entries(n);u<s.length;u++)var f=a()},e.setConstantAttributes=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=tr(o[i],2),u=a[0],s=a[1],f=this._attributeInfos[u];f?this.vertexArray.setConstant(f.location,s):Y.warn('Model "'.concat(this.id,': Ignoring constant supplied for unknown attribute "').concat(u,'"'))()}},e._setPipelineNeedsUpdate=function(n){this._pipelineNeedsUpdate=this._pipelineNeedsUpdate||n},e._updatePipeline=function(){if(this._pipelineNeedsUpdate){this.pipeline&&Y.log(1,"Model ".concat(this.id,': Recreating pipeline because "').concat(this._pipelineNeedsUpdate,'".'))(),this._pipelineNeedsUpdate=!1;var n=this.device.createShader({id:"".concat(this.id,"-vertex"),stage:"vertex",source:this.vs}),i=this.fs?this.device.createShader({id:"".concat(this.id,"-fragment"),stage:"fragment",source:this.fs}):null;this.pipeline=this.device.createRenderPipeline(Ot(Ot({},this.props),{},{bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,vs:n,fs:i})),this._attributeInfos=pn(this.pipeline.shaderLayout,this.bufferLayout)}return this.pipeline},e._logDrawCallStart=function(){var n=Y.level>3?0:Rm;Y.level<2||Date.now()-this._lastLogTime<n||(this._lastLogTime=Date.now(),this._logOpen=!0,Y.group(le,">>> DRAWING MODEL ".concat(this.id),{collapsed:Y.level<=2})())},e._logDrawCallEnd=function(){if(this._logOpen){var n=Ks(this.pipeline.shaderLayout,this.id);Y.table(le,n)();for(var i=this.shaderInputs.getDebugTable(),o=0,a=Object.entries(this.uniforms);o<a.length;o++){var u=tr(a[o],2),s=u[0],f=u[1];i[s]={value:f}}Y.table(le,i)();var p=this._getAttributeDebugTable();Y.table(le,this._attributeInfos)(),Y.table(le,p)(),Y.groupEnd(le)(),this._logOpen=!1}},e._logFramebuffer=function(n){var i=Y.get("framebuffer");if(this._drawCount++,!(!i||this._drawCount++>3&&this._drawCount%60)){var o=n.props.framebuffer;o&&Ys(o,{id:o.id,minimap:!0})}},e._getAttributeDebugTable=function(){for(var n={},i=0,o=Object.entries(this._attributeInfos);i<o.length;i++){var a=tr(o[i],2),u=a[0],s=a[1];n[s.location]={name:u,type:s.shaderType,values:this._getBufferOrConstantValues(this.vertexArray.attributes[s.location],s.bufferDataType)}}if(this.vertexArray.indexBuffer){var f=this.vertexArray.indexBuffer,p=f.indexType==="uint32"?new Uint32Array(f.debugData):new Uint16Array(f.debugData);n.indices={name:"indices",type:f.indexType,values:p.toString()}}return n},e._getBufferOrConstantValues=function(n,i){var o=dn(i),a=n instanceof $?new o(n.debugData):n;return a.toString()},km(t)}();bt.defaultProps=Ot(Ot({},te.defaultProps),{},{source:null,vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],shaderInputs:void 0,pipelineFactory:void 0,transformFeedback:void 0,shaderAssembler:xr.getDefaultShaderAssembler()});function Zs(t,e){var r=wm(t),n=Qs(e),i;try{var o=function(){var u=i.value,s=r.findIndex(function(f){return f.name===u.name});s<0?r.push(u):r[s]=u};for(n.s();!(i=n.n()).done;)o()}catch(a){n.e(a)}finally{n.f()}return r}function Lm(t){return{type:t.info.type,shaderLanguage:t.info.shadingLanguage,shaderLanguageVersion:t.info.shadingLanguageVersion,gpu:t.info.gpu,features:t.features}}function Js(t){var e;return t.attributes?(e=t.attributes)===null||e===void 0?void 0:e.map(function(r){return r.attribute}):[t.name]}function rr(t){return rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rr(t)}function eu(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function jm(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?eu(Object(r),!0).forEach(function(n){Nm(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):eu(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Nm(t,e,r){return e=nu(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ru(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nu(n.key),n)}}function Dm(t,e,r){return e&&ru(t.prototype,e),r&&ru(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function nu(t){var e=Cm(t,"string");return rr(e)==="symbol"?e:String(e)}function Cm(t,e){if(rr(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(rr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var iu=function(){t.isSupported=function(n){return n.features.has("transform-feedback-webgl2")};function t(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bt.defaultProps;Fm(this,t),this.device=void 0,this.model=void 0,this.transformFeedback=void 0,et(r.features.has("transform-feedback-webgl2"),"Device must support transform feedback"),this.device=r,this.model=new bt(this.device,jm({id:n.id||"buffer-transform-model",fs:n.fs||qe({version:300}),topology:n.topology||"point-list"},n)),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:n.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}var e=t.prototype;return e.destroy=function(){this.model&&this.model.destroy()},e.delete=function(){this.destroy()},e.run=function(n){var i=this.device.beginRenderPass(n);this.model.draw(i),i.end()},e.update=function(){console.warn("TextureTransform#update() not implemented")},e.getBuffer=function(n){return this.transformFeedback.getBuffer(n)},e.readAsync=function(n){var i=this.getBuffer(n);if(i instanceof $)return i.readAsync();var o=i.buffer,a=i.byteOffset,u=a===void 0?0:a,s=i.byteLength,f=s===void 0?o.byteLength:s;return o.readAsync(u,f)},Dm(t)}();function nr(t){return nr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nr(t)}function ou(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function au(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ou(Object(r),!0).forEach(function(n){Um(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ou(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Um(t,e,r){return e=uu(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function su(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,uu(n.key),n)}}function Gm(t,e,r){return e&&su(t.prototype,e),r&&su(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function uu(t){var e=zm(t,"string");return nr(e)==="symbol"?e:String(e)}function zm(t,e){if(nr(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(nr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Bm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Vm="transform_output",fu=function(){function t(r,n){Bm(this,t),this.device=void 0,this.model=void 0,this.sampler=void 0,this.currentIndex=0,this.samplerTextureMap=null,this.bindings=[],this.resources={},this.device=r,this.sampler=r.createSampler({addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"nearest",magFilter:"nearest",mipmapFilter:"nearest"}),this.model=new bt(this.device,au({id:n.id||"texture-transform-model",fs:n.fs||qe({version:300,input:n.targetTextureVarying,inputChannels:n.targetTextureChannels,output:Vm}),vertexCount:n.vertexCount},n)),this._initialize(n),Object.seal(this)}var e=t.prototype;return e.destroy=function(){},e.delete=function(){this.destroy()},e.run=function(n){var i=this.bindings[this.currentIndex].framebuffer,o=this.device.beginRenderPass(au({framebuffer:i},n));this.model.draw(o),o.end()},e.update=function(){console.warn("TextureTransform#update() not implemented")},e.getData=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.packed,o=i===void 0?!1:i;throw new Error("getData() not implemented")},e.getTargetTexture=function(){var n=this.bindings[this.currentIndex].targetTexture;return n},e.getFramebuffer=function(){var n=this.bindings[this.currentIndex];return n.framebuffer},e._initialize=function(n){this._updateBindings(n)},e._updateBindings=function(n){this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],n)},e._updateBinding=function(n,i){var o=i.sourceBuffers,a=i.sourceTextures,u=i.targetTexture;if(n||(n={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(n.sourceTextures,a),Object.assign(n.sourceBuffers,o),u){n.targetTexture=u;var s=u.width,f=u.height;n.framebuffer&&n.framebuffer.destroy(),n.framebuffer=this.device.createFramebuffer({id:"transform-framebuffer",width:s,height:f,colorAttachments:[u]}),n.framebuffer.resize({width:s,height:f})}return n},e._setSourceTextureParameters=function(){var n=this.currentIndex,i=this.bindings[n].sourceTextures;for(var o in i)i[o].sampler=this.sampler},Gm(t)}();function ir(t){return ir=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ir(t)}function cu(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function qm(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?cu(Object(r),!0).forEach(function(n){Wm(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cu(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Wm(t,e,r){return e=pu(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hm(t,e){return $m(t)||Xm(t,e)||Ym(t,e)||Km()}function Km(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
259
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ym(t,e){if(t){if(typeof t=="string")return lu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lu(t,e)}}function lu(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Xm(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,u=[],s=!0,f=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(p){f=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(f)throw i}}return u}}function $m(t){if(Array.isArray(t))return t}function hu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pu(n.key),n)}}function Zm(t,e,r){return e&&hu(t.prototype,e),r&&hu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function pu(t){var e=Jm(t,"string");return ir(e)==="symbol"?e:String(e)}function Jm(t,e){if(ir(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ir(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var ut=function(){function t(r){Qm(this,t),this.id=void 0,this.topology=void 0,this.vertexCount=void 0,this.indices=void 0,this.attributes=void 0,this.userData={};var n=r.attributes,i=n===void 0?{}:n,o=r.indices,a=o===void 0?null:o,u=r.vertexCount,s=u===void 0?null:u;this.id=r.id||X("geometry"),this.topology=r.topology,a&&(this.indices=ArrayBuffer.isView(a)?{value:a,size:1}:a),this.attributes={};for(var f=0,p=Object.entries(i);f<p.length;f++){var d=Hm(p[f],2),g=d[0],S=d[1],x=ArrayBuffer.isView(S)?{value:S}:S;et(ArrayBuffer.isView(x.value),"".concat(this._print(g),": must be typed array or object with value as typed array")),(g==="POSITION"||g==="positions")&&!x.size&&(x.size=3),g==="indices"?(et(!this.indices),this.indices=x):this.attributes[g]=x}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=s||this._calculateVertexCount(this.attributes,this.indices)}var e=t.prototype;return e.getVertexCount=function(){return this.vertexCount},e.getAttributes=function(){return this.indices?qm({indices:this.indices},this.attributes):this.attributes},e._print=function(n){return"Geometry ".concat(this.id," attribute ").concat(n)},e._setAttributes=function(n,i){return this},e._calculateVertexCount=function(n,i){if(i)return i.value.length;for(var o=1/0,a=0,u=Object.values(n);a<u.length;a++){var s=u[a],f=s.value,p=s.size,d=s.constant;!d&&f&&p>=1&&(o=Math.min(o,f.length/p))}return et(Number.isFinite(o)),o},Zm(t)}();function he(t){return he=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(t)}var mu;function du(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?du(Object(r),!0).forEach(function(n){td(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):du(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function td(t,e,r){return e=_u(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_u(n.key),n)}}function ed(t,e,r){return e&&vu(t.prototype,e),r&&vu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _u(t){var e=rd(t,"string");return he(e)==="symbol"?e:String(e)}function rd(t,e){if(he(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(he(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function id(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bn(t,e)}function Bn(t,e){return Bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Bn(t,e)}function od(t){var e=ud();return function(){var n=Ur(t),i;if(e){var o=Ur(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ad(this,i)}}function ad(t,e){if(e&&(he(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sd(t)}function sd(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ud(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ur(t){return Ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ur(t)}function fd(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var cd=go(mu||(mu=fd([
|
|
259
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ym(t,e){if(t){if(typeof t=="string")return lu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lu(t,e)}}function lu(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Xm(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,u=[],s=!0,f=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(p){f=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(f)throw i}}return u}}function $m(t){if(Array.isArray(t))return t}function hu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pu(n.key),n)}}function Zm(t,e,r){return e&&hu(t.prototype,e),r&&hu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function pu(t){var e=Jm(t,"string");return ir(e)==="symbol"?e:String(e)}function Jm(t,e){if(ir(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ir(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var ut=function(){function t(r){Qm(this,t),this.id=void 0,this.topology=void 0,this.vertexCount=void 0,this.indices=void 0,this.attributes=void 0,this.userData={};var n=r.attributes,i=n===void 0?{}:n,o=r.indices,a=o===void 0?null:o,u=r.vertexCount,s=u===void 0?null:u;this.id=r.id||X("geometry"),this.topology=r.topology,a&&(this.indices=ArrayBuffer.isView(a)?{value:a,size:1}:a),this.attributes={};for(var f=0,p=Object.entries(i);f<p.length;f++){var d=Hm(p[f],2),g=d[0],S=d[1],x=ArrayBuffer.isView(S)?{value:S}:S;et(ArrayBuffer.isView(x.value),"".concat(this._print(g),": must be typed array or object with value as typed array")),(g==="POSITION"||g==="positions")&&!x.size&&(x.size=3),g==="indices"?(et(!this.indices),this.indices=x):this.attributes[g]=x}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=s||this._calculateVertexCount(this.attributes,this.indices)}var e=t.prototype;return e.getVertexCount=function(){return this.vertexCount},e.getAttributes=function(){return this.indices?qm({indices:this.indices},this.attributes):this.attributes},e._print=function(n){return"Geometry ".concat(this.id," attribute ").concat(n)},e._setAttributes=function(n,i){return this},e._calculateVertexCount=function(n,i){if(i)return i.value.length;for(var o=1/0,a=0,u=Object.values(n);a<u.length;a++){var s=u[a],f=s.value,p=s.size,d=s.constant;!d&&f&&p>=1&&(o=Math.min(o,f.length/p))}return et(Number.isFinite(o)),o},Zm(t)}();function he(t){return he=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(t)}var mu;function du(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?du(Object(r),!0).forEach(function(n){td(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):du(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function td(t,e,r){return e=_u(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_u(n.key),n)}}function ed(t,e,r){return e&&vu(t.prototype,e),r&&vu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _u(t){var e=rd(t,"string");return he(e)==="symbol"?e:String(e)}function rd(t,e){if(he(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(he(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function id(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bn(t,e)}function Bn(t,e){return Bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Bn(t,e)}function od(t){var e=ud();return function(){var n=Ur(t),i;if(e){var o=Ur(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ad(this,i)}}function ad(t,e){if(e&&(he(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sd(t)}function sd(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ud(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ur(t){return Ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ur(t)}function fd(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var cd=go(mu||(mu=fd([`#version 300 es
|
|
260
|
+
in vec2 aClipSpacePosition;
|
|
260
261
|
in vec2 aTexCoord;
|
|
261
262
|
in vec2 aCoordinate;
|
|
262
263
|
|
|
@@ -271,6 +272,7 @@ void main(void) {
|
|
|
271
272
|
uv = aTexCoord;
|
|
272
273
|
}
|
|
273
274
|
`],[`\\
|
|
275
|
+
#version 300 es
|
|
274
276
|
in vec2 aClipSpacePosition;
|
|
275
277
|
in vec2 aTexCoord;
|
|
276
278
|
in vec2 aCoordinate;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/engine",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.4",
|
|
4
4
|
"description": "WebGL2 Components for High Performance Rendering and Computation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
43
|
-
"@luma.gl/constants": "9.0.0-beta.
|
|
44
|
-
"@luma.gl/core": "9.0.0-beta.
|
|
45
|
-
"@luma.gl/shadertools": "9.0.0-beta.
|
|
43
|
+
"@luma.gl/constants": "9.0.0-beta.4",
|
|
44
|
+
"@luma.gl/core": "9.0.0-beta.4",
|
|
45
|
+
"@luma.gl/shadertools": "9.0.0-beta.4",
|
|
46
46
|
"@math.gl/core": "^4.0.0",
|
|
47
47
|
"@probe.gl/log": "^4.0.2",
|
|
48
48
|
"@probe.gl/stats": "^4.0.2"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "bf6bb45b25d59de5b3d05dab4b2e91ad583059e6"
|
|
51
51
|
}
|
package/src/lib/clip-space.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {Model, ModelProps} from '../model/model';
|
|
|
5
5
|
import {Geometry} from '../geometry/geometry';
|
|
6
6
|
|
|
7
7
|
const CLIPSPACE_VERTEX_SHADER = glsl`\
|
|
8
|
+
#version 300 es
|
|
8
9
|
in vec2 aClipSpacePosition;
|
|
9
10
|
in vec2 aTexCoord;
|
|
10
11
|
in vec2 aCoordinate;
|
|
@@ -28,7 +29,7 @@ const POSITIONS = [-1, -1, 1, -1, -1, 1, 1, 1];
|
|
|
28
29
|
* A flat geometry that covers the "visible area" that the GPU renders.
|
|
29
30
|
*/
|
|
30
31
|
export class ClipSpace extends Model {
|
|
31
|
-
constructor(device: Device, opts
|
|
32
|
+
constructor(device: Device, opts: Omit<ModelProps, 'vs' | 'vertexCount' | 'geometry'>) {
|
|
32
33
|
const TEX_COORDS = POSITIONS.map((coord) => (coord === -1 ? 0 : coord));
|
|
33
34
|
|
|
34
35
|
super(
|