3D light enhancements

Nir Lisker nlisker at gmail.com
Thu Jan 3 00:31:02 UTC 2019


Hi All,

FalcoTheBold and I been discussing enhancements to the 3D lighting
mechanism on GitHub [1]. The summary is as follows:

1. We want to add additional light types: directional light and spotlight.
2. We want to add attenuation and range parameters to the current point
light and future spotlight.

Our efforts are currently directed at 2, specifically, adding attenuation
(inc. range) to the current point light. Some preliminary results for the
d3d pipeline can be seen in [2]. I'm working on the d3d pipeline (with a
lot behind-the-scenes help from Ambarish) while Falco is working on the es2
pipeline. Iv'e also taken upon me to do the Java side modifications.

>From the 3d3 pipeline perspective, it seems that this change will require
upgrading the shader models from 2.0 to 3.0. This means that backwards
compatibility is lost for graphic cards that support DirectX 9.0 but not
9.0c. Fortunately, these should be a small number of very old cards.

On the API level, I'm thinking about adding 4 `DoubleProperty`s to
PointLight for the 3 attenuation factors and the range. Their default
values are such that current behavior is preserved. SpotLight will also
have these values (in addition to other required parameters).

If this plan is approved by Kevin/Johan, I will create JBS tickets for
step-by-step implementations. Other comments are welcome.

Thanks,
Nir

[1] https://github.com/javafxports/openjdk-jfx/issues/256
[2]
https://github.com/javafxports/openjdk-jfx/issues/256#issuecomment-450762358


More information about the openjfx-discuss mailing list