Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_material.glsl
| Show First 20 Lines • Show All 1,083 Lines • ▼ Show 20 Lines | void convert_metallic_to_specular_tinted( | ||||
| vec3 tmp_col = mix(vec3(1.0), basecol_tint, specular_tint); | vec3 tmp_col = mix(vec3(1.0), basecol_tint, specular_tint); | ||||
| f0 = mix((0.08 * specular_fac) * tmp_col, basecol, metallic); | f0 = mix((0.08 * specular_fac) * tmp_col, basecol, metallic); | ||||
| diffuse = basecol * (1.0 - metallic); | diffuse = basecol * (1.0 - metallic); | ||||
| } | } | ||||
| vec3 principled_sheen(float NV, vec3 basecol_tint, float sheen_tint) | vec3 principled_sheen(float NV, vec3 basecol_tint, float sheen_tint) | ||||
| { | { | ||||
| float f = 1.0 - NV; | float f = 1.0 - NV; | ||||
| /* Temporary fix for T59784. Normal map seems to contain NaNs for tangent space normal maps, therefore we need to clamp value. */ | |||||
brecht: Temporal -> Temporary | |||||
| f = clamp(f, 0.0, 1.0); | |||||
Not Done Inline ActionsThe following fit is only valid for N.V in [0..1] range. So it might even be better to clamp(f, 0.0, 1.0) instead. fclem: The following fit is only valid for N.V in [0..1] range. So it might even be better to clamp(f… | |||||
| /* Empirical approximation (manual curve fitting). Can be refined. */ | /* Empirical approximation (manual curve fitting). Can be refined. */ | ||||
| float sheen = f*f*f*0.077 + f*0.01 + 0.00026; | float sheen = f*f*f*0.077 + f*0.01 + 0.00026; | ||||
| return sheen * mix(vec3(1.0), basecol_tint, sheen_tint); | return sheen * mix(vec3(1.0), basecol_tint, sheen_tint); | ||||
| } | } | ||||
| #ifndef VOLUMETRICS | #ifndef VOLUMETRICS | ||||
| void node_bsdf_diffuse(vec4 color, float roughness, vec3 N, out Closure result) | void node_bsdf_diffuse(vec4 color, float roughness, vec3 N, out Closure result) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 2,013 Lines • Show Last 20 Lines | |||||
Temporal -> Temporary