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

🪲 Allow glitch to distort the left side of the window #289

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Kurtoid
Copy link
Contributor

@Kurtoid Kurtoid commented Jan 24, 2023

Glitch (and TV-Glitch) clamps the noise to a positive value, and squares it later, making noise positive only. As a result, the left border can be distorted right, but never left. This commit changes the clamping from 0,1 to -1,1, and adds a sign call to the squaring operation.

TODO: obs before/after recordings when I get home see next comment

@Kurtoid
Copy link
Contributor Author

Kurtoid commented Jan 25, 2023

glitch_fix.mp4
original_glitch.mp4

@Kurtoid Kurtoid changed the title 🪲 allow glitch to distort the left side of the window 🪲 Allow glitch to distort the left side of the window Jan 25, 2023
@Kurtoid Kurtoid marked this pull request as ready for review January 25, 2023 05:23
@Schneegans
Copy link
Owner

Hey, thanks again! However, I am a bit hesitant as to whether I want to merge this. The clamping was done on purpose. It does not only affect the left border, but the whole window: Due to the clamping, the primary waves will only distort the window if the noise value is positive, if it's negative, nothing will happen. The idea of this is, that there are periods in which the window is not distorted at all. Then, suddenly there is abrupt distortion to the right.

You can see this quite nicely in original shader onto which I have built these effects: https://www.shadertoy.com/view/XtK3W3. Here, the primary waves are clamped to the left with the max in line 85. You can see the effect by removing the max: Just replace line 85 in that shader with float noise = snoise(vec2(time, uv.y * 0.3)) * (1.0 / 0.7);. The result is a constantly moving, wavy effect. However, I think that I personally like the occasional glitches more.

One could try to think of a variant which occasionally distorts the window either to the left or to the right. Like scaling the noise into the rage [-2...2]. If it's then in [-1...1] it should be set to zero (no distortion) if its in [-2...-1] it is increased by one into [-1...0] (distortion to the left) and else its reduced by one into [0...1] for distorting to the right.

What do you think?

@Kurtoid
Copy link
Contributor Author

Kurtoid commented Jan 26, 2023

Whoops, I see what you mean - thank you for explaining. The variant idea sounds like a good way to preserve the intended behavior. I'll give it a try

@Kurtoid
Copy link
Contributor Author

Kurtoid commented Jan 30, 2023

Coursework picked back up. I think I have an idea of how to make it work, but not done yet

@Kurtoid
Copy link
Contributor Author

Kurtoid commented Nov 2, 2023

That should do the trick

@Schneegans
Copy link
Owner

Hi there! Thanks for getting back to this! I just used this for a couple of hours and I am a bit hesitant. I still have the feeling that the effect is more "wavy" and less "glitchy" in this current form. Maybe we can increase the "dead-zone" of the noise where no effect is applied? But maybe it actually is the asymmetry which emphasizes the glitchy appearance...

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