We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a63ea7b commit 6157277Copy full SHA for 6157277
1 file changed
jme3-core/src/main/java/com/jme3/light/PointLight.java
@@ -165,11 +165,11 @@ public final void setRadius(float radius) {
165
if (radius < 0) {
166
throw new IllegalArgumentException("Light radius cannot be negative");
167
}
168
-
169
- if (radius == Float.POSITIVE_INFINITY) {
170
- radius = Float.MAX_VALUE;
+
+ // Fix #2566 - Prevent shader overflow with infinite or invalid radius
+ if (radius == Float.POSITIVE_INFINITY || radius < 0f || Float.isNaN(radius)) {
171
+ radius = Float.MAX_VALUE / 4f; // Safe large value, avoids overflow in shaders
172
173
this.radius = radius;
174
if (radius != 0f) {
175
this.invRadius = 1f / radius;
0 commit comments