iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.08k stars 293 forks source link

Fix color layer rendering issue when using white to invisible effect #2245

Closed Desplandis closed 7 months ago

Desplandis commented 7 months ago

Description

Using effect_type = 2, which should set white color to transparent, renders it as black (more context in #2236). This PR fixes this issue and document more thoroughly effect_type and effect_parameter properties.

Context

In this context, effect_parameter is passed as the intensity parameter of applyWhiteToInvisibleEffect and is used in line 29 of the shader. Since we do not set a default value to effect_parameter it is passed as undefined to the shader (which could lead to implementation-defined behavior).

Moreover, this PR remove the intensity parameter of applyWhiteToInvisibleEffect as it is used as exponent of a value $= 1.0$ (see line 29). Removing it should cause no breaking change.

Related issues

closes #2236

Desplandis commented 7 months ago

@ketourneau It shall fixes your issue.

ketourneau commented 7 months ago

@Desplandis Yes, it's perfect for us. Thank for the fix !