RFR: 8217472: Add attenuation for PointLight [v14]
Kevin Rushforth
kcr at openjdk.java.net
Fri Oct 9 11:59:23 UTC 2020
On Fri, 9 Oct 2020 01:39:23 GMT, Nir Lisker <nlisker at openjdk.org> wrote:
>> modules/javafx.graphics/src/main/native-prism-d3d/D3DLight.cc line 64:
>>
>>> 62: }
>>> 63:
>>> 64: /*void D3DLight::setRange(float r) {
>>
>> Remove this unused function?
>
> I forgot to mention this point. These setter functions for color and position (and range) are never used since whenever
> there is a change in the java side the whole array and lights are recreated instead of being adjusted for the change.
> I'm not familiar enough with the memory model of JNI, but it seems expensive to re-render everything on every change (I
> think that the mesh is also recreated every time in the native code). Is this the way it's supposed to work?
If the lights array is being recreated on a change, there might be a small savings to be had to reuse the existing
array (it would need to be updated only during the sync while the renderer is idle).
If the mesh is always being recreated, there may be an opportunity for an even bigger savings, presuming that only the
mesh data changed (and not the index values in the faces array).
This could be a future optimization, but we would need something to quantify the possible savings.
-------------
PR: https://git.openjdk.java.net/jfx/pull/43
More information about the openjfx-dev
mailing list