Limeth / obs-shaderfilter-plus

obs-shaderfilter rewritten in Rust and improved
Other
183 stars 19 forks source link

builtin_elapsed_time_since_shown not guaranteed to equal 0.0 when source is shown #25

Closed Press-OK closed 3 years ago

Press-OK commented 3 years ago

Using the following simple (HLSL) shader:

float4 render(float2 uv0) {
    float4 p = image.Sample(builtin_texture_sampler, uv0);
    return lerp(p, float4(1.0, 0.0, 0.0, 1.0), builtin_elapsed_time_since_shown);
}

Expected result: The output to transition from sampled input p to float4(1.0, 0.0, 0.0, 1.0) (solid red) over the course of one second, if builtin_elapsed_time_since_shown == 0.0 when the source is first shown and 1.0 one second later.

Observed: When spamming the "show/hide" (eye) button in OBS, it works as expected (takes 1s to fade). However, when leaving the source hidden/visible for longer periods, the value of builtin_elapsed_time_since_shown when the source gets shown seems to start at a value between ~ 2.0 and 5.0 .

Unforunately I don't know enough about the functionality to know why it might be the case.

Limeth commented 3 years ago

Thanks for the report, fixed in v0.3.1.