@Megalomaniak I created a fresh project to do a simple test:
I have a simple viewport containing a sprite both have a 512k size.
I have a shader doing a simple thing in the frag:
vec4 sample = texture(prevTex, UV.xy);
if(distance(UV.xy, mousePos) < 0.1)
sample = mix(sample, vec4(1,0,0,1), 0.1f - distance(UV.xy, mousePos));
COLOR = sample;
I've attached a script on the viewport that sets the shaders uniforms in the process like this:
public override void _Process(float delta)
{
Vector2 mousePos = GetMousePosition() / 512.0f;
mousePos.y = 1.0f - mousePos.y;
sprite.Material.Set("shader_param/mousePos", mousePos);
sprite.Material.Set("shader_param/prevTex", GetTexture());
}
How can I be sure that rendering of the frame is finished at the point where I set the uniforms in the process. Is there a OnPostRender callback (like in Unity) ?
Here is my issue visually:
Thanks in advance.