diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2019-09-04 17:22:47 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2019-09-06 09:35:14 +0300 |
commit | 1b287230a46d98f7cdfe6cbfd6c86e43c7e14968 (patch) | |
tree | 490cfa85d86d1cbd143534dfa515d49c02c0f15c /intern/cycles/blender/blender_shader.cpp | |
parent | f8362836a5c8feff3715ca823025caba249208c2 (diff) |
Viewport Shading: StudioLight Intensity
Add option to change the Intensity of the HDRI in the 3d viewport. This works for both EEVEE and Cycles
Reviewed By: brecht, fclem
Differential Revision: https://developer.blender.org/D5674
Diffstat (limited to 'intern/cycles/blender/blender_shader.cpp')
-rw-r--r-- | intern/cycles/blender/blender_shader.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index f5a76002eb6..de04cc7714a 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -1347,6 +1347,14 @@ void BlenderSync::sync_world(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d, texture_environment->filename = new_viewport_parameters.studiolight_path; graph->add(texture_environment); + MixNode *mix_intensity = new MixNode(); + mix_intensity->type = NODE_MIX_MUL; + mix_intensity->fac = 1.0f; + mix_intensity->color2 = make_float3(new_viewport_parameters.studiolight_intensity, + new_viewport_parameters.studiolight_intensity, + new_viewport_parameters.studiolight_intensity); + graph->add(mix_intensity); + TextureCoordinateNode *texture_coordinate = new TextureCoordinateNode(); graph->add(texture_coordinate); @@ -1359,10 +1367,10 @@ void BlenderSync::sync_world(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d, graph->connect(texture_coordinate->output("Generated"), texture_environment->input("Vector")); + graph->connect(texture_environment->output("Color"), mix_intensity->input("Color1")); graph->connect(light_path->output("Is Camera Ray"), mix_scene_with_background->input("Fac")); - graph->connect(texture_environment->output("Color"), - mix_scene_with_background->input("Color1")); - graph->connect(texture_environment->output("Color"), + graph->connect(mix_intensity->output("Color"), mix_scene_with_background->input("Color1")); + graph->connect(mix_intensity->output("Color"), mix_background_with_environment->input("Color2")); graph->connect(mix_background_with_environment->output("Color"), mix_scene_with_background->input("Color2")); |