Post

PackagedShader

Overview

PackagedShader contains a url for a single file that may contain a number of shaders and combined effects.

The PackagedShader node belongs to the Shaders component and requires at least level 1, its default container field is shaders. It is available from X3D version 3.0 or higher.

Hierarchy

1
2
3
4
+ X3DNode
  + X3DAppearanceChildNode
    + X3DShaderNode
      + PackagedShader (X3DUrlObject, X3DProgrammableShaderObject)*

* Derived from multiple interfaces.

Fields

SFNode [in, out] metadata NULL [X3DMetadataObject]

Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.

Hint

SFString [in, out] description “”

Author-provided prose that describes intended purpose of the url asset.

Hint

  • Many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for “ quotation-mark character).

SFBool [in] activate

activate forces the shader to activate the contained objects.

Warning

  • It is an error to define this transient inputOnly field in an X3D file, instead only use it a destination for ROUTE events.

SFBool [out] isSelected

isSelected indicates this shader instance is selected for use by browser

Warning

  • It is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.

SFBool [out] isValid

isValid indicates whether current shader objects can be run as a shader program.

Warning

  • It is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.

SFString [ ] language “” [“Cg”|”GLSL”|”HLSL”|…]

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”.

SFBool [in, out] load TRUE

load=true means load immediately, load=false means defer loading or else unload a previously loaded scene.

Hints

  • Allows author to design when Inline loading occurs via user interaction, event chains or scripting.
  • Use a separate LoadSensor node to detect when loading is complete.

MFString [in, out] url [ ] [URI]

url points to a shader source-code file that may contain a number of shaders and combined effects.

Hint

SFTime [in, out] autoRefresh 0 [0,∞)

autoRefresh defines interval in seconds before automatic reload of current url asset is performed.

Hints

  • If preceding file loading fails or load field is false, no refresh is performed.
  • Repeated refresh attempts to reload currently loaded entry of url list. If that fails, the browser retries other entries in the url list.

Warning

  • Automatically reloading content has security considerations and needs to be considered carefully.

SFTime [in, out] autoRefreshTimeLimit 3600 [0,∞)

autoRefreshTimeLimit defines maximum duration that automatic refresh activity can occur.

Hint

  • Automatic refresh is different than query and response timeouts performed by a networking library while sequentially attempting to retrieve addressed content from a url list.

Warning

  • Automatically reloading content has security considerations and needs to be considered carefully.

Advice

Hints

Warning

  • PackagedShader does not contain CDATA section of plain-text source code.

See Also

This post is licensed under CC BY 4.0 by the author.