RFR: 8217472: Add attenuation for PointLight [v5]
Nir Lisker
nlisker at openjdk.java.net
Fri Oct 9 01:04:23 UTC 2020
On Thu, 8 Oct 2020 22:08:16 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> 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.
>
> Actually, my above comment is wrong. A `maxRange` of 0 will effectively disable the lighting, even in the case whether
> the other three values are 1, 0, 0. So `maxRange` should be set to `Float.POSITIVE_INFINITY` (or else just use the
> default constants).
These lights are fillers for the native lights array in the case where the user set less than 3 lights, they are not
supposed to do anything, and their color is black. A range of 0 will guarantee that the computation in the shader will
be skipped.
In a WIP that I have locally I have removed the "3 lights constraint" altogether, so this part will change in that
proposed patch anyway.
-------------
PR: https://git.openjdk.java.net/jfx/pull/43
More information about the openjfx-dev
mailing list