Extension: Difference between revisions
move note about wiki xtns to top |
some rewriting |
||
Line 1: | Line 1: | ||
[[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. | [[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 multiple representations of | [[COLLADA]] enables multirepresentation of many of its elements; that is, an element can contain multiple representations of its meaning, each relevant to a different environment. In such cases, the element is defined using one required <technique_common> and zero or more <technique> elements: | ||
* The common technique is a representation of the element that is strongly typed in the schema. | |||
Other techniques are defined by | * 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 extension applies. | ||
Each alternative representation of an extensible element should contain values that describe the element for that profile. The representations may have coherency | Each alternative representation of an extensible element should contain values that describe the element for that profile. The representations may have coherency between profiles, although that is not required. In other words, if <technique_common> describes an ambient light, an alternative <technique> for that light could validly describe something else, such as an area light for the specified profile. | ||
== Using <technique> to choose profiles == | |||
A COLLADA processor | A COLLADA processor will choose either one, and only one, of the available alternatives. It will choose the <technique_common> '''or''' one of the <technique> elements. Where alternative choices are possible within the schema, the <technique> element models the alternative extensions. For example: | ||
<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"/> | |||
<technique profile="alternative_2" | |||
</list> | </list> | ||
= Extension by Addition = | |||
== Using <extra> to add data == | |||
=== <extra> uses <technique> too === | |||
= Scalable Vertex Attributes = | |||
== Using <input> to add attribute streams == | |||
==See also== | ==See also== | ||
* [[Portal:Extensions directory]] | * [[Portal:Extensions directory]] | ||
* [[COLLADA:Wiki customization project#Software_extensions|MediaWiki extensions installed here]] | |||
[[Category:COLLADA extensions|*E]][[Category:COLLADA terminology]] | [[Category:COLLADA extensions|*E]][[Category:COLLADA terminology]] |
Revision as of 23:38, 4 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, an element can contain multiple representations of its meaning, each relevant to a different environment. In such cases, the element is defined using one required <technique_common> and zero or more <technique> elements:
- The common technique is a representation of the element that is strongly typed in the schema.
- 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 extension applies.
Each alternative representation of an extensible element should contain values that describe the element for that profile. The representations may have coherency between profiles, although that is not required. In other words, if <technique_common> describes an ambient light, an alternative <technique> for that light could validly describe something else, such as an area light for the specified profile.
Using <technique> to choose profiles
A COLLADA processor will choose either one, and only one, of the available alternatives. It will choose the <technique_common> or one of the <technique> elements. Where alternative choices are possible within the schema, the <technique> element models the alternative extensions. For example:
<light> <technique_common> <ambient> <color/> </ambient> </technique_common> <technique profile="alternative_1"/> <technique profile="alternative_2"/> </list>