diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2018-05-29 17:21:47 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2018-05-29 17:29:11 +0300 |
commit | 36e9ed98e7cbccdf3e1b3085a4be2679aec5a869 (patch) | |
tree | c6255e4df3a9f0dfb3d9dad788dfea124a90372a /source/blender/draw | |
parent | f98c838b71e264f7f5dad6e953acd599d987ee55 (diff) |
StudioLight: Calculate Specular irradiance
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lookdev.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lookdev.c b/source/blender/draw/engines/eevee/eevee_lookdev.c index f3f51a63f86..78a68583db2 100644 --- a/source/blender/draw/engines/eevee/eevee_lookdev.c +++ b/source/blender/draw/engines/eevee/eevee_lookdev.c @@ -42,12 +42,9 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata, DRWShadingGroup **grp, GPUShad StudioLight *sl = BKE_studiolight_find(v3d->shading.studio_light, STUDIOLIGHT_ORIENTATION_WORLD); if ((sl->flag & STUDIOLIGHT_ORIENTATION_WORLD)) { struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get(); + GPUTexture *tex; - BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_EQUIRECTANGULAR_GPUTEXTURE); *grp = DRW_shgroup_create(shader, pass); - GPUTexture *tex = sl->equirectangular_gputexture; - DRW_shgroup_uniform_texture(*grp, "image", tex); - axis_angle_to_mat3_single(stl->g_data->studiolight_matrix, 'Z', v3d->shading.studiolight_rot_z); DRW_shgroup_uniform_mat3(*grp, "StudioLightMatrix", stl->g_data->studiolight_matrix); @@ -57,7 +54,14 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata, DRWShadingGroup **grp, GPUShad if (!pinfo) { /* Do not fadeout when doing probe rendering, only when drawing the background */ DRW_shgroup_uniform_float(*grp, "studioLightBackground", &v3d->shading.studiolight_background, 1); + + BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_EQUIRECTANGULAR_IRRADIANCE_GPUTEXTURE); + tex = sl->equirectangular_irradiance_gputexture; + } else { + BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_EQUIRECTANGULAR_RADIANCE_GPUTEXTURE); + tex = sl->equirectangular_radiance_gputexture; } + DRW_shgroup_uniform_texture(*grp, "image", tex); /* Do we need to recalc the lightprobes? */ if (pinfo && (pinfo->studiolight_index != sl->index || pinfo->studiolight_rot_z != v3d->shading.studiolight_rot_z)) { |