From 43c7171c2da0852f97f8674265eb59f4696b1659 Mon Sep 17 00:00:00 2001 From: iaomw Date: Thu, 19 Dec 2024 20:28:59 +0800 Subject: [PATCH 1/2] Fix IES loading --- zenovis/xinxinoptix/OptiXStuff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/zenovis/xinxinoptix/OptiXStuff.h b/zenovis/xinxinoptix/OptiXStuff.h index 62bad9215..e239a87a3 100644 --- a/zenovis/xinxinoptix/OptiXStuff.h +++ b/zenovis/xinxinoptix/OptiXStuff.h @@ -963,6 +963,7 @@ inline void addTexture(std::string path, bool blockCompression=false, TaskType* CUDA_CHECK( cudaMemcpy( reinterpret_cast( (CUdeviceptr)iesBuffer ), iesd.data(), data_length, cudaMemcpyHostToDevice ) ); g_ies[path] = {std::move(iesBuffer), coneAngle }; + return; } else if (zeno::getSession().nodeClasses.count("ReadPNG16") > 0 && zeno::ends_with(path, ".png", false)) { auto outs = zeno::TempNodeSimpleCaller("ReadPNG16") From cbab21d394515346dafa330e89976117f5f7ad23 Mon Sep 17 00:00:00 2001 From: iaomw Date: Thu, 19 Dec 2024 20:30:38 +0800 Subject: [PATCH 2/2] Minor update --- zenovis/xinxinoptix/Light.cu | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/zenovis/xinxinoptix/Light.cu b/zenovis/xinxinoptix/Light.cu index 8d3f5cd56..e77827e6d 100644 --- a/zenovis/xinxinoptix/Light.cu +++ b/zenovis/xinxinoptix/Light.cu @@ -167,15 +167,12 @@ extern "C" __global__ void __closesthit__radiance() switch (lightShape) { case zeno::LightShape::Ellipse: { - auto valid = true; + if (light.rect.isEllipse && !insideEllipse()) { - valid &= false; - } - if (!valid) { prd->done = false; prd->_tmin_ = optixGetRayTmax(); return; - }; + } } case zeno::LightShape::Plane: { @@ -185,19 +182,16 @@ extern "C" __global__ void __closesthit__radiance() auto rect = light.rect; float2 uvScale, uvOffset; - bool valid = SpreadClampRect(rect.v, rect.axisX, rect.lenX, rect.axisY, - rect.lenY, rect.normal, shadingP, - light.spreadMajor, uvScale, uvOffset); + bool valid = SpreadClampRect(rect.v, rect.axisX, rect.lenX, rect.axisY, rect.lenY, rect.normal, + shadingP, light.spreadMajor, uvScale, uvOffset); // if (!valid) { return; } SphericalRect squad; - SphericalRectInit(squad, shadingP, rect.v, rect.axisX, rect.lenX, - rect.axisY, rect.lenY); + SphericalRectInit(squad, shadingP, rect.v, rect.axisX, rect.lenX, rect.axisY, rect.lenY); lsr.PDF = 1.0f / squad.S; if (!isfinite(lsr.PDF)) { return; } - lsr.uv = uvOffset + lsr.uv * uvScale; }