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

Colored quads not rendering on Web #3354

Open
MaybeMaru opened this issue Feb 2, 2025 · 2 comments · May be fixed by #3356
Open

Colored quads not rendering on Web #3354

MaybeMaru opened this issue Feb 2, 2025 · 2 comments · May be fixed by #3356

Comments

@MaybeMaru
Copy link
Contributor

This has been an issue for some time now.
When using color transforms on draw-quads rendering on HTML5 (for example, using the color value in a FlxSprite), the quad batch sometimes won't render, seemingly at random.
I believe this could be related to the graphics shader uniforms not being set correctly, but I'm not entirely sure.
Here are two videos showing the issue occurring in Flixel 5.8.0 and Flixel 4.11.0 (has been tested to also happen on Flixel 6):

2025-02-02.12-53-21.online-video-cutter.com.mp4
2025-02-02.13-04-50.online-video-cutter.com.mp4
@Geokureli
Copy link
Member

Geokureli commented Feb 2, 2025

I was under the impression that this didn't work on any target, and that the rendering overhaul was supposed to add this.

I think we are due for some changes to rendering, but that means either I need to learn a lot about rendering, or someone else is gonna change flixel's rendering in a way that makes sense to me: a rendering lay-man. Likely both will need to happen

Also, I don't really understand what I'm supposed to see from those videos, It's far more helpful to reproduce the error in a small test project and share that snippet along with detailed expactations

@MaybeMaru
Copy link
Contributor Author

I was under the impression that this didn't work on any target, and that the rendering overhaul was supposed to add this.

I think we are due for some changes to rendering, but that means either I need to learn a lot about rendering, or someone else is gonna change flixel's rendering in a way that makes sense to me: a rendering lay-man. Likely both will need to happen

Also, I don't really understand what I'm supposed to see from those videos, It's far more helpful to reproduce the error in a small test project and share that snippet along with detailed expactations

Heres a small test state that shows the issue:

package;

import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.util.FlxColor;

using flixel.util.FlxColorTransformUtil;

class ColorTest extends FlxState
{
	override function create()
	{
		super.create();

		FlxG.camera.bgColor = FlxColor.GRAY;

		for (i in 0...16)
		{
			var sprite = new FlxSprite(i);
			sprite.screenCenter();
			sprite.x += i * 20;
			sprite.color = (i % 4 == 0) ? FlxColor.RED : FlxColor.WHITE;
			add(sprite);
		}
	}
}

What it should look like:

Image

What it currently looks like on HTML5:

Image

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

Successfully merging a pull request may close this issue.

2 participants