Add IBL support #29

Merged
Bogdan Nagirniak merged 5 commits from BLEN-385 into hydra-render 2023-04-27 09:25:11 +02:00
Showing only changes of commit d5ead16c0b - Show all commits

View File

@ -95,6 +95,7 @@ void WorldData::init()
if (color_input_node->type == SH_NODE_TEX_IMAGE) { if (color_input_node->type == SH_NODE_TEX_IMAGE) {
NodeTexImage *tex = static_cast<NodeTexImage *>(color_input_node->storage); NodeTexImage *tex = static_cast<NodeTexImage *>(color_input_node->storage);
Image *image = (Image *)color_input_node->id; Image *image = (Image *)color_input_node->id;
if (image) {
std::string image_path = cache_or_get_image_file(image, scene_delegate_, &tex->iuser); std::string image_path = cache_or_get_image_file(image, scene_delegate_, &tex->iuser);
if (!image_path.empty()) { if (!image_path.empty()) {
data_[pxr::HdLightTokens->textureFile] = pxr::SdfAssetPath(image_path, image_path); data_[pxr::HdLightTokens->textureFile] = pxr::SdfAssetPath(image_path, image_path);
@ -102,6 +103,7 @@ void WorldData::init()
} }
} }
} }
}
else { else {
data_[pxr::HdLightTokens->intensity] = 1.0f; data_[pxr::HdLightTokens->intensity] = 1.0f;
data_[pxr::HdLightTokens->exposure] = world->exposure; data_[pxr::HdLightTokens->exposure] = world->exposure;