Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGLPipelineConfig Type is missing uniforms property from the type definition #6751

Open
scottwestover opened this issue Feb 28, 2024 · 2 comments

Comments

@scottwestover
Copy link

Version

  • Phaser Version: 3.80.0
  • Operating system: macOS Monterey Version 12.6.3
  • Browser: N/A

Description

The examples for shaders that extend the Phaser.Renderer.WebGL.Pipelines.PostFXPipeline class, include a property called uniforms, 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 the WebGLPipelineConfig 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 the super call, add in uniforms. You should see a TypeScript warning of uniforms not existing on the WebGLPipelineConfig type.

Additional Information

Screen Shot 2024-02-28 at 10 36 54 AM

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 #6737.

@photonstorm
Copy link
Collaborator

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? :)

@scottwestover
Copy link
Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants