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

Load and render a single frame may fall into a blank #79

Open
o-tantk opened this issue Feb 15, 2022 · 0 comments
Open

Load and render a single frame may fall into a blank #79

o-tantk opened this issue Feb 15, 2022 · 0 comments

Comments

@o-tantk
Copy link

o-tantk commented Feb 15, 2022

I tested very simple html page(below) as local file, and it shows nothing.

<html>
    <head>
        <script type="text/javascript" src="https://rawgit.com/patriciogonzalezvivo/glslCanvas/master/dist/GlslCanvas.js"></script>
    </head>
    <body>
        <canvas class="glslCanvas" data-fragment="
void main() {
    gl_FragColor = vec4(1, 0, 0, 1);
}
            " width="500" height="500"></canvas>
    </body>
</html>

It seems an instant render overwritten or ignored if render timing is too fast.
Adding a line that postpones rendering render once more at the next frame, It works fine.

// glslCanvas.js: 179L
setTimeout(() => { this.forceRender = true; }, 1);

Thanks.

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

No branches or pull requests

1 participant