forked from blender/blender
Implement Viewport render with material preview #56
@ -102,23 +102,22 @@ void WorldData::init()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (LOOK_DEV_STUDIO_LIGHT_ENABLED(scene_delegate_->view3d)) {
|
||||
StudioLight *sl = BKE_studiolight_find(scene_delegate_->view3d->shading.lookdev_light,
|
||||
STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE);
|
||||
if (sl == NULL || (sl->flag & STUDIOLIGHT_TYPE_WORLD) == 0) {
|
||||
return;
|
||||
}
|
||||
data_[pxr::HdLightTokens->textureFile] = pxr::SdfAssetPath(sl->filepath, sl->filepath);
|
||||
/* coefficient to follow Cycles result */
|
||||
data_[pxr::HdLightTokens->intensity] = scene_delegate_->view3d->shading.studiolight_intensity / 2;
|
||||
|
||||
transform *= pxr::GfMatrix4d(
|
||||
pxr::GfRotation(pxr::GfVec3d(0.0, 0.0, -1.0),
|
||||
RAD2DEGF(scene_delegate_->view3d->shading.studiolight_rot_z)),
|
||||
pxr::GfVec3d());
|
||||
}
|
||||
else {
|
||||
data_[pxr::HdLightTokens->intensity] = 1.0f;
|
||||
float intensity = 1.0f;
|
||||
if (LOOK_DEV_STUDIO_LIGHT_ENABLED(scene_delegate_->view3d)) {
|
||||
StudioLight *sl = BKE_studiolight_find(scene_delegate_->view3d->shading.lookdev_light,
|
||||
STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE);
|
||||
if (sl != NULL && sl->flag & STUDIOLIGHT_TYPE_WORLD) {
|
||||
data_[pxr::HdLightTokens->textureFile] = pxr::SdfAssetPath(sl->filepath, sl->filepath);
|
||||
transform *= pxr::GfMatrix4d(
|
||||
pxr::GfRotation(pxr::GfVec3d(0.0, 0.0, -1.0),
|
||||
RAD2DEGF(scene_delegate_->view3d->shading.studiolight_rot_z)),
|
||||
pxr::GfVec3d());
|
||||
/* coefficient to follow Cycles result */
|
||||
intensity = scene_delegate_->view3d->shading.studiolight_intensity / 2;
|
||||
}
|
||||
}
|
||||
data_[pxr::HdLightTokens->intensity] = intensity;
|
||||
BogdanNagirniak marked this conversation as resolved
Outdated
|
||||
data_[pxr::HdLightTokens->exposure] = world->exposure;
|
||||
data_[pxr::HdLightTokens->color] = pxr::GfVec3f(world->horr, world->horg, world->horb);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user
thif
if
can be removed