[x3d-public] Finding required fields (Appearance)
Holger Seelig
holger.seelig at yahoo.de
Fri Aug 30 13:41:53 PDT 2024
In 12.2.3 Two-sided materials
https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/shape.html#TwoSidedMaterials
* Both material and backMaterial are NULL. In this case results are equivalent to a default Material node, when viewed from either the front and back side.
* This case is exactly equivalent to using an UnlitMaterial with default emissiveColor white for both material and backMaterial.
I assume that if a appearance field is NULL a default Appearance should be used.
Best regards,
Holger
--
Holger Seelig
Leipzig, Germany
holger.seelig at yahoo.de
https://create3000.github.io/x_ite/
> Am 30.08.2024 um 18:00 schrieb Andreas Plesch via x3d-public <x3d-public at web3d.org>:
>
> Hi Don,
>
> Thanks for responding.
>
> On Fri, Aug 30, 2024 at 10:33 AM Brutzman, Donald (Don) (CIV)
> <brutzman at nps.edu> wrote:
>>
>> Thanks for thoughtful posts. Here are some background considerations regarding X3D design.
>>
>> In general, the X3D Architecture specification tries to define compatible default behavior if a NULL declaration (or omission) of an essential SFNode field is found in a scene.
>>
>> Further, the specification maintains a really light touch regarding handling of problems in a scene graph. Typical prose says things like "behavior is undefined" so that well-meaning remedies or requirements are not forced on browsers. This is intended to avoid undesirable complications or computational cost that might impact browser performance. This puts the responsibility on the author (or authoring software) to "do the right thing" in the first place.
>
> I completely agree that an author should be motivated to not rely on
> NULL values since it may lead to undefined behaviour. However, this is
> somewhat inconsistent with how NULL is used in the specification for
> Appearance and Material node values. There NULL leads to unexpected
> (but useful) behaviour. The least surprising behaviour would be a
> default value which is not NULL but simply an Appearance/Material with
> its own default fields. One issue is how to express such a default
> value in the signature ? NULL is certainly more convenient to place in
> the signature as a default.
> I think an omission should not indicate a NULL value but a default
> value, in parallel to how non-node value fields are treated. In
> effect, NULL should not be considered a valid value, or perhaps a
> value at all, since it expresses the lack of a value (if anything).
> Use of NULL just leads to confusion since it is difficult to consider
> the lack of something.
>
> This is all not too critical and rather a suggestion for future work,
>
> -Andreas
>
>> p.s. Ongoing regression testing of Java X3DJSAIL and Python X3DPSAIL libraries revealed that Appearance backMaterial field was not defined in the XML source asset. Now integrated. All improvements always welcome.
>>
>> X3D Tooltips: Appearance backMaterial
>> [backMaterial accessType inputOutput, type SFNode singleton, NULL node] [X3DMaterialNode]
>> Single contained Material, PhysicalMaterial or UnlitMaterial node that can specify visual attributes for lighting response (color types, transparency, etc.) applied to back faces of corresponding geometry.
>> Warning: it is only allowed to define a backMaterial field if the material field is also defined (not NULL).
>> Warning: the node type for backMaterial field (if any) must match node type for material field.
>> https://www.web3d.org/x3d/tooltips/X3dTooltips.html#Appearance.backMaterial
>>
>>
>> Have fun with X3D! 🙂
>>
>>
>> all the best, Don
>>
>> --
>>
>> Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
>>
>> Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
>>
>> X3D graphics, virtual worlds, navy robotics https://faculty.nps.edu/brutzman
>>
>>
>>
>> ________________________________
>> From: x3d-public <x3d-public-bounces at web3d.org> on behalf of Andreas Plesch via x3d-public <x3d-public at web3d.org>
>> Sent: Wednesday, August 7, 2024 4:33 PM
>> To: X3D Graphics public mailing list <x3d-public at web3d.org>
>> Cc: Andreas Plesch <andreasplesch at gmail.com>
>> Subject: Re: [x3d-public] Finding required fields (Appearance)
>>
>> Shorter answer:
>>
>> Let me clarify that I fully agree that an Appearance field value is
>> not strictly required in which case it will be NULL which in turn
>> leads to an unlit white rendering.
>>
>> Since this is rarely useful (sometimes it is) I originally listed the
>> minimal Shape node which leads to a more expected rendering and then
>> can be modified as needed, as a more practical response..
>>
>> Longer answer:
>>
>> I think the real question may be what are useful default values.
>> Additionally, should NULL be ever used as a default value since it is
>> not obvious what a NULL value may indicate or what consequences it may
>> have. After all, non-node valued fields never have null values as
>> defaults.
>>
>> For example, for the Appearance field in Shape I would have expected
>> the default value to be an Appearance node with its default values for
>> its fields. Similarly, I would have expected for the Material field in
>> Appearance a default value which is a Material node with its default
>> values.
>>
>> Of course, it is not possible to change the default values of existing
>> nodes but for new nodes careful consideration may be given to
>> assigning default values to node fields which may not be NULL.
>>
>> -Andreas
>>
>>> Date: Wed, 7 Aug 2024 13:47:29 -0500
>>> From: John Carlson <yottzumm at gmail.com>
>>> To: Joe D Williams <joedwil at earthlink.net>
>>> Cc: "Extensible 3D (X3D) Graphics public discussion"
>>> <x3d-public at web3d.org>, Michalis Kamburelis <michalis.kambi at gmail.com>
>>> Subject: Re: [x3d-public] Finding required fields (Appearance)
>>> Message-ID:
>>> <CAGC3UEmFeFAEMAG-ZUkO9fvTmrX3n3sxW2rf4Sc3+XZLMF2jdw at mail.gmail.com>
>>> Content-Type: text/plain; charset="utf-8"
>>>
>>> If you just take my subject, without reading the whole message, you might
>>> assume that I am talking about an Appearance node instead of appearance
>>> field.
>>>
>>> My question was, is the appearance field required in Shape.
>>>
>>> Sure, geometry and material are not required either.
>>>
>>> For context, the question was, what?s the minimal code for a graphical
>>> object in X3DOM.
>>> Andreas and I had come up with two different answers, and I was trying to
>>> use documentation to determine whether an Appearance node was required.
>>> The X3DOM didn?t list NULL as a default value. Andreas? approach was to
>>> try actual examples.
>>>
>>> I?m pretty sure that just a shape node and a geometry node are required to
>>> show a graphical object, but at this point, let?s try actual examples.
>>>
>>> Thanks,
>>>
>>> John
>>>
>>> On Sat, Aug 3, 2024 at 5:37?PM Joe D Williams <joedwil at earthlink.net> wrote:
>>>
>>>>> Finding required fields (Appearance) ...
>>>>
>>>>
>>>>
>>>>
>>>> https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/shape.html#Shape
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/shape.html#Appearance
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/shape.html#Material
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Please look at the x3d standard. As you mentioned, default geometry is
>>>> null in Shape.
>>>>
>>>>
>>>>
>>>> If there is a geometry then the Shape Material node is used. For Material
>>>> there is a default set which would tend to make the geometry visible. For
>>>> example, default transparency is 0.
>>>>
>>>>
>>>>
>>>> My, my, my, ... how the material node has grown along with PBR for 4.0:)
>>>>
>>>>
>>>>
>>>> All Best,
>>>>
>>>> Joe
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Shape : X3DShapeNode {
>>>> SFNode [in,out] appearance NULL [X3DAppearanceNode]
>>>> SFBool [in,out] bboxDisplay FALSE
>>>> SFBool [in,out] castShadow TRUE
>>>> SFNode [in,out] geometry NULL [X3DGeometryNode]
>>>> SFNode [in,out] metadata NULL [X3DMetadataObject]
>>>> SFBool [in,out] visible TRUE
>>>> SFVec3f [] bboxCenter 0 0 0 (-?,?)
>>>> SFVec3f [] bboxSize -1 -1 -1 [0,?) or ?1 ?1 ?1
>>>> }
>>>>
>>>>
>>>>
>>>> Appearance : X3DAppearanceNode {
>>>> SFNode [in,out] acousticProperties NULL [AcousticProperties]
>>>> SFFloat [in,out] alphaCutoff 0.5 [0,1]
>>>> SFString [in,out] alphaMode "AUTO" ["AUTO", "OPAQUE", "MASK",
>>>> "BLEND"]
>>>> SFNode [in,out] backMaterial NULL [X3DOneSidedMaterialNode]
>>>> SFNode [in,out] fillProperties NULL [FillProperties]
>>>> SFNode [in,out] lineProperties NULL [LineProperties]
>>>> SFNode [in,out] material NULL [X3DMaterialNode]
>>>> SFNode [in,out] metadata NULL [X3DMetadataObject]
>>>> SFNode [in,out] pointProperties NULL [PointProperties]
>>>> MFNode [in,out] shaders [] [X3DShaderNode]
>>>> SFNode [in,out] texture NULL [X3DTextureNode]
>>>> SFNode [in,out] textureTransform NULL [X3DTextureTransformNode]
>>>> }
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Material : X3DOneSidedMaterialNode {
>>>> SFFloat [in,out] ambientIntensity 0.2 [0,1]
>>>> SFNode [in,out] ambientTexture NULL
>>>> [X3DSingleTextureNode]
>>>> SFString [in,out] ambientTextureMapping ""
>>>> SFColor [in,out] diffuseColor 0.8 0.8 0.8 [0,1]
>>>> SFNode [in,out] diffuseTexture NULL
>>>> [X3DSingleTextureNode]
>>>> SFString [in,out] diffuseTextureMapping ""
>>>> SFColor [in,out] emissiveColor 0 0 0 [0,1]
>>>> SFNode [in,out] emissiveTexture NULL
>>>> [X3DSingleTextureNode]
>>>> SFString [in,out] emissiveTextureMapping ""
>>>> SFNode [in,out] metadata NULL
>>>> [X3DMetadataObject]
>>>> SFFloat [in,out] normalScale 1 [0, ?)
>>>> SFNode [in,out] normalTexture NULL
>>>> [X3DSingleTextureNode]
>>>> SFString [in,out] normalTextureMapping ""
>>>> SFFloat [in,out] occlusionStrength 1 [0,1]
>>>> SFNode [in,out] occlusionTexture NULL
>>>> [X3DSingleTextureNode]
>>>> SFString [in,out] occlusionTextureMapping ""
>>>> SFFloat [in,out] shininess 0.2 [0,1]
>>>> SFNode [in,out] shininessTexture NULL
>>>> [X3DSingleTextureNode]
>>>> SFString [in,out] shininessTextureMapping ""
>>>> SFColor [in,out] specularColor 0 0 0 [0,1]
>>>> SFNode [in,out] specularTexture NULL
>>>> [X3DSingleTextureNode]
>>>> SFString [in,out] specularTextureMapping ""
>>>> SFFloat [in,out] transparency 0 [0,1]
>>>> }
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> not mention PhysicalMaterial and UnlitMaterial.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Extensible 3D (X3D) Graphics public discussion <x3d-public at web3d.org
>>>>>
>>>> Sent: Aug 2, 2024 10:34 AM
>>>> To: Michalis Kamburelis <michalis.kambi at gmail.com>
>>>> Cc: John Carlson <yottzumm at gmail.com>, Extensible 3D (X3D) Graphics
>>>> public discussion <x3d-public at web3d.org>
>>>> Subject: Re: [x3d-public] Finding required fields (Appearance)
>>>>
>>>>
>>>> I got something for x3d schema, but X3DUOM was blank. I don?t have my
>>>> computer and I?m using chrome. I?m at the airport.
>>>>
>>>> Should I use the spec on the road and tooltips? CGE?
>>>>
>>>> John
>>>>
>>>> On Fri, Aug 2, 2024 at 9:35?AM John Carlson <yottzumm at gmail.com> wrote:
>>>>
>>>>> I don?t know if Apple can still prevent other browsers from avoiding
>>>>> Apple?s Safari renderer on iOS. The issue was that apparently, the pages
>>>>> were blank because I was viewing XML schema and X3DUOM. Maybe I didn?t
>>>>> wait long enough. AFAIK, there?s no view source on Safari on iOS? Anyone
>>>>> know a trick?
>>>>>
>>>>> I was unable to search through X3D JSON Schema on GitHub because the page
>>>>> crashed.
>>>>>
>>>>> I can?t even search through my X3DUOM to JSON schema mapping on a web
>>>>> page which is rendered HTML.
>>>>>
>>>>> I will try chrome unless the Firefox is proved to work on iOS.
>>>>>
>>>>> John
>>>>>
>>>>> On Fri, Aug 2, 2024 at 7:31?AM Michalis Kamburelis <
>>>>> michalis.kambi at gmail.com> wrote:
>>>>>
>>>>>> Shape.appearance can be NULL.
>>>>>>
>>>>>> I'm not sure about notes of iOS and Safari, it should naturally work
>>>>>> to search GitHub or to browse X3D specs :) You can also install other
>>>>>> browsers, lke Firefox, on iOS.
>>>>>>
>>>>>> Michalis
>>>>>>
>>>>>> czw., 1 sie 2024 o 17:32 John Carlson via x3d-public
>>>>>> <x3d-public at web3d.org> napisa?(a):
>>>>>>>
>>>>>>> I?m looking for a way to determine whether an Appearance node is
>>>>>> required, viewable in iOS Safari? Default is NULL in Shape, so I assume
>>>>>> not.
>>>>>>>
>>>>>>> I?m going to check X3D JSON Schema. Safari bombs when searching on
>>>>>> GitHub.
>>>>>>>
>>>>>>> Any approach would be great, I may even try vim.
>>>>>>>
>>>>>>> John
>>>>>>> _______________________________________________
>>>>>>> x3d-public mailing list
>>>>>>> x3d-public at web3d.org
>>>>>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>>>>
>>>>>
>>>>
>>> -------------- next part --------------
>>> An HTML attachment was scrubbed...
>>> URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240807/13c29e42/attachment-0001.html>
>>>
>>> ------------------------------
>>>
>>> Subject: Digest Footer
>>>
>>> _______________________________________________
>>> x3d-public mailing list
>>> x3d-public at web3d.org
>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>>
>>>
>>> ------------------------------
>>>
>>> End of x3d-public Digest, Vol 185, Issue 12
>>> *******************************************
>>
>>
>>
>> --
>> Andreas Plesch
>> Waltham, MA 02453
>>
>> _______________________________________________
>> x3d-public mailing list
>> x3d-public at web3d.org
>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
>
> --
> Andreas Plesch
> Waltham, MA 02453
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240830/6b479d46/attachment-0001.html>
More information about the x3d-public
mailing list