[x3d-public] X_ITE implementation of glTF material extensions
Michalis Kamburelis
michalis.kambi at gmail.com
Wed Jun 26 05:54:41 PDT 2024
Great news! I'm reading your node docs, excellent work in getting this
specified and implemented!
I have a plan to implement these material extensions in Castle Game
Engine / Castle Model Viewer as well (
https://castle-engine.io/roadmap#gltf_material_features ). Looks like
you beat me to it with X_ITE, and it makes me very happy :) (Also
because it means I can look at your nodes and code and my task is much
easier :) ).
Some initial thoughts about the spec of new functionality:
1. Expressing functionality as "extensions" of PhysicalMaterial (I see
you have "PhysicalMaterial.extensions", MFNode with
X3DMaterialExtensionNode,
https://create3000.github.io/x_ite/components/shape/physicalmaterial/
):
This is great solution, this expressed the intention nicely (this
information is extra data, "extension", and without it things look
worse but make sense).
I'm looking at this both from Castle Game Engine / Castle Model
Viewer author perspective, also from the perspective of future X3D
versions. A lot of your extensions, including the
"PhysicalMaterial.extensions" field and nodes like
SheenMaterialExtension, ClearcoatMaterialExtension could definitely be
part of future X3D (4.1?) version.
2. Comments specifically about SpecularGlossinessMaterial (
https://create3000.github.io/x_ite/components/x-ite/specularglossinessmaterial/
):
Note that KHR_materials_pbrSpecularGlossiness is deprecated, and
the recommendation is to follow instead KHR_materials_specular which
addresses a similar use-case. In Castle Game Engine / Castle Model
Viewer we deliberately decided, for this reason, to not support
KHR_materials_pbrSpecularGlossiness and just explain it to users (
https://castle-engine.io/sketchfab ).
I of course understand it is a practical decision, if your users
demand KHR_materials_pbrSpecularGlossiness then
SpecularGlossinessMaterial makes sense. I'm just saying that this
should probably not go to future X3D spec.
Just like Khronos recommends KHR_materials_specular over
KHR_materials_pbrSpecularGlossiness, we should in X3D recommend
SpecularMaterialExtension over SpecularGlossinessMaterial.
3. I see you added also UnlitMaterialExtension, can you expand why do
you need it?
I know your approach is a bit more consistent with glTF, that has
"physical material with KHR_materials_unlit".
That said, I deliberately deviated here for X3D 4.0, adding
instead a separate node "UnlitMaterial". "UnlitMaterial" does feel
more natural -- being unlit is, conceptually, not an extension of PBR
lighting equations (or PBR specular, or Phong lighting equations...).
Being unlit means you throw away the usual lighting equations, and
just have very simple situation where resulting color is emissiveColor
* optional emissiveTexture. This makes "UnlitMaterial" spec simple,
this also sidesteps glTF question (that used to be ambiguous in older
glTF spec version) of how to combine glTF base and emissive color in
case of KHR_materials_unlit (because in X3D, we just have
"UnlitMaterial" with "UnlitMaterial,emissiveColor" -- it's simpler),
this also allows natural optimizations on the renderer side (unlit can
use completely different set of simple shaders).
So ideally, I see "UnlitMaterial" as X3D-equivalent of
"KHR_materials_unlit". If there is a need for UnlitMaterialExtension,
I'm curious to know why, and can we avoid it, to keep X3D spec simple
:)
Many thanks for your work. This is great advancement for X3D! I
absolutely recommend everyone on this list to click on Holger's links
to demos and extensions, we absolutely should look at this
functionality as potentially becoming available in other X3D browsers
(I will definitely want to implement (subset of it) in Castle Game
Engine / Castle Model Viewer) and in future X3D spec versions.
Best regards,
Michalis
wt., 25 cze 2024 o 11:52 Holger Seelig via x3d-public
<x3d-public at web3d.org> napisał(a):
>
> With the current release v10.0.1, all glTF material extensions are now available, i.e. when a glTF file is parsed, these extensions are automatically converted to X3D. There is now an X3D node for each glTF extension. These nodes can also be referenced directly in X3D files. Extensions for glTF materials are converted to the new X3DMaterialExtensionNode nodes, which can be used as a child of PhysicalMaterial node and the new SpecularGlossinessMaterial node. These material nodes now have a new field »extensions« for this purpose. The introduction of the »extensions« field has only a minimal impact and leads to the greatest possible compatibility.
>
> To get an idea of what a great difference these new material extensions make, check out our glTF Sample Viewer. Take some time and look through all the examples. I am sure you will be amazed.
>
> https://create3000.github.io/x_ite/laboratory/gltf-sample-viewer/
>
> Here are three selected examples, but there are many more:
>
> https://create3000.github.io/x_ite/laboratory/gltf-sample-viewer/?url=AnisotropyBarnLamp
> https://create3000.github.io/x_ite/laboratory/gltf-sample-viewer/?url=DragonAttenuation
> https://create3000.github.io/x_ite/laboratory/gltf-sample-viewer/?url=MosquitoInAmber
> https://create3000.github.io/x_ite/laboratory/gltf-sample-viewer/?url=ToyCar
>
> Implemented glTF Extensions:
>
> All glTF extensions implemented with this version are listed below:
>
> X3DOneSidedMaterialNode
>
> * KHR_materials_pbrSpecularGlossiness implemented as SpecularGlossinessMaterial node.
>
> X3DMaterialExtensionNode
>
> * KHR_materials_anisotropy implemented as AnisotropyMaterialExtension node.
> * KHR_materials_clearcoat implemented as ClearcoatMaterialExtension node.
> * KHR_materials_dispersion implemented as DispersionMaterialExtension node.
> * KHR_materials_emissive_strength implemented as EmissiveStrengthMaterialExtension node.
> * KHR_materials_ior implemented as IORMaterialExtension node.
> * KHR_materials_iridescence implemented as IridescenceMaterialExtension node.
> * KHR_materials_sheen implemented as SheenMaterialExtension node.
> * KHR_materials_specular implemented as SpecularMaterialExtension node.
> * KHR_materials_transmission implemented as TransmissionMaterialExtension node.
> * KHR_materials_unlit implemented as UnlitMaterialExtension node.
> * KHR_materials_volume implemented as VolumeMaterialExtension node.
>
> Switch
>
> * KHR_materials_variants implemented as Switch node.
>
> These new nodes are initially available in the X_ITE component and documented here:
> https://create3000.github.io/x_ite/components/#x_ite
>
> Make X3D even better!
> Best regards,
> Holger
>
> --
> Holger Seelig
> Leipzig, Germany
>
> holger.seelig at yahoo.de
> https://create3000.github.io/x_ite/
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
More information about the x3d-public
mailing list