Closed ketourneau closed 7 months ago
Hi and thanks for your detailed bug report! I managed to easily reproduce this issue and agree with you on the cause of the bug.
The different type of effects on color layers are clearly not well-documented (especially the effect_parameter
layer property which is passed to the shader as a per-layer uniform).
In the case where effect_type = 2
, effect_parameter
is passed as the intensity
parameter of applyWhiteToInvisibleEffect
and is used in line 29. Since we do not set a default value to effect_parameter
it is passed as undefined
to the shader (which could be implementation-defined behavior).
Moreover, I too question the need for line 29 since $a \in [0.99, 1.0]$ at this point. Since this is not documented, we could either:
I'll open a PR fixing those three issues (documentation, undefined and shader code)!
Your Environment
Context
We used a WMS source (to render a GeoTiff) with a ColorLayer and a PlanarView and with map background. We want to replace white color of WMS source by transparency so we try to use
effect type:2
on ColorLayer (applyWhiteToInvisibleEffect). But it seems to render black color in firefox so we applycustom effect type
.Steps to Reproduce (for bugs)
online demo
Expected Behavior
With effect_type:2 on ColorLayer => white color must be invisible (on all browsers).
Actual Behavior
With effect_type:2 on ColorLayer => white color is replaced by black color (only on firefox, it's working on chrome).
Possible Cause/Fix/Solution
It seems it's caused by applyWhiteToInvisibleEffect.
I think we can replace line 29 by
color.a = 0.0
.It's how we fix it in our demo.