RFR: 8234920: Add SpotLight to the selection of 3D light types [v14]

Nir Lisker nlisker at openjdk.java.net
Mon Jun 7 23:38:44 UTC 2021


On Mon, 7 Jun 2021 13:29:01 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

> In that case, using computeSpotlightFactor in the GLSL shaders and computeSpotlightFactor3 in the HLSL shaders seems like the way to go. If we are settled on this, the two you aren't using should be commented out or #ifdefed out.

I think so too. Did you test on Win? Does @arapte want to test these functions too?

> The more interesting question is whether the gap between what we have now and what is possible for simple lights justifies additional shaders. Maybe not for point lights, but we need to at least consider it when you add directional lights.

The question of adding shaders is a bigger one than just the light types. I plan on adding emissive (or self-illuminating) color, in addition to the existing map, which will probably require creating additional shaders as we do for diffuse and specular colors/maps.
Another change will be removing the limit of 3 lights. I have a patch that does it by removing the shader creation per light number. We will need to think how to redistribute the shaders since we can't create one for every light number. Either remove those or, if possible, divide then into 1 light, 2 lights, 3 lights, and 4+ lights. Not sure how to include different numbers of lights in the same shader syntactically.

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

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


More information about the openjfx-dev mailing list