-
Create a
FragmentShaderpercanvas.drawXXX. Yeah the documentation says you can reuse, but since you’re into fragment shader, I guess you want per draw per frame change by setting uniforms. Reuse theFragmentProgram. Load it from your shader file once, keep it in your provider, state, etc. and createFragmentShaderobjects from it right before you call canvas.drawXXX. This tripped me - as I barely read documentation and let my Windsurf handle the coding. For the most part. -
Also, Flutter will trim unused uniforms so your setFloat calls can start throwing index errors. Be wary.