Implement Viewport render with material preview #56

Merged
Bogdan Nagirniak merged 22 commits from BLEN-421 into hydra-render 2023-06-30 09:03:28 +02:00
Showing only changes of commit 9e0347a577 - Show all commits

View File

@ -118,16 +118,17 @@ void WorldData::init()
} }
else { else {
if (scene_delegate_->view3d && !scene_delegate_->shading_settings.use_scene_world) { if (scene_delegate_->view3d && !scene_delegate_->shading_settings.use_scene_world) {
StudioLight *sl = BKE_studiolight_find(scene_delegate_->view3d->shading.lookdev_light, StudioLight *sl = BKE_studiolight_find(
STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE); scene_delegate_->shading_settings.studiolight_name.c_str(),
STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE);
if (sl != NULL && sl->flag & STUDIOLIGHT_TYPE_WORLD) { if (sl != NULL && sl->flag & STUDIOLIGHT_TYPE_WORLD) {
texture_file = pxr::SdfAssetPath(sl->filepath, sl->filepath); texture_file = pxr::SdfAssetPath(sl->filepath, sl->filepath);
transform *= pxr::GfMatrix4d( transform *= pxr::GfMatrix4d(
pxr::GfRotation(pxr::GfVec3d(0.0, 0.0, -1.0), pxr::GfRotation(pxr::GfVec3d(0.0, 0.0, -1.0),
RAD2DEGF(scene_delegate_->view3d->shading.studiolight_rot_z)), RAD2DEGF(scene_delegate_->shading_settings.studiolight_rotation)),
pxr::GfVec3d()); pxr::GfVec3d());
/* coefficient to follow Cycles result */ /* coefficient to follow Cycles result */
intensity = scene_delegate_->view3d->shading.studiolight_intensity / 2; intensity = scene_delegate_->shading_settings.studiolight_intensity / 2;
} }
} }
} }