Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1#define_import_path bevy_pbr::utils
3const PI: f32 = 3.141592653589793;
5fn saturate(value: f32) -> f32 {
6 return clamp(value, 0.0, 1.0);
7}
9fn hsv2rgb(hue: f32, saturation: f32, value: f32) -> vec3<f32> {
10 let rgb = clamp(
11 abs(
12 ((hue * 6.0 + vec3<f32>(0.0, 4.0, 2.0)) % 6.0) - 3.0
13 ) - 1.0,
14 vec3<f32>(0.0),
15 vec3<f32>(1.0)
16 );
18 return value * mix( vec3<f32>(1.0), rgb, vec3<f32>(saturation));
21fn random1D(s: f32) -> f32 {
22 return fract(sin(s * 12.9898) * 43758.5453123);
Contents