[x3d-public] PR with new X3D field: Appearance.alphaMode

Michalis Kamburelis michalis.kambi at gmail.com
Thu Jan 28 14:51:41 PST 2021


Hi,

As promised, I added a new X3D field that corresponds to glTF
alphaMode. The new field is called "alphaMode" in Appearance node,
with similar naming and meaning as in glTF (and with added "AUTO"
option to make the default behavior backward-compatible with X3D 3).

For now it is a PR on GitHub (
https://github.com/Web3DConsortium/X3D/pull/11 ), which can be merged
(tomorrow? if no objections).

The resulting spec is rather simple, attaching a screenshot so that
everyone can see it :)

The testcase is on
https://github.com/michaliskambi/x3d-tests/tree/master/alpha_mode with
reference screenshot on
https://raw.githubusercontent.com/michaliskambi/x3d-tests/master/alpha_mode/alpha_mode_correct.png
. View3dscene (latest snapshot from
https://castle-engine.io/view3dscene.php ) already supports this field
so you can use it to experiment (well, give Jenkins a few hours to
build it, since this mail).

Don (Brutzman): I used your placeholder in Appearance node spec,
thanks. You placed it under CSS class="approved", I assumed this was
correct and didn't change that CSS class.

I'll hop on tomorrow on Web3d call to synchronize (note that I will
have to run after 30 minutes to another meeting, hopefully we can take
care of this first.)

It's all rather straightforward, I predict only one hard question: why
did I add it to Appearance, not inside material
(X3DOneSidedMaterialNode) to which my answer is

"""
Because it is something "on top" of Appearance.material,
Appearance.texture, Appearance.shaders. In particular if you use
custom shaders, then you still can use this field to determine whether
blending is done. When you provide shader in Appearance.shaders, you
may leave Appearance.material empty (because material is ignored when
your custom shader is in effect), but Appearance.alphaMode still
matters.

In general, in X3D the "Appearance" node is corresponding to glTF
material. The X3D "XxxMaterial" nodes are something smaller than glTF
material concept.
"""

References:

- corresponding glTF alphaMode spec:
https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#alpha-coverage

- relevant extension in CGE:
https://castle-engine.io/x3d_implementation_shape_extensions.php#section_ext_alpha_channel
(note that in CGE we support both alphaMode and (for backward compat)
alphaChannel names)

- if you use Blender, note that you can set "Blend Mode" that
determines this glTF parameter (when you export Blender->glTF) in a
straightforward fashion:
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html#blend-modes

Regards,
Michalis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alpha_mode.png
Type: image/png
Size: 233581 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20210128/c7506811/attachment-0001.png>


More information about the x3d-public mailing list