RFR: 8255015: Inconsistent illumination of 3D shape by PointLight
Andreas Heger
duke at openjdk.java.net
Sun Oct 24 16:08:02 UTC 2021
On Mon, 20 Sep 2021 14:11:50 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> @kevinrushforth
>>> The fix looks good. I tested it both in isolation and with PR #334 and it works on both a retina and non-retina display.
>>>
>>> If you have time to write an automated test, that would be useful, but if not then a manual test would be OK.
>>
>> Ok, I will try to write an automated test case which draws a sphere in a SubScene and then calculates the average color of the generated image. The test will be passed if the calculated average does not differ from the excepted average color by a certain tolerance value. I'm not sure if I will manage to do this... but I will give it a try.
>
> @andreas-heger are you able to come up with an automated test for this bug?
@kevinrushforth I've finally added a JUnit test to verify the illumination. I tested it on my MacBook with and without Retina display and also on my linux system with non HiDPI display. It only fails on the MacBook with retina display, if my fix isn't used. In all other situations (non retina display and no matter if the fix is used or not) it succeeds.
In my test class PointLightIlluminationTest, I had to use the Robot API for getting the pixel colors from the screen. In a first attempt, I tried to use the Node.snapshot method, but in this case the taken snapshot always had the correct illumination, no matter what display was used and even though the scene on the display showed the wrong illumination. I guess the snapshot method renders the node directly into an image and does not use the physical screen content and so the pixel scale factor does not play any role in this case. So, I placed the test class into the package test.robot.test3d and derived it from the existing class VisualTestBase. There are 6 tests in the class. The first checks the background color of the subscene (this test should be always succeed, no matter if the fix is applied or not... I added is just to have more security that the whole scene is really setup as desired). The other tests check the color of the displayed sphere at 4 corner pixel and one in the ce
nter.
I hope that this test can be useful for this project.
There is one more point, not related to this pull request. I found out that the JFX project does not compile on an apple silicon mac. The -arch option of the clang compiler does not accept the value "aarch64". It must be "arm64" so that the JFX project compiles on my M1 MacBook Air. I will search if there is already a bug or create a new one in the next days.
-------------
PR: https://git.openjdk.java.net/jfx/pull/531
More information about the openjfx-dev
mailing list