|
function normalizeColor(e){return[(e>>16&255)/255,(e>>8&255)/255,(255&e)/255]}["SCREEN","LINEAR_LIGHT"].reduce(((e,t,n)=>Object.assign(e,{[t]:n})),{});class MiniGl{constructor(e,t,n,i=!1){const s=this,o=-1!==document.location.search.toLowerCase().indexOf("debug=webgl");s.canvas=e,s.gl=s.canvas.getContext("webgl",{antialias:!0}),s.meshes=[];const r=s.gl;t&&n&&this.setSize(t,n),s.lastDebugMsg,s.debug=i&&o?function(e){const t=new Date;t-s.lastDebugMsg>1e3&&console.log("---"),console.log(t.toLocaleTimeString()+Array(Math.max(0,32-e.length)).join(" ")+e+": ",...Array.from(arguments).slice(1)),s.lastDebugMsg=t}:()=>{},Object.defineProperties(s,{Material:{enumerable:!1,value:class{constructor(e,t,n={}){function i(e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),r.getShaderParameter(n,r.COMPILE_STATUS)||console.error(r.getShaderInfoLog(n)),s.debug("Material.compileShaderSource",{source:t}),n}function o(e,t){return Object.entries(e).map((([e,n])=>n.getDeclaration(e,t))).join("\n")}this.unif |