forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,976 additions
and
414 deletions.
There are no files selected for viewing
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// This shader draws a circle with a given input color | ||
#import bevy_ui::ui_vertex_output::UiVertexOutput | ||
|
||
struct CustomUiMaterial { | ||
@location(0) color: vec4<f32> | ||
} | ||
|
||
@group(1) @binding(0) | ||
var<uniform> input: CustomUiMaterial; | ||
|
||
@fragment | ||
fn fragment(in: UiVertexOutput) -> @location(0) vec4<f32> { | ||
// the UVs are now adjusted around the middle of the rect. | ||
let uv = in.uv * 2.0 - 1.0; | ||
|
||
// circle alpha, the higher the power the harsher the falloff. | ||
let alpha = 1.0 - pow(sqrt(dot(uv, uv)), 100.0); | ||
|
||
return vec4<f32>(input.color.rgb, alpha); | ||
} | ||
|
Oops, something went wrong.