Skip to content

Commit

Permalink
Use wgsl saturate (bevyengine#6318)
Browse files Browse the repository at this point in the history
# Objective

Use saturate wgsl function now implemented in naga (version 0.10.0). There is now no need for one in utils.wgsl.

naga's version allows usage for not only scalars but vectors as well.

## Solution

Remove the utils.wgsl saturate function.

## Changelog

Remove saturate function from utils.wgsl in favor of saturate in naga v0.10.0.
  • Loading branch information
torsteingrindvik authored and james7132 committed Oct 28, 2022
1 parent 02eb091 commit 3fd5616
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions crates/bevy_pbr/src/render/utils.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

let PI: f32 = 3.141592653589793;

fn saturate(value: f32) -> f32 {
return clamp(value, 0.0, 1.0);
}

fn hsv2rgb(hue: f32, saturation: f32, value: f32) -> vec3<f32> {
let rgb = clamp(
abs(
Expand Down

0 comments on commit 3fd5616

Please sign in to comment.