[x3d-public] Issue with X3DUOM -- missing "" default value in ComposedShader.language

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Sat Mar 9 14:10:16 PST 2019


Actually the default is the empty SFString, so that omission is correct.  Unspecified XML attributes get default value of empty string.

Note that, using spec terminology, field definition

	 SFString [] language   ""   ["Cg"|"GLSL"|"HLSL"|...]

means

- type SFString
- accessType initializeOnly
- name is language
- default value is empty string, meaning no default is provided
- predefined string constants are "Cg"|"GLSL"|"HLSL"
- ... indicates other values are allowed.

The X3D Tooltips for ComposedShader (language field) shed a little more light on this:

http://www.web3d.org/x3d/tooltips/X3dTooltips.html#ComposedShader.language

=========================================================
The language field indicates to the X3D player which shading language is used. The language field may be used to optionally determine the language type if no MIME-type information is available.
Hint: recognized values include "CG" "GLSL" "HLSL".
=========================================================

I think at one point the choice "FX" was also getting some use, but am not finding it in current use via web search.

On 3/7/2019 6:40 PM, John Carlson wrote:
> Issue with X3DUOM -- missing "" default value in ComposedShader.language
> 
> 
>     http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/shaders.html#ComposedShader
> 
> 
>     31.4.1 ComposedShader
> 
> ComposedShader : X3DShaderNode, X3DProgrammableShaderObject {
> 
>    SFBool    [in]     activate
> 
>    SFNode    [in,out] metadata   NULL [X3DMetadataObject]
> 
>    MFNode    [in,out] parts      []   [ShaderPart]
> 
>    SFBool    [out]    isSelected
> 
>    SFBool    [out]    isValid
> 
>    SFString []        language   ""   ["Cg"|"GLSL"|"HLSL"|...]
> 
>    # And any number of:
> 
>    fieldType []       fieldName
> 
>    fieldType [in]     fieldName
> 
>    fieldType [out]    fieldName
> 
>    fieldType [in,out] fieldName
> 
> }
> 
> http://www.web3d.org/specifications/X3dUnifiedObjectModel-3.3.xml
> 
> <ConcreteNodename="ComposedShader">
> 
> <InterfaceDefinitionspecificationUrl="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/shaders.html#ComposedShader" appinfo="ComposedShader can contain field declarations, but no CDATA section of plain-text source code, since programs are composed from child ShaderPart nodes.">
> 
> <componentInfoname="Shaders" level="1"/>
> 
> <InheritancebaseType="X3DShaderNode"/>
> 
> <AdditionalInheritancebaseType="X3DProgrammableShaderObject"/>
> 
> <fieldtype="SFBool" accessType="inputOnly" name="activate"/>
> 
> <fieldtype="SFBool" accessType="outputOnly" name="isSelected"/>
> 
> <fieldtype="SFBool" accessType="outputOnly" name="isValid"/>
> 
> <fieldtype="SFString" accessType="initializeOnly" name="language" additionalEnumerationValuesAllowed="true" baseType="shaderLanguageValues">
> 
> <enumerationvalue="Cg"/>
> 
> <enumerationvalue="GLSL"/>
> 
> <enumerationvalue="HLSL"/>
> 
> </field>
> 
> <fieldtype="SFNode" accessType="inputOutput" name="metadata" default="NULL" acceptableNodeTypes="X3DMetadataObject"/>
> 
> <fieldtype="MFNode" accessType="inputOutput" name="parts" acceptableNodeTypes="ShaderPart"/>
> 
> <fieldtype="SFString" accessType="inputOutput" name="DEF" inheritedFrom="DEF_USE" baseType="xs:ID"/>
> 
> <fieldtype="SFString" accessType="inputOutput" name="USE" inheritedFrom="DEF_USE" baseType="xs:IDREF"/>
> 
> <fieldtype="SFString" accessType="inputOutput" name="class" inheritedFrom="globalAttributes" baseType="xs:NMTOKENS"/>
> 
> <containerFielddefault="shaders" type="xs:NMTOKEN"/>
> 
> <ContentModel>
> 
> <FieldDeclarationminOccurs="0" maxOccurs="unbounded"/>
> 
> <GroupContentModelname="ChildContentModelCore" minOccurs="0"/>
> 
> <NodeContentModelname="ShaderPart"/>
> 
> <NodeContentModelname="ProtoInstance"/>
> 
> </ContentModel>
> 
> </InterfaceDefinition>
> 
> </ConcreteNode>
> 


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 http://faculty.nps.edu/brutzman


More information about the x3d-public mailing list