Skip to content

Commit aa15d83

Browse files
committed
Clear attenuation for directional lights in batch renderer
Directional lights don't have attenuation, but we were setting (1, 0, 0), indicating constant attenuation. This bumped against a Hydra bug where attenuation was used to determine whether a light was directional. Ensure directional lights have attenuation = (0, 0, 0).
1 parent 03e5aa8 commit aa15d83

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/mayaUsd/render/px_vp20/utils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,9 @@ px_vp20Utils::GetLightingContextFromDrawContext(const MHWRender::MDrawContext& c
602602
if (!viewDirectionAlongNegZ) {
603603
lightDirection[2u] = 1.0f;
604604
}
605+
606+
// Directional lights don't have attenuation.
607+
lightAttenuation = GfVec3f(0.0f);
605608
}
606609

607610
if (lightNumPositions == 0u && !lightHasDirection) {

0 commit comments

Comments
 (0)