-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Fixes for WESL on Windows #18373
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
Merged
Merged
Fixes for WESL on Windows #18373
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,44 @@ | ||
fn make_polka_dots(pos: vec2<f32>, time: f32) -> vec4<f32> { | ||
// Create repeating circles | ||
let scaled_pos = pos * 6.0; | ||
let cell = vec2<f32>(fract(scaled_pos.x), fract(scaled_pos.y)); | ||
let dist_from_center = distance(cell, vec2<f32>(0.5)); | ||
|
||
// Make dots alternate between pink and purple | ||
var dist_from_center = distance(cell, vec2<f32>(0.5)); | ||
|
||
let is_even = (floor(scaled_pos.x) + floor(scaled_pos.y)) % 2.0; | ||
|
||
var dot_color = vec3<f32>(0.0); | ||
var is_dot = 0.0; | ||
|
||
@if(!PARTY_MODE) { | ||
let color1 = vec3<f32>(1.0, 0.4, 0.8); // pink | ||
let color2 = vec3<f32>(0.6, 0.2, 1.0); // purple | ||
dot_color = mix(color1, color2, is_even); | ||
} | ||
// Animate the colors in party mode | ||
@if(PARTY_MODE) { | ||
let color1 = vec3<f32>(1.0, 0.2, 0.2); // red | ||
let color2 = vec3<f32>(0.2, 0.2, 1.0); // blue | ||
let oscillation = (sin(time * 10.0) + 1.0) * 0.5; | ||
let animated_color1 = mix(color1, color2, oscillation); | ||
let animated_color2 = mix(color2, color1, oscillation); | ||
is_dot = step(dist_from_center, 0.3); | ||
} @else { | ||
let grid_x = floor(scaled_pos.x); | ||
let grid_y = floor(scaled_pos.y); | ||
let wave_speed = 3.0; | ||
let wave_phase = time * wave_speed; | ||
|
||
let diagonal_pos = (grid_x + grid_y) * 0.5; | ||
let wave_value = sin(diagonal_pos + wave_phase); | ||
|
||
let wave_normalized = (wave_value + 1.0) * 0.5; | ||
|
||
let color1 = vec3<f32>(1.0, 0.3, 0.7); | ||
let color2 = vec3<f32>(0.5, 0.1, 1.0); | ||
let intense_color1 = vec3<f32>(1.0, 0.1, 0.9); | ||
let intense_color2 = vec3<f32>(0.8, 0.0, 1.0); | ||
|
||
let animated_color1 = mix(color1, intense_color1, wave_normalized); | ||
let animated_color2 = mix(color2, intense_color2, wave_normalized); | ||
|
||
dot_color = mix(animated_color1, animated_color2, is_even); | ||
|
||
let size_mod = 0.15 * wave_value; | ||
dist_from_center = dist_from_center * (1.0 - size_mod); | ||
// Animate whether something is a dot by position but also time | ||
is_dot = step(dist_from_center, 0.3 + wave_normalized * 0.2); | ||
} | ||
|
||
// Draw the dot | ||
let is_dot = step(dist_from_center, 0.3); | ||
return vec4<f32>(dot_color * is_dot, is_dot); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a bit odd... why starting with
/
if you're going to join it with a relative path?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just saw:
// Wesl paths are provided as absolute relative to the asset root
that was removed above. That was useful information I guess. Interesting.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, yeah, I shouldn't have removed that. This in general is kinda messy path mangling atm, it needs to be improved more comprehensively as I mentioned on discord.