Shader Explorer
Advanced search tips: use spaces to require multiple terms (AND), | for alternatives (OR), wrap phrases in quotes (="a b"), =term for exact match, 'term to include, !term to exclude, ^term to match prefix, !^term to exclude prefix, .ext$ to match suffix, and !.ext$ to exclude suffix.

fragment.wgsl

Constants

SSS_DISTORTION

#
const SSS_DISTORTION: f32 = 0.5

SSS_WRAP

#
const SSS_WRAP: f32 = 0.2

SSS_WRAP_INV

#
const SSS_WRAP_INV: f32 = 1.0 / (1.0 + SSS_WRAP)

LIGHT_INTENSITY_SCALE

#
const LIGHT_INTENSITY_SCALE: AbstractFloat = 0.00005

Functions

fragment

#
@fragment
Calculates the final color of each pixel on the screen
fn fragment (
@builtin(front_facing)
is_front: bool
) -> FragmentOutput

calculate_sss_lighting

#
fn calculate_sss_lighting (
scale: f32
intensity: f32
pbr_input: PbrInput
thinness_factor: f32
) -> vec3<f32>