Parameters
Name | Type | Description |
---|---|---|
color | vec3<f32> | Linear RGB color values. |
Returns
vec3<f32>color values.
WGSL Code
fn linearToSrgb(color: vec3<f32>) -> vec3<f32> {return pow(color, vec3(1.0 / 2.2));}
Name | Type | Description |
---|---|---|
color | vec3<f32> | Linear RGB color values. |
fn linearToSrgb(color: vec3<f32>) -> vec3<f32> {return pow(color, vec3(1.0 / 2.2));}
A JavaScript library providing WGSL utility functions as strings for WebGPU shader development. Includes mathematical utilities, noise generation, signed distance fields, and color manipulation functions.
npm install wgsl-fns
import { linearToSrgb, getFns } from 'wgsl-fns'
getFns(['linearToSrgb'])