Extension: Difference between revisions
→Using to choose profiles: fix example...lost changes earlier? |
|||
Line 14: | Line 14: | ||
<light> | <light> | ||
<technique_common> | <technique_common> | ||
<ambient> | |||
<color/> | |||
</ambient> | |||
</technique_common> | </technique_common> | ||
<technique profile="alternative_1"/> | <technique profile="alternative_1"> | ||
<technique profile="alternative_2"/> | <ambient> | ||
<color/> | |||
</ambient> | |||
</technique> | |||
<technique profile="alternative_2"> | |||
<arealight /> | |||
</technique> | |||
</list> | </list> | ||
Revision as of 00:38, 5 December 2008
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 multirepresentation of many of its elements; that is, some elements can contain multiple representations of their meanings, each relevant to a different environment. In such cases, the element is defined using one required <technique_common> and zero or more alternative <technique> elements:
- The common technique 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 of an extensible element 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:
<light> <technique_common> <ambient> <color/> </ambient> </technique_common> <technique profile="alternative_1"> <ambient> <color/> </ambient> </technique> <technique profile="alternative_2"> <arealight /> </technique> </list>