From b27bc1b5d7803d4033b6966fe0c1124de769013b Mon Sep 17 00:00:00 2001 From: Scott Westover Date: Fri, 29 Mar 2024 14:44:42 -0400 Subject: [PATCH] fixed shader build files Signed-off-by: Scott Westover --- .../js/{index-DN94fAOg.js => index-jn5zOyW8.js} | 14 +++++++------- examples/shader-examples/index.html | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) rename examples/shader-examples/assets/js/{index-DN94fAOg.js => index-jn5zOyW8.js} (99%) diff --git a/examples/shader-examples/assets/js/index-DN94fAOg.js b/examples/shader-examples/assets/js/index-jn5zOyW8.js similarity index 99% rename from examples/shader-examples/assets/js/index-DN94fAOg.js rename to examples/shader-examples/assets/js/index-jn5zOyW8.js index 7a28b7d..89039ac 100644 --- a/examples/shader-examples/assets/js/index-DN94fAOg.js +++ b/examples/shader-examples/assets/js/index-jn5zOyW8.js @@ -1,4 +1,4 @@ -var Ot=(at,st,ht)=>{if(!st.has(at))throw TypeError("Cannot "+ht)};var Rt=(at,st,ht)=>(Ot(at,st,"read from private field"),ht?ht.call(at):st.get(at)),Lt=(at,st,ht)=>{if(st.has(at))throw TypeError("Cannot add the same private member more than once");st instanceof WeakSet?st.add(at):st.set(at,ht)},Ft=(at,st,ht,mt)=>(Ot(at,st,"write to private field"),mt?mt.call(at,ht):st.set(at,ht),ht);(function(){const st=document.createElement("link").relList;if(st&&st.supports&&st.supports("modulepreload"))return;for(const ft of document.querySelectorAll('link[rel="modulepreload"]'))mt(ft);new MutationObserver(ft=>{for(const pt of ft)if(pt.type==="childList")for(const p of pt.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&mt(p)}).observe(document,{childList:!0,subtree:!0});function ht(ft){const pt={};return ft.integrity&&(pt.integrity=ft.integrity),ft.referrerPolicy&&(pt.referrerPolicy=ft.referrerPolicy),ft.crossOrigin==="use-credentials"?pt.credentials="include":ft.crossOrigin==="anonymous"?pt.credentials="omit":pt.credentials="same-origin",pt}function mt(ft){if(ft.ep)return;ft.ep=!0;const pt=ht(ft);fetch(ft.href,pt)}})();var bt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kt(at){return at&&at.__esModule&&Object.prototype.hasOwnProperty.call(at,"default")?at.default:at}var Ht={exports:{}};(function(at,st){(function(mt,ft){at.exports=ft()})(bt,()=>(()=>{var ht={50792:p=>{var S=Object.prototype.hasOwnProperty,t="~";function d(){}Object.create&&(d.prototype=Object.create(null),new d().__proto__||(t=!1));function c(e,s,h){this.fn=e,this.context=s,this.once=h||!1}function a(e,s,h,i,o){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new c(h,i||e,o),l=t?t+s:s;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],f]:e._events[l].push(f):(e._events[l]=f,e._eventsCount++),e}function r(e,s){--e._eventsCount===0?e._events=new d:delete e._events[s]}function n(){this._events=new d,this._eventsCount=0}n.prototype.eventNames=function(){var s=[],h,i;if(this._eventsCount===0)return s;for(i in h=this._events)S.call(h,i)&&s.push(t?i.slice(1):i);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(h)):s},n.prototype.listeners=function(s){var h=t?t+s:s,i=this._events[h];if(!i)return[];if(i.fn)return[i.fn];for(var o=0,f=i.length,l=new Array(f);o{/** +var wt=(at,st,ht)=>{if(!st.has(at))throw TypeError("Cannot "+ht)};var Rt=(at,st,ht)=>(wt(at,st,"read from private field"),ht?ht.call(at):st.get(at)),Lt=(at,st,ht)=>{if(st.has(at))throw TypeError("Cannot add the same private member more than once");st instanceof WeakSet?st.add(at):st.set(at,ht)},Ft=(at,st,ht,mt)=>(wt(at,st,"write to private field"),mt?mt.call(at,ht):st.set(at,ht),ht);(function(){const st=document.createElement("link").relList;if(st&&st.supports&&st.supports("modulepreload"))return;for(const ft of document.querySelectorAll('link[rel="modulepreload"]'))mt(ft);new MutationObserver(ft=>{for(const pt of ft)if(pt.type==="childList")for(const p of pt.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&mt(p)}).observe(document,{childList:!0,subtree:!0});function ht(ft){const pt={};return ft.integrity&&(pt.integrity=ft.integrity),ft.referrerPolicy&&(pt.referrerPolicy=ft.referrerPolicy),ft.crossOrigin==="use-credentials"?pt.credentials="include":ft.crossOrigin==="anonymous"?pt.credentials="omit":pt.credentials="same-origin",pt}function mt(ft){if(ft.ep)return;ft.ep=!0;const pt=ht(ft);fetch(ft.href,pt)}})();var bt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kt(at){return at&&at.__esModule&&Object.prototype.hasOwnProperty.call(at,"default")?at.default:at}var Ht={exports:{}};(function(at,st){(function(mt,ft){at.exports=ft()})(bt,()=>(()=>{var ht={50792:p=>{var S=Object.prototype.hasOwnProperty,t="~";function d(){}Object.create&&(d.prototype=Object.create(null),new d().__proto__||(t=!1));function c(e,s,h){this.fn=e,this.context=s,this.once=h||!1}function a(e,s,h,i,o){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new c(h,i||e,o),l=t?t+s:s;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],f]:e._events[l].push(f):(e._events[l]=f,e._eventsCount++),e}function r(e,s){--e._eventsCount===0?e._events=new d:delete e._events[s]}function n(){this._events=new d,this._eventsCount=0}n.prototype.eventNames=function(){var s=[],h,i;if(this._eventsCount===0)return s;for(i in h=this._events)S.call(h,i)&&s.push(t?i.slice(1):i);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(h)):s},n.prototype.listeners=function(s){var h=t?t+s:s,i=this._events[h];if(!i)return[];if(i.fn)return[i.fn];for(var o=0,f=i.length,l=new Array(f);o{/** * @author samme * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -6356,7 +6356,7 @@ uniform sampler2D uMainSampler; void main() { gl_FragColor = texture2D(uMainSampler, outTexCoord); } -`;class Dt extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(st){super({game:st,fragShader:Jt})}}const wt="BG";class Qt extends xt.Scene{constructor(){super({key:"NothingPostFxScene"})}preload(){this.load.image(wt,"assets/images/bg.png")}create(){var st;this.add.image(0,0,wt).setOrigin(0),this.renderer.pipelines.addPostPipeline("NothingPostFxPipeline",Dt),this.cameras.main.setPostPipeline(Dt),(st=this.input.keyboard)==null||st.once("keydown-SPACE",()=>{this.scene.start("ColorPostFxScene")})}}const $t=` +`;class Bt extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(st){super({game:st,fragShader:Jt})}}const It="BG";class Qt extends xt.Scene{constructor(){super({key:"NothingPostFxScene"})}preload(){this.load.image(It,"assets/images/bg.png")}create(){var st;this.add.image(0,0,It).setOrigin(0),this.renderer.pipelines.addPostPipeline("NothingPostFxPipeline",Bt),this.cameras.main.setPostPipeline(Bt),(st=this.input.keyboard)==null||st.once("keydown-SPACE",()=>{this.scene.start("ColorPostFxScene")})}}const $t=` #define SHADER_NAME COLOR_POST_TINT #ifdef GL_ES @@ -6367,7 +6367,7 @@ void main() { // RGB, Alpha gl_FragColor = vec4(0.0, 0.0, 0.0, 0.2); } -`;class Bt extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(st){super({game:st,fragShader:$t})}}const It="BG";class jt extends xt.Scene{constructor(){super({key:"ColorPostFxScene"})}preload(){this.load.image(It,"assets/images/bg.png")}create(){var st;this.add.image(0,0,It).setOrigin(0),this.renderer.pipelines.addPostPipeline("ColorPostFxPipeline",Bt),this.cameras.main.setPostPipeline(Bt),(st=this.input.keyboard)==null||st.once("keydown-SPACE",()=>{this.scene.start("GreyScalePostFxScene")})}}const kt=` +`;class Gt extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(st){super({game:st,fragShader:$t})}}const Nt="BG";class jt extends xt.Scene{constructor(){super({key:"ColorPostFxScene"})}preload(){this.load.image(Nt,"assets/images/bg.png")}create(){var st;this.add.image(0,0,Nt).setOrigin(0),this.renderer.pipelines.addPostPipeline("ColorPostFxPipeline",Gt),this.cameras.main.setPostPipeline(Gt),(st=this.input.keyboard)==null||st.once("keydown-SPACE",()=>{this.scene.start("GreyScalePostFxScene")})}}const kt=` #define SHADER_NAME GREY_SCALE_POST_TINT #ifdef GL_ES @@ -6383,7 +6383,7 @@ void main() { // mix https://thebookofshaders.com/glossary/?search=mix gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126 * gl_FragColor.r + 0.7152 * gl_FragColor.g + 0.0722 * gl_FragColor.b), 1.0); } -`;class Gt extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(st){super({game:st,fragShader:kt})}}const Nt="BG";class qt extends xt.Scene{constructor(){super({key:"GreyScalePostFxScene"})}preload(){this.load.image(Nt,"assets/images/bg.png")}create(){var st;this.add.image(0,0,Nt).setOrigin(0),this.renderer.pipelines.addPostPipeline("GreyScalePostFxPipeline",Gt),this.cameras.main.setPostPipeline(Gt),(st=this.input.keyboard)==null||st.once("keydown-SPACE",()=>{this.scene.start("DynamicColorPostFxScene")})}}const _t=` +`;class Ut extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(st){super({game:st,fragShader:kt})}}const Xt="BG";class qt extends xt.Scene{constructor(){super({key:"GreyScalePostFxScene"})}preload(){this.load.image(Xt,"assets/images/bg.png")}create(){var st;this.add.image(0,0,Xt).setOrigin(0),this.renderer.pipelines.addPostPipeline("GreyScalePostFxPipeline",Ut),this.cameras.main.setPostPipeline(Ut),(st=this.input.keyboard)==null||st.once("keydown-SPACE",()=>{this.scene.start("DynamicColorPostFxScene")})}}const _t=` #define SHADER_NAME WIPE_POST_FX #ifdef GL_ES @@ -6403,8 +6403,8 @@ void main() { gl_FragColor = texture2D(uMainSampler, outTexCoord); } } -`;var Pt;class Ut extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(ht){super({game:ht,fragShader:_t});Lt(this,Pt,void 0);Ft(this,Pt,0)}get progress(){return Rt(this,Pt)}set progress(ht){Ft(this,Pt,ht)}onPreRender(){this.set1f("uCutoff",Rt(this,Pt))}}Pt=new WeakMap;const Xt="BG";class te extends xt.Scene{constructor(){super({key:"WipePostFxScene"})}preload(){this.load.image(Xt,"assets/images/bg.png")}create(){var st;this.add.image(0,0,Xt).setOrigin(0),this.renderer.pipelines.addPostPipeline("WipePostFxPipeline",Ut),this.cameras.main.setPostPipeline(Ut),this.tweens.add({targets:this.cameras.main.getPostPipeline("WipePostFxPipeline"),progress:1,duration:2e3,delay:1e3}),(st=this.input.keyboard)==null||st.once("keydown-SPACE",()=>{this.scene.start("BuiltInFxScene")})}}const zt="BG",Vt="CHARACTERS";class ee extends xt.Scene{constructor(){super({key:"BuiltInFxScene"})}preload(){this.load.image(zt,"assets/images/bg.png"),this.load.spritesheet(Vt,"assets/images/custom.png",{frameWidth:64,frameHeight:88})}create(){var ht,mt;this.add.image(0,0,zt).setOrigin(0),(ht=this.add.image(487,310,Vt,7).preFX)==null||ht.addGradient(255,65280,0),this.cameras.main.postFX.addGradient(16711680),(mt=this.input.keyboard)==null||mt.once("keydown-SPACE",()=>{this.scene.start("NothingPostFxScene")})}}const ie=` -#define SHADER_NAME NOTHING_POST_TINT +`;var Pt;class Ot extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(ht){super({game:ht,fragShader:_t});Lt(this,Pt,void 0);Ft(this,Pt,0)}get progress(){return Rt(this,Pt)}set progress(ht){Ft(this,Pt,ht)}onPreRender(){this.set1f("uCutoff",Rt(this,Pt))}}Pt=new WeakMap;const zt="BG";class te extends xt.Scene{constructor(){super({key:"WipePostFxScene"})}preload(){this.load.image(zt,"assets/images/bg.png")}create(){var st;this.add.image(0,0,zt).setOrigin(0),this.renderer.pipelines.addPostPipeline("WipePostFxPipeline",Ot),this.cameras.main.setPostPipeline(Ot),this.tweens.add({targets:this.cameras.main.getPostPipeline(Ot),progress:1,duration:2e3,delay:1e3}),(st=this.input.keyboard)==null||st.once("keydown-SPACE",()=>{this.scene.start("BuiltInFxScene")})}}const Vt="BG",Yt="CHARACTERS";class ee extends xt.Scene{constructor(){super({key:"BuiltInFxScene"})}preload(){this.load.image(Vt,"assets/images/bg.png"),this.load.spritesheet(Yt,"assets/images/custom.png",{frameWidth:64,frameHeight:88})}create(){var ht,mt;this.add.image(0,0,Vt).setOrigin(0),(ht=this.add.image(487,310,Yt,7).preFX)==null||ht.addGradient(255,65280,0),this.cameras.main.postFX.addGradient(16711680),(mt=this.input.keyboard)==null||mt.once("keydown-SPACE",()=>{this.scene.start("NothingPostFxScene")})}}const ie=` +#define SHADER_NAME DYNAMIC_POST_TINT #ifdef GL_ES precision mediump float; @@ -6417,4 +6417,4 @@ uniform float uTest; void main() { gl_FragColor = vec4(uTest, 0.4, 0.723, 1.0); } -`;var At;class Yt extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(ht){super({game:ht,fragShader:ie});Lt(this,At,void 0);Ft(this,At,0)}get progress(){return Rt(this,At)}set progress(ht){Ft(this,At,ht)}onPreRender(){this.set1f("uTest",Rt(this,At))}}At=new WeakMap;const Wt="BG";class se extends xt.Scene{constructor(){super({key:"DynamicColorPostFxScene"})}preload(){this.load.image(Wt,"assets/images/bg.png")}create(){var st;this.add.image(0,0,Wt).setOrigin(0),this.renderer.pipelines.addPostPipeline("DynamicColorPostFxPipeline",Yt),this.cameras.main.setPostPipeline(Yt),this.tweens.add({targets:this.cameras.main.getPostPipeline("DynamicColorPostFxPipeline"),progress:1,duration:2e3,delay:1e3,repeat:-1,yoyo:!0}),(st=this.input.keyboard)==null||st.once("keydown-SPACE",()=>{this.scene.start("WipePostFxScene")})}}const ne={type:xt.WEBGL,pixelArt:!0,scale:{parent:"game-container",width:1024,height:576,mode:xt.Scale.FIT,autoCenter:xt.Scale.CENTER_BOTH},backgroundColor:"#5c5b5b"},Mt=new xt.Game(ne);Mt.scene.add("NothingPostFxScene",Qt);Mt.scene.add("ColorPostFxScene",jt);Mt.scene.add("GreyScalePostFxScene",qt);Mt.scene.add("DynamicColorPostFxScene",se);Mt.scene.add("WipePostFxScene",te);Mt.scene.add("BuiltInFxScene",ee);Mt.scene.start("NothingPostFxScene"); +`;var At;class Dt extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(ht){super({game:ht,fragShader:ie});Lt(this,At,void 0);Ft(this,At,0)}get progress(){return Rt(this,At)}set progress(ht){Ft(this,At,ht)}onPreRender(){this.set1f("uTest",Rt(this,At))}}At=new WeakMap;const Wt="BG";class se extends xt.Scene{constructor(){super({key:"DynamicColorPostFxScene"})}preload(){this.load.image(Wt,"assets/images/bg.png")}create(){var st;this.add.image(0,0,Wt).setOrigin(0),this.renderer.pipelines.addPostPipeline("DynamicColorPostFxPipeline",Dt),this.cameras.main.setPostPipeline(Dt),this.tweens.add({targets:this.cameras.main.getPostPipeline(Dt),progress:1,duration:2e3,delay:1e3,repeat:-1,yoyo:!0}),(st=this.input.keyboard)==null||st.once("keydown-SPACE",()=>{this.scene.start("WipePostFxScene")})}}const ne={type:xt.WEBGL,pixelArt:!0,scale:{parent:"game-container",width:1024,height:576,mode:xt.Scale.FIT,autoCenter:xt.Scale.CENTER_BOTH},backgroundColor:"#5c5b5b"},Mt=new xt.Game(ne);Mt.scene.add("NothingPostFxScene",Qt);Mt.scene.add("ColorPostFxScene",jt);Mt.scene.add("GreyScalePostFxScene",qt);Mt.scene.add("DynamicColorPostFxScene",se);Mt.scene.add("WipePostFxScene",te);Mt.scene.add("BuiltInFxScene",ee);Mt.scene.start("DynamicColorPostFxScene"); diff --git a/examples/shader-examples/index.html b/examples/shader-examples/index.html index 5ce6acc..9de54b2 100644 --- a/examples/shader-examples/index.html +++ b/examples/shader-examples/index.html @@ -14,7 +14,7 @@ background: #d7d7d7; } - +