Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_lookdev.c
| Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | #endif | ||||
| * Needs to be addressed properly (color managed using ocio). */ | * Needs to be addressed properly (color managed using ocio). */ | ||||
| srgb_to_linearrgb_v4(background_color, background_color); | srgb_to_linearrgb_v4(background_color, background_color); | ||||
| *grp = DRW_shgroup_create(shader, pass); | *grp = DRW_shgroup_create(shader, pass); | ||||
| axis_angle_to_mat3_single( | axis_angle_to_mat3_single( | ||||
| stl->g_data->studiolight_matrix, 'Z', v3d->shading.studiolight_rot_z); | stl->g_data->studiolight_matrix, 'Z', v3d->shading.studiolight_rot_z); | ||||
| DRW_shgroup_uniform_mat3(*grp, "StudioLightMatrix", stl->g_data->studiolight_matrix); | DRW_shgroup_uniform_mat3(*grp, "StudioLightMatrix", stl->g_data->studiolight_matrix); | ||||
| DRW_shgroup_uniform_float_copy(*grp, "backgroundAlpha", background_alpha); | DRW_shgroup_uniform_float_copy(*grp, "backgroundAlpha", background_alpha); | ||||
| DRW_shgroup_uniform_float( | |||||
| *grp, "studioLightIntensity", &v3d->shading.studiolight_intensity, 1); | |||||
| DRW_shgroup_uniform_vec3(*grp, "color", background_color, 1); | DRW_shgroup_uniform_vec3(*grp, "color", background_color, 1); | ||||
| DRW_shgroup_call(*grp, geom, NULL); | DRW_shgroup_call(*grp, geom, NULL); | ||||
| if (!pinfo) { | if (!pinfo) { | ||||
| /* Do not fadeout when doing probe rendering, only when drawing the background */ | /* Do not fadeout when doing probe rendering, only when drawing the background */ | ||||
| DRW_shgroup_uniform_float( | DRW_shgroup_uniform_float( | ||||
| *grp, "studioLightBackground", &v3d->shading.studiolight_background, 1); | *grp, "studioLightBackground", &v3d->shading.studiolight_background, 1); | ||||
| BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_EQUIRECT_IRRADIANCE_GPUTEXTURE); | BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_EQUIRECT_IRRADIANCE_GPUTEXTURE); | ||||
| tex = sl->equirect_irradiance_gputexture; | tex = sl->equirect_irradiance_gputexture; | ||||
| } | } | ||||
| else { | else { | ||||
| DRW_shgroup_uniform_float_copy(*grp, "studioLightBackground", 1.0f); | DRW_shgroup_uniform_float_copy(*grp, "studioLightBackground", 1.0f); | ||||
| BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_EQUIRECT_RADIANCE_GPUTEXTURE); | BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_EQUIRECT_RADIANCE_GPUTEXTURE); | ||||
| tex = sl->equirect_radiance_gputexture; | tex = sl->equirect_radiance_gputexture; | ||||
| } | } | ||||
| DRW_shgroup_uniform_texture(*grp, "image", tex); | DRW_shgroup_uniform_texture(*grp, "image", tex); | ||||
| /* Do we need to recalc the lightprobes? */ | /* Do we need to recalc the lightprobes? */ | ||||
| if (g_data->studiolight_index != sl->index || | if (g_data->studiolight_index != sl->index || | ||||
| g_data->studiolight_rot_z != v3d->shading.studiolight_rot_z || | g_data->studiolight_rot_z != v3d->shading.studiolight_rot_z || | ||||
| g_data->studiolight_intensity != v3d->shading.studiolight_intensity || | |||||
| g_data->studiolight_cubemap_res != scene->eevee.gi_cubemap_resolution || | g_data->studiolight_cubemap_res != scene->eevee.gi_cubemap_resolution || | ||||
| g_data->studiolight_glossy_clamp != scene->eevee.gi_glossy_clamp || | g_data->studiolight_glossy_clamp != scene->eevee.gi_glossy_clamp || | ||||
| g_data->studiolight_filter_quality != scene->eevee.gi_filter_quality) { | g_data->studiolight_filter_quality != scene->eevee.gi_filter_quality) { | ||||
| stl->lookdev_lightcache->flag |= LIGHTCACHE_UPDATE_WORLD; | stl->lookdev_lightcache->flag |= LIGHTCACHE_UPDATE_WORLD; | ||||
| g_data->studiolight_index = sl->index; | g_data->studiolight_index = sl->index; | ||||
| g_data->studiolight_rot_z = v3d->shading.studiolight_rot_z; | g_data->studiolight_rot_z = v3d->shading.studiolight_rot_z; | ||||
| g_data->studiolight_intensity = v3d->shading.studiolight_intensity; | |||||
| g_data->studiolight_cubemap_res = scene->eevee.gi_cubemap_resolution; | g_data->studiolight_cubemap_res = scene->eevee.gi_cubemap_resolution; | ||||
| g_data->studiolight_glossy_clamp = scene->eevee.gi_glossy_clamp; | g_data->studiolight_glossy_clamp = scene->eevee.gi_glossy_clamp; | ||||
| g_data->studiolight_filter_quality = scene->eevee.gi_filter_quality; | g_data->studiolight_filter_quality = scene->eevee.gi_filter_quality; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines | |||||