pbr_lighting.wgsl
Name | Type |
---|---|
N |
vec3<f32>
![]() |
R |
vec3<f32>
![]() |
NdotV |
f32
![]() |
perceptual_roughness |
f32
![]() |
roughness |
f32
![]() |
point_light`, `spot_light
,
directional_light
).Name | Type | Shader Def |
---|---|---|
layers |
array<LayerLightingInput, 2>
![]() |
🟢 STANDARD_MATERIAL_CLEARCOAT |
layers |
array<LayerLightingInput, 1>
![]() |
🟢 STANDARD_MATERIAL_CLEARCOAT |
P |
vec3<f32>
![]() |
|
V |
vec3<f32>
![]() |
|
diffuse_color |
vec3<f32>
![]() |
|
F0_ |
vec3<f32>
![]() |
|
F_ab |
vec2<f32>
![]() |
|
clearcoat_strength |
f32
![]() |
🟢 STANDARD_MATERIAL_CLEARCOAT |
anisotropy |
f32
![]() |
🟢 STANDARD_MATERIAL_ANISOTROPY |
Ta |
vec3<f32>
![]() |
🟢 STANDARD_MATERIAL_ANISOTROPY |
Ba |
vec3<f32>
![]() |
🟢 STANDARD_MATERIAL_ANISOTROPY |
LightingInput
for both diffuse and specular lights.Name | Type |
---|---|
H |
vec3<f32>
![]() |
NdotL |
f32
![]() |
NdotH |
f32
![]() |
LdotH |
f32
![]() |
Parameter | Type |
---|---|
distanceSquare |
f32
![]() |
inverseRangeSquared |
f32
![]() |
Parameter | Type |
---|---|
roughness |
f32
![]() |
NdotH |
f32
![]() |
h |
vec3<f32>
![]() |
T
= 𝐭 = the tangent direction = the direction of increased roughness.
* B
= 𝐛 = the bitangent direction = the direction of decreased roughness.
* at
= αₜ = the alpha-roughness in the tangent direction.
* ab
= α_b = the alpha-roughness in the bitangent direction.
This is from the KHR_materials_anisotropy
spec:
<https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_anisotropy/README.md#individual-lights>Parameter | Type |
---|---|
at |
f32
![]() |
ab |
f32
![]() |
NdotH |
f32
![]() |
TdotH |
f32
![]() |
BdotH |
f32
![]() |
Parameter | Type |
---|---|
roughness |
f32
![]() |
NdotV |
f32
![]() |
NdotL |
f32
![]() |
Parameter | Type |
---|---|
at |
f32
![]() |
ab |
f32
![]() |
NdotL |
f32
![]() |
NdotV |
f32
![]() |
BdotV |
f32
![]() |
TdotV |
f32
![]() |
TdotL |
f32
![]() |
BdotL |
f32
![]() |
Parameter | Type |
---|---|
LdotH |
f32
![]() |
Parameter | Type |
---|---|
f0 |
vec3<f32>
![]() |
f90 |
f32
![]() |
VdotH |
f32
![]() |
Parameter | Type |
---|---|
f0 |
f32
![]() |
f90 |
f32
![]() |
VdotH |
f32
![]() |
Parameter | Type |
---|---|
f0 |
vec3<f32>
![]() |
LdotH |
f32
![]() |
Parameter | Type |
---|---|
input |
ptr<function, LightingInput>
![]() |
D |
f32
![]() |
V |
f32
![]() |
F |
vec3<f32>
![]() |
specular_intensity |
f32
![]() |
Parameter | Type |
---|---|
N |
vec3<f32>
![]() |
V |
vec3<f32>
![]() |
L |
vec3<f32>
![]() |
xyz` components and the specular intensity in the `w
component.Parameter | Type |
---|---|
input |
ptr<function, LightingInput>
![]() |
layer |
u32
![]() |
V |
vec3<f32>
![]() |
light_to_frag |
vec3<f32>
![]() |
light_position_radius |
f32
![]() |
Parameter | Type |
---|---|
input |
ptr<function, LightingInput>
![]() |
derived_input |
ptr<function, DerivedLightingInput>
![]() |
specular_intensity |
f32
![]() |
Parameter | Type |
---|---|
input |
ptr<function, LightingInput>
![]() |
derived_input |
ptr<function, DerivedLightingInput>
![]() |
clearcoat_strength |
f32
![]() |
specular_intensity |
f32
![]() |
🟢 STANDARD_MATERIAL_ANISOTROPY
Parameter | Type |
---|---|
input |
ptr<function, LightingInput>
![]() |
derived_input |
ptr<function, DerivedLightingInput>
![]() |
L |
vec3<f32>
![]() |
specular_intensity |
f32
![]() |
Parameter | Type |
---|---|
input |
ptr<function, LightingInput>
![]() |
derived_input |
ptr<function, DerivedLightingInput>
![]() |
Parameter | Type |
---|---|
perceptual_roughness |
f32
![]() |
NdotV |
f32
![]() |
Parameter | Type |
---|---|
F0 |
vec3<f32>
![]() |
F_ab |
vec2<f32>
![]() |
Parameter | Type |
---|---|
perceptualRoughness |
f32
![]() |
Parameter | Type |
---|---|
light_id |
u32
![]() |
input |
ptr<function, LightingInput>
![]() |
Parameter | Type |
---|---|
light_id |
u32
![]() |
input |
ptr<function, LightingInput>
![]() |
Parameter | Type |
---|---|
light_id |
u32
![]() |
input |
ptr<function, LightingInput>
![]() |