Skip to content

Conversation

beaufortfrancois
Copy link
Collaborator

FIX #458

Copy link
Contributor

@mwyrzykowski mwyrzykowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

rand_seed = fract(rand_seed * cos(35.456+f32(invocation_id) * seed.yw));
rand_seed = fract(rand_seed * cos(41.235+f32(invocation_id) * seed.xw));
rand_seed = fract(rand_seed * cos(35.456+f32(invocation_id) * seed.yw * 0.01f));
rand_seed = fract(rand_seed * cos(41.235+f32(invocation_id) * seed.xw * 0.01f));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this is probably only necessary because seed.x and seed.y can be large:

Math.random() * 100,
Math.random() * 100, // seed.xy
1 + Math.random(),
1 + Math.random(), // seed.zw

Could we just adjust the seed instead so it's not so large? I'm not sure what effect it would have.

@beaufortfrancois
Copy link
Collaborator Author

I think I've found what cause this weird behavior. When adding brightnessFactor to UBO buffer in #432, I made a mistake. This PR fixes it.

@kainino0x
Copy link
Collaborator

Oh! Fantastic!

@kainino0x kainino0x merged commit 96b4556 into webgpu:main Oct 28, 2024
1 check passed
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.

Address Particles HDR sample blue trail

3 participants