flame icon indicating copy to clipboard operation
flame copied to clipboard

Weird behavior with Flame Shaders compared to pure flutter shader

Open stilnat opened this issue 2 months ago • 3 comments

What happened?

Trying to use a shader that works in pure Flutter, it doesn't in Flame. My picture gets scaled down and asymmetrically deformed. This might be simply something I don't understand with how to pass data to the shader in Flame, or a bug, I'm unsure.

What do you expect?

I'm trying to reproduce the same behavior in pure flutter and in Flame, On the right the expected result and on the left the one I'm getting with Flame.

Image

How can we reproduce this?

I made a public repo to work on the issue you can take a look at https://github.com/stilnat/shader-flame-test

What steps should take to fix this?

I don't know at all

stilnat avatar Nov 10 '25 21:11 stilnat

updated the issue to add a public repository with an example showing the issue

stilnat avatar Nov 26 '25 16:11 stilnat

I have some update on this, in the shader, setting vec3 col = texture(uTexture, uv * 0.5 + vec2(0, 0.5)).rgb; Instead of vec3 col = texture(uTexture, uv).rgb Will give the proper result, I can't explain why though.

stilnat avatar Nov 27 '25 21:11 stilnat

@renancaraujo maybe you would know?

luanpotter avatar Dec 07 '25 18:12 luanpotter