RFR: 8217472: Add attenuation for PointLight [v5]

Kevin Rushforth kcr at openjdk.java.net
Fri Aug 7 22:33:02 UTC 2020


On Wed, 29 Jul 2020 09:17:10 GMT, Nir Lisker <nlisker at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/javafx/sg/prism/NGShape3D.java line 187:
>> 
>>> 186:                         0, 0, 0, 0, // r g b w
>>> 187:                         1, 0, 0, 0); // ca la qa maxRange
>>> 188:         }
>> 
>> Minor: maybe use the getDefaultXxxx methods of NGPointLight?
>
> The only impact this has is that the range will be maximal instead of 0. When these reach the shader, they will run the
> lighting computation as opposed to skipping it. I'm not sure if this will have any performance impact though.

In that case, it seems like a generally useful optimization (not just at initialization) to send down `maxRange` as 0
whenever `ca`, `la`, and `qa` are all at their default values.

-------------

PR: https://git.openjdk.java.net/jfx/pull/43


More information about the openjfx-dev mailing list