Skip to content
Discussion options

You must be logged in to vote

It doesn't store values as it is impossible in pure GLSL with mpv. Thats what the topic is about

It does though, I tested it.

Try this:

//!BUFFER TEST_STATE
//!VAR uint frame_count
//!STORAGE

//!HOOK OUTPUT
//!BIND HOOKED
//!BIND TEST_STATE
//!SAVE EMPTY
//!WIDTH 1
//!HEIGHT 1
//!COMPUTE 1 1
//!DESC init counter

void hook() {
    frame_count = frame_count + 1u;
}

//!HOOK OUTPUT
//!BIND HOOKED
//!BIND TEST_STATE
//!DESC visualize counter

vec4 hook() {
    vec4 color = HOOKED_tex(HOOKED_pos);
    
    // Convert frame count to a cycling hue
    float t = float(frame_count) / 60.0; // cycles every 60 frames
    
    // Draw a debug bar at the top of the screen
    if (HOOKED_pos.y < 0.…

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@geextahslex
Comment options

Comment options

You must be logged in to vote
2 replies
@geextahslex
Comment options

@CounterPillow
Comment options

Comment options

You must be logged in to vote
5 replies
@geextahslex
Comment options

@Jules-A
Comment options

@geextahslex
Comment options

@Jules-A
Comment options

Answer selected by geextahslex
@geextahslex
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants