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

Fix usage of (or workaround for bug in) tumult Simplex2 #41

Open
martinblech opened this issue Feb 10, 2020 · 1 comment
Open

Fix usage of (or workaround for bug in) tumult Simplex2 #41

martinblech opened this issue Feb 10, 2020 · 1 comment
Assignees

Comments

@martinblech
Copy link
Contributor

If I leave the noise program running for a while, I get this stacktrace:

/Users/martinblech/Documents/projects/warrolight/server/node_modules/tumult/lib/simplex/simplex2.js:30
    const n2 = cut(dx2, dy2) * grad2(this.p, i + 1, j + 1).dot(dx2, dy2)
                                                          ^
TypeError: Cannot read property 'dot' of undefined
    at Simplex2.gen (/Users/martinblech/Documents/projects/warrolight/server/node_modules/tumult/lib/simplex/simplex2.js:30:59)
    at Noise.drawFrame (/Users/martinblech/Documents/projects/warrolight/server/src/light-programs/programs/noise.js:46:17)
    at Timeout.frame [as _onTimeout] (/Users/martinblech/Documents/projects/warrolight/server/src/ProgramScheduler.js:30:20)

Not sure if there's something wrong with our program or this is exposing some bug in tumult. @federicobond can you please take a look?

@federicobond
Copy link
Member

Oh, yes, apparently when the noise function is called with too high a parameter it crashes, we can fix it with a wraparound beyond a certain point. I will do that and also try to make the color differences more marked.

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

2 participants