Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
iaomw committed Dec 19, 2024
1 parent 899a799 commit a443676
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions zenovis/xinxinoptix/Light.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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: {

Expand All @@ -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;
}

Expand Down

0 comments on commit a443676

Please sign in to comment.