diff options
author | Alex Strand <astrand130> | 2020-09-09 12:36:57 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-09-17 19:54:04 +0300 |
commit | b248ec97769fa654a3ee8bb2a643046b79e7c030 (patch) | |
tree | 57604691dd62e4b19b9df5d4109a8dc3f83bacb8 /source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl | |
parent | 65fd005312848178509b0a0b0f3febf9f777f529 (diff) |
Shaders: add emission strength input to Principled BSDF node
This impacts I/O add-ons. OBJ, FBX and Collada have been updated, glTF not yet.
Differential Revision: https://developer.blender.org/D4971
Diffstat (limited to 'source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl')
-rw-r--r-- | source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl index 80ed4e1ef69..1f5851c17d2 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl @@ -54,6 +54,7 @@ void node_bsdf_principled(vec4 base_color, float transmission, float transmission_roughness, vec4 emission, + float emission_strength, float alpha, vec3 N, vec3 CN, @@ -134,7 +135,7 @@ void node_bsdf_principled(vec4 base_color, result.radiance += render_pass_glossy_mask(spec_col, out_spec); /* Coarse approx. */ result.radiance += render_pass_diffuse_mask(sheen_color, out_diff * out_sheen * sheen_color); - result.radiance += render_pass_emission_mask(emission.rgb); + result.radiance += render_pass_emission_mask(emission.rgb * emission_strength); result.radiance *= alpha; closure_load_ssr_data(ssr_spec * alpha, roughness, N, viewCameraVec, int(ssr_id), result); @@ -161,6 +162,7 @@ void node_bsdf_principled_dielectric(vec4 base_color, float transmission, float transmission_roughness, vec4 emission, + float emission_strength, float alpha, vec3 N, vec3 CN, @@ -193,7 +195,7 @@ void node_bsdf_principled_dielectric(vec4 base_color, result.radiance = render_pass_glossy_mask(vec3(1.0), out_spec); result.radiance += render_pass_diffuse_mask(sheen_color, out_diff * out_sheen * sheen_color); result.radiance += render_pass_diffuse_mask(diffuse, out_diff * diffuse); - result.radiance += render_pass_emission_mask(emission.rgb); + result.radiance += render_pass_emission_mask(emission.rgb * emission_strength); result.radiance *= alpha; closure_load_ssr_data(ssr_spec * alpha, roughness, N, viewCameraVec, int(ssr_id), result); @@ -218,6 +220,7 @@ void node_bsdf_principled_metallic(vec4 base_color, float transmission, float transmission_roughness, vec4 emission, + float emission_strength, float alpha, vec3 N, vec3 CN, @@ -238,7 +241,7 @@ void node_bsdf_principled_metallic(vec4 base_color, result = CLOSURE_DEFAULT; result.radiance = render_pass_glossy_mask(vec3(1.0), out_spec); - result.radiance += render_pass_emission_mask(emission.rgb); + result.radiance += render_pass_emission_mask(emission.rgb * emission_strength); result.radiance *= alpha; closure_load_ssr_data(ssr_spec * alpha, roughness, N, viewCameraVec, int(ssr_id), result); @@ -263,6 +266,7 @@ void node_bsdf_principled_clearcoat(vec4 base_color, float transmission, float transmission_roughness, vec4 emission, + float emission_strength, float alpha, vec3 N, vec3 CN, @@ -295,7 +299,7 @@ void node_bsdf_principled_clearcoat(vec4 base_color, result = CLOSURE_DEFAULT; result.radiance = render_pass_glossy_mask(vec3(spec_col), out_spec); - result.radiance += render_pass_emission_mask(emission.rgb); + result.radiance += render_pass_emission_mask(emission.rgb * emission_strength); result.radiance *= alpha; closure_load_ssr_data(ssr_spec * alpha, roughness, N, viewCameraVec, int(ssr_id), result); @@ -321,6 +325,7 @@ void node_bsdf_principled_subsurface(vec4 base_color, float transmission, float transmission_roughness, vec4 emission, + float emission_strength, float alpha, vec3 N, vec3 CN, @@ -365,7 +370,7 @@ void node_bsdf_principled_subsurface(vec4 base_color, result = CLOSURE_DEFAULT; result.radiance = render_pass_glossy_mask(vec3(1.0), out_spec); result.radiance += render_pass_diffuse_mask(sheen_color, out_diff * out_sheen * sheen_color); - result.radiance += render_pass_emission_mask(emission.rgb); + result.radiance += render_pass_emission_mask(emission.rgb * emission_strength); result.radiance *= alpha; closure_load_ssr_data(ssr_spec * alpha, roughness, N, viewCameraVec, int(ssr_id), result); @@ -394,6 +399,7 @@ void node_bsdf_principled_glass(vec4 base_color, float transmission, float transmission_roughness, vec4 emission, + float emission_strength, float alpha, vec3 N, vec3 CN, @@ -436,7 +442,7 @@ void node_bsdf_principled_glass(vec4 base_color, result = CLOSURE_DEFAULT; result.radiance = render_pass_glossy_mask(refr_color, out_refr * refr_color); result.radiance += render_pass_glossy_mask(spec_col, out_spec * spec_col); - result.radiance += render_pass_emission_mask(emission.rgb); + result.radiance += render_pass_emission_mask(emission.rgb * emission_strength); result.radiance *= alpha; closure_load_ssr_data(ssr_spec * alpha, roughness, N, viewCameraVec, int(ssr_id), result); result.transmittance = vec3(1.0 - alpha); |