0 votes

I've created a shader which takes in a procedurally generated texture to swap colors dynamically, it works alright in the editor, but when I export the project to HTML some color bleeding is taking place and making the display colors muddy.

Is there a way to correct this for HTML?

The generated ImageTexture is 256 x 3 in size, with format set to FORMATRGB8, and flag set to FLAGREPEAT.

You can find the demo scene here: Demo Scene

And the repository here: GitHub repo

asked Jul 6 in Projects by AlbGD (15 points)

1 Answer

+1 vote
Best answer

This is a known issue: https://github.com/godotengine/godot/issues/34062

Try running the project in different browsers to confirm this.

answered Jul 6 by Calinou (6,336 points)
selected Jul 7 by AlbGD

hey! thanks for the reply.

I've tested it on Firefox, Chrome, Edge and Opera. They all reproduce the same symptom of muddy colors.

However, I don't think it is related to that known issue, as the colors appear correctly saturated. The problem could lie in the way I'm generating the Image or ImageTexture.

The original texture I used for the shader, correctly displays the colors both in the editor and in web browsers. It is an imported texture with the 2d pixel preset applied, but I don't know how to generate an ImageTexture with those specific values. The muddy colors also resemble a Filter Flag imported texture.

I'm going to do more tests, changing the format, interpolation, compression and flags to see if that corrects the procedurally generated ImageTexture.

Thank you! Your answer lead me to discover this other question, where they set the flags to 0 fixing the color bleeding problem.

I've also fixed the code and re-uploaded it to my itch.io and now the colors look nice!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.