Parameters
Name | Type | Description |
---|---|---|
color | vec3<f32> | sRGB color values. |
Returns
vec3<f32>RGB color values.
WGSL Code
fn srgbToLinear(color: vec3<f32>) -> vec3<f32> {return pow(color, vec3(2.2));}
Name | Type | Description |
---|---|---|
color | vec3<f32> | sRGB color values. |
fn srgbToLinear(color: vec3<f32>) -> vec3<f32> {return pow(color, vec3(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 { srgbToLinear, getFns } from 'wgsl-fns'
getFns(['srgbToLinear'])