From COLLADA Public Wiki
Revision as of 20:21, 13 March 2009 by Elf (talk | contribs) (tweak intro)
Jump to navigation Jump to search
This article is about COLLADA extensions. For:

COLLADA provides flexibility by allowing applications to define extensions to existing COLLADA elements. These extensions take the form of alternative <technique> elements, additive <extra> elements, and scalable <input> elements.

Extension by alternative

COLLADA enables extensibility and multiple representation of many of its elements using one <technique_common> and zero or more alternative <technique> elements:

  • The common technique, which is required by the schema, is a strongly typed representation of the element.
  • Other techniques are defined by the vendor supplying the alternative representation. Each <technique> has a profile attribute that specifies the platform (product name or similar) to which the representation applies.

Each alternative representation contains values that describe the element for that profile. The representations may have coherency between profiles, although that is not required. For example, if <technique_common> describes an ambient light, an alternative <technique> for that light could validly describe either a different kind of ambient light or something else, such as an area light, for the specified profile.

Using <technique> to choose profiles

Where alternative choices are possible within the schema, the <technique> element models the alternative extensions. A COLLADA processor chooses one, and only one, of the available alternatives, either the <technique_common> or one of the <technique> elements. For example:

  <technique profile="alternative_1">
  <technique profile="alternative_2">
    <arealight />

Extension by addition

An extensible schema also requires a means for specifying arbitrary information. This extra information can represent additional real data or semantic (meta) data to the application.

COLLADA represents extra information using <technique> elements within an <extra> element. Each <technique> contains arbitrary XML elements and data and is labeled with a profile attribute specifying the environment to which it applies.

Using <extra> to add data

Here is an example of an <extra> element that outlines both structured and unstructured additional content:

   <technique profile="Max" xmlns:max="some/max/schema"> 
     <param name="wow" sid="animated" type="string">a validated string parameter from the COLLADA schema.</param> 
     <max:someElement>defined in the Max schema and validated.</max:someElement> 
     <uhoh>something well-formed and legal, but that can’t be validated because there is no schema for it!</uhoh> 

Scalable Vertex Attributes

Using <input> to add attribute streams

See also