47 float intensity = 1.0f;
48 float exposure = 1.0f;
49 pxr::GfVec3f color(1.0f, 1.0f, 1.0f);
50 pxr::SdfAssetPath texture_file;
54 ID_LOG(1,
"%s", world->id.name);
56 exposure = world->exposure;
57 if (world->use_nodes) {
67 for (
auto socket : input_sockets) {
68 if (
STREQ(socket->name,
"Surface")) {
69 input_socket = socket;
76 if (input_socket->directly_linked_links().is_empty()) {
79 bNodeLink const *link = input_socket->directly_linked_links()[0];
82 if (input_node->
type != SH_NODE_BACKGROUND) {
86 const bNodeSocket &color_input = input_node->input_by_identifier(
"Color");
87 const bNodeSocket &strength_input = input_node->input_by_identifier(
"Strength");
89 float const *strength = strength_input.default_value_typed<
float>();
90 float const *input_color = color_input.default_value_typed<
float>();
91 intensity = strength[1];
92 color = pxr::GfVec3f(input_color[0], input_color[1], input_color[2]);
94 if (!color_input.directly_linked_links().is_empty()) {
95 bNode *color_input_node = color_input.directly_linked_links()[0]->fromnode;
102 if (!image_path.empty()) {
103 texture_file = pxr::SdfAssetPath(image_path, image_path);
111 color = pxr::GfVec3f(world->horr, world->horg, world->horb);
114 if (texture_file.GetAssetPath().empty()) {
115 float fill_color[4] = {color[0], color[1], color[2], 1.0f};
117 texture_file = pxr::SdfAssetPath(image_path, image_path);
133 data_[pxr::UsdLuxTokens->orientToStageUpAxis] =
true;
134 data_[pxr::HdLightTokens->intensity] = intensity;
135 data_[pxr::HdLightTokens->exposure] = exposure;
136 data_[pxr::HdLightTokens->color] = color;
137 data_[pxr::HdLightTokens->textureFile] = texture_file;
165 transform = pxr::GfMatrix4d().SetRotate(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), 90.0)) *
166 pxr::GfMatrix4d().SetRotate(pxr::GfRotation(pxr::GfVec3d(0.0, 0.0, 1.0), 90.0));
168 transform *= pxr::GfMatrix4d().SetRotate(
169 pxr::GfRotation(pxr::GfVec3d(0.0, 0.0, -1.0),