ThematicGradientSettings is used both for thematic display (colorizing based on implicit properties like elevation or normal) and scientific visualization (colorizing based on auxiliary polyface scalar data).
In both cases, the alpha channel of the gradient's color keys is ignored - the transparency is determined by the surface color's alpha channel alone.
Proposal: add a transparencyMode to ThematicGradientSettings of enum type with two initial options:
use the surface alpha, ignoring gradient alpha (default)
multiply gradient alpha by surface alpha
The latter will behave the same as material alpha does, and address the request. In future we may find a need for additional transparency modes.
We will have to handle the case in which between the surface alpha and the gradient colors we have a mix of opaque and translucent colors. That will require drawing in both passes and discarding in one based on the alpha computed in the shader. We do the same thing for textures that contain a mix of fully-opaque and semi-transparent pixels, keying off of the HasTexture surface bit flag.
Discussed in https://github.com/iTwin/itwinjs-core/discussions/6212
ThematicGradientSettings
is used both for thematic display (colorizing based on implicit properties like elevation or normal) and scientific visualization (colorizing based on auxiliary polyface scalar data). In both cases, the alpha channel of the gradient's color keys is ignored - the transparency is determined by the surface color's alpha channel alone.Proposal: add a
transparencyMode
toThematicGradientSettings
of enum type with two initial options:The latter will behave the same as material alpha does, and address the request. In future we may find a need for additional transparency modes.
We will have to handle the case in which between the surface alpha and the gradient colors we have a mix of opaque and translucent colors. That will require drawing in both passes and discarding in one based on the alpha computed in the shader. We do the same thing for textures that contain a mix of fully-opaque and semi-transparent pixels, keying off of the
HasTexture
surface bit flag.