forked from blender/blender
Support EnvironmentTexture node for world #59
@ -40,8 +40,12 @@ static std::string cache_image_file(Image *image,
|
|||||||
ImageSaveOptions opts;
|
ImageSaveOptions opts;
|
||||||
if (BKE_image_save_options_init(&opts, main, scene, image, iuser, false, false)) {
|
if (BKE_image_save_options_init(&opts, main, scene, image, iuser, false, false)) {
|
||||||
char file_name[32];
|
char file_name[32];
|
||||||
const char *r_ext;
|
const char *r_ext = BLI_path_extension_or_end(image->id.name);
|
||||||
BKE_image_path_ext_from_imformat(&scene->r.im_format, &r_ext);
|
if (!pxr::HioImageRegistry::GetInstance().IsSupportedImageFile(image->id.name)) {
|
||||||
|
BKE_image_path_ext_from_imformat(&scene->r.im_format, &r_ext);
|
||||||
|
opts.im_format = scene->r.im_format;
|
||||||
|
}
|
||||||
|
|
||||||
snprintf(file_name, sizeof(file_name), "img_%016llx%s", (uintptr_t)image, r_ext);
|
snprintf(file_name, sizeof(file_name), "img_%016llx%s", (uintptr_t)image, r_ext);
|
||||||
|
|
||||||
file_path = get_cache_file(file_name);
|
file_path = get_cache_file(file_name);
|
||||||
|
@ -90,7 +90,7 @@ void WorldData::init()
|
|||||||
|
|
||||||
if (!color_input.directly_linked_links().is_empty()) {
|
if (!color_input.directly_linked_links().is_empty()) {
|
||||||
bNode *color_input_node = color_input.directly_linked_links()[0]->fromnode;
|
bNode *color_input_node = color_input.directly_linked_links()[0]->fromnode;
|
||||||
if (color_input_node->type == SH_NODE_TEX_IMAGE) {
|
if (ELEM(color_input_node->type, SH_NODE_TEX_IMAGE, SH_NODE_TEX_ENVIRONMENT)) {
|
||||||
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) {
|
if (image) {
|
||||||
@ -176,13 +176,11 @@ void WorldData::write_transform()
|
|||||||
{
|
{
|
||||||
transform = pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), -90), pxr::GfVec3d());
|
transform = pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), -90), pxr::GfVec3d());
|
||||||
|
|
||||||
/* TODO : do this check via RenderSettings*/
|
transform *= pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), -180),
|
||||||
if (scene_delegate_->engine->render_delegate_name == "HdRprPlugin") {
|
pxr::GfVec3d());
|
||||||
transform *= pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), -180),
|
transform *= pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(0.0, 0.0, 1.0), 90.0),
|
||||||
pxr::GfVec3d());
|
pxr::GfVec3d());
|
||||||
transform *= pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(0.0, 0.0, 1.0), 90.0),
|
|
||||||
pxr::GfVec3d());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace blender::render::hydra
|
} // namespace blender::render::hydra
|
||||||
|
Loading…
Reference in New Issue
Block a user