Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: frame count since build #10

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

0b5vr
Copy link
Contributor

@0b5vr 0b5vr commented Feb 17, 2025

This PR implements frame_count_since_build.

I implemented this in 2023-12 and completely forgot about it. I implemented it for pathtracing stuff I guess??
Feel free to reject this since I even don't know why I implemented this.

Working example

pipeline.yaml

stages:
  - fs: "scene.frag"
    target: accumulatorTex

  - fs: "present.frag"

scene.frag

#version 140

out vec4 out_color;

uniform vec4 resolution;
uniform int frame_count_since_build;
uniform sampler2D accumulatorTex;

void main() {
    out_color = texelFetch(accumulatorTex, ivec2(gl_FragCoord.xy), 0);
    int i = int(gl_FragCoord.x / 16) + int(gl_FragCoord.y / 16) * int(resolution.x / 16);
    if (i == frame_count_since_build) {
        out_color += vec4(0.5);
    }
}

present.frag

#version 430

out vec4 out_color;
uniform sampler2D accumulatorTex;

void main() {
    out_color = texelFetch(accumulatorTex, ivec2(gl_FragCoord.xy), 0);
}

I implemented this in 2023-12 and completely forgot about it.
I implemented it for pathtracing stuff I guess??

Just checked and working it right I believe
@slerpyyy
Copy link
Owner

Seems like a nice uniform to have since it's symmetrical with time_since_build

Thank you for the PR!

@slerpyyy slerpyyy merged commit b7237b2 into slerpyyy:main Feb 17, 2025
1 check passed
@0b5vr 0b5vr deleted the frame-count-since-build branch February 18, 2025 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants