On Wed, 25 Jun 2025 16:13:46 GMT, Martin Fox <m...@openjdk.org> wrote:

>> @beldenfox Thanks for pointing to improper isKindOfClass: usage. That is 
>> updated now and setOpaque is getting called properly as in mainline.
>> 
>> Regarding reproducing the issue originally seen in PickTest3D : PickTest3D 
>> is updated in 2015 under 
>> [JDK-8130532](https://bugs.openjdk.org/browse/JDK-8130532) to use alpha 
>> value as 1.0 instead of 0.5 for diffuse color. I reverted this change to use 
>> 0.5 and disabled calling setOpaque in GlassWindow.m. Unfortunately,  i see 
>> proper output with translucent objects and there is no difference in output 
>> of PickTest3D with/without setOpaque call even with 0.5 alpha value. As you 
>> have also observed in current code setOpaque call has no effect in output 
>> even when we use 0.5 alpha value. Currently i am trying get information 
>> related to PickTest3D code pre 2015.
>> 
>> Regarding running demos in VM : Is Prism falling back to SW pipeline? (You 
>> can check for this info using -Dprism.verbose=true). If it is falling back 
>> to SW pipeline in VM, we can try to force it to use hardware pipeline using 
>> -Dprism.forceGPU=true.
>
>> Regarding reproducing the issue originally seen in PickTest3D : PickTest3D 
>> is updated in 2015 under 
>> [JDK-8130532](https://bugs.openjdk.org/browse/JDK-8130532) to use alpha 
>> value as 1.0 instead of 0.5 for diffuse color.
> 
> Thanks for tracking that down. The description in 
> [JDK-8130532](https://bugs.openjdk.org/browse/JDK-8130532) references 
> [JDK-8095058](https://bugs.openjdk.org/browse/JDK-8095058). From what I can 
> tell that was the original bug that was causing incorrect results on macOS 
> and covering up the incorrect alpha value in the diffuse color. I think using 
> setOpaque: to rip out the alpha channel was a work-around for JDK-8095058 and 
> is probably no longer necessary.
> 
> But removing the alpha channel made macOS match the output of Windows and 
> Linux. Is JavaFX designed to work without an alpha channel when the window is 
> not TRANSPARENT?
> 
>> Regarding running demos in VM : Is Prism falling back to SW pipeline? (You 
>> can check for this info using -Dprism.verbose=true).
> 
> In my Windows VM Prism reports that it's using the D3D pipeline. And Prism 
> isn't throwing any errors or issuing any warnings, it just doesn't draw 
> except for the ColorCube toy.

@beldenfox [JDK-8095004](https://bugs.openjdk.org/browse/JDK-8095004) talks 
about default opacity of CALayer being NO. But current documentation mentions 
that by default CALayer is opaque. And there are no pointers whether Apple has 
changed this behaviour in-between. Also as you mentioned there is update in 
shader also to ignore alpha channel when its value is 0.0 in 
[JDK-8095058](https://bugs.openjdk.org/browse/JDK-8095058). So there are lot of 
factors at different levels which will make PickTest3D to behave differently 
now compared to pre 2015.

So on current code i have verified that PickTest3D works properly with 
different combinations of alpha value in diffusecolor and opacity for the 
stage. Regarding whether we need to remove setOpaque/not : As part for glass 
refactoring in this PR its better to keep the default ES2 pipeline code as it 
is.

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

PR Comment: https://git.openjdk.org/jfx/pull/1824#issuecomment-3008738532

Reply via email to