Skip to content

Commit eff9c1a

Browse files
committed
fix HDRI orientation + flip on loading hdri images
1 parent c38fd70 commit eff9c1a

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

devices/rtx/scene/light/HDRI.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ LightGPUData HDRI::gpuData() const
8888
{
8989
auto retval = Light::gpuData();
9090

91-
const vec3 forward = glm::normalize(-m_direction);
91+
const vec3 forward = glm::normalize(m_direction);
9292
const vec3 right = glm::normalize(glm::cross(m_up, forward));
9393
const vec3 up = glm::normalize(glm::cross(forward, right));
9494

tsd/src/tsd/authoring/importers/detail/HDRImage.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ bool HDRImage::import(std::string fileName)
3333
return false;
3434

3535
if (extension == ".hdr") {
36+
stbi_set_flip_vertically_on_load(1);
3637
int w, h, n;
3738
float *imgData = stbi_loadf(fileName.c_str(), &w, &h, &n, STBI_rgb);
3839
width = w;

tsd/src/tsd/authoring/procedural/generate_hdri_dome.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void generate_hdri_dome(Context &ctx, LayerNodeRef location)
1111
location = ctx.defaultLayer()->root();
1212

1313
auto arr = ctx.createArray(ANARI_FLOAT32_VEC3, 1, 2);
14-
std::vector<float3> colors = {float3(0.8f, 0.8f, 0.8f), float3(0.1f)};
14+
std::vector<float3> colors = {float3(0.1f), float3(0.8f, 0.8f, 0.8f)};
1515
arr->setData(colors.data());
1616

1717
auto [inst, hdri] = ctx.insertNewChildObjectNode<tsd::Light>(

0 commit comments

Comments
 (0)