Hi folks,
I'm currently working on a sample/learning project where I have some colourful dots moving around. And I'm trying to achieve that these dots are leaving trails that fade out after some time. For this purpose I render my frames to two textures (alternating each frame) and draw the last frame as background of the next frame. The sahder for this looks like this:
#version 420 core
in vec2 uv;
out vec4 out_Color;
uniform highp sampler2D texture;
void main()
{
highp vec3 col = texture2D(texture, uv).rgb * 0.97;
out_Color = vec4(col, 1.0);
}
This approach seems to be basically working but with the flaw that the color never converges to black but stops fading out at some reasonably dark color. It seems hard to believe to me that the precision of this calculation should be that low that it calculates x * 0.97 = x where x is nothing near to epsilon but let's say 0.05. But this would be a good explanation for the behaviou I observe. Or am I missing something else here?
It would be really great to get some advice on this or any hints how I could fix this issue.