Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions jme3-core/src/main/java/com/jme3/light/PointLight.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ public final void setRadius(float radius) {
if (radius < 0) {
throw new IllegalArgumentException("Light radius cannot be negative");
}

if (radius == Float.POSITIVE_INFINITY) {
radius = Float.MAX_VALUE;

// Fix #2566 - Prevent shader overflow with infinite or invalid radius
if (radius == Float.POSITIVE_INFINITY || radius < 0f || Float.isNaN(radius)) {
Comment thread
codex128 marked this conversation as resolved.
Outdated
radius = Float.MAX_VALUE / 4f; // Safe large value, avoids overflow in shaders
}

this.radius = radius;
if (radius != 0f) {
this.invRadius = 1f / radius;
Expand Down
Loading