Closed scottwestover closed 2 weeks ago
Hi Scott - This property is no longer required. A shader will automatically extract the uniforms via a WebGL call, so you don't need to list them anymore. However, it appears the examples have not been updated to reflect this. If you remove them from the example code, the example will still work just fine.
btw nice Phaser RPG series YouTube videos! Hopefully that's you? :)
Nice! Thanks for the quick response, and for your help.
Yes, that is me. Also, thank you for the kinds words about the series, really appreciate it :)
Ok, I have now fixed all of the pipeline examples so they no longer set uniforms
.
Version
Description
The examples for shaders that extend the
Phaser.Renderer.WebGL.Pipelines.PostFXPipeline
class, include a property calleduniforms
, that is passed to to the parent class. When you use the same code with TypeScript, there is a warning about this property not existing on theWebGLPipelineConfig
type.Reference:
https://labs.phaser.io/edit.html?src=src/renderer/color%20post%20fx%20pipeline.js&v=3.80.1 and https://labs.phaser.io/assets/pipelines/BendPostFX.js
Example Test Code
Example code can be found here: https://github.com/scottwestover/template-vite-ts-bug-example. The main file is https://github.com/scottwestover/template-vite-ts-bug-example/blob/main/src/BendPostFX.ts, which is a slightly modified version of https://labs.phaser.io/assets/pipelines/BendPostFX.js.
To reproduce, in a TypeScript project, create a class that extends the
Phaser.Renderer.WebGL.Pipelines.PostFXPipeline
class, and in thesuper
call, add inuniforms
. You should see a TypeScript warning of uniforms not existing on theWebGLPipelineConfig
type.Additional Information
Not sure if relevant, but when I don't provide the
uniforms
property to the configuration that is provide to the parent class, the code still works.This might be related to https://github.com/phaserjs/phaser/issues/6737.