Instance material FX Composer 2 extension

From COLLADA Public Wiki
Jump to: navigation, search
Extension information
  • Purpose: unstated
  • Company(s): NVIDIA
  • Product(s): FX Composer 2
  • Last updated: unstated
  • Contact for technical issues:
This article is part of the COLLADA extensions directory
Adding to the extensions directory

Vertex Remapper

In addition to standard collada stream binding, FX Composer 2.0 allows finer control of this binding at the component level. This information is stored in an extra at the material instance level (instance_material).

<bind_vertex_input_remap> Attributes Description
shader_semantic The semantic of the shader to bind the stream to
shader_component The component of the shader semantic to bind to
input_semantic The input stream semantic to feed to the shader
input_component The component of the specified input stream to feed to the shader
input_set The input set of the stream

Example

<instance_geometry url="#LOD3spShape-lib" sid="InstanceGeometry1" name="LOD3spShape">
   <bind_material>
       <technique_common>
           <instance_material symbol="DuckMaterial" target="#Material">
               <extra type="input_remap">
                   <technique profile="NVIDIA_FXCOMPOSER">
                       <bind_vertex_input_remap  shader_semantic="TEXCOORD" shader_component="W" input_semantic="TEXCOORD" input_component="W" input_set="0"/>
                       <bind_vertex_input_remap  shader_semantic="TEXCOORD" shader_component="Y" input_semantic="TANGENT" input_component="X" input_set="0"/>
                       <bind_vertex_input_remap  shader_semantic="TEXCOORD" shader_component="Z" input_semantic="TEXCOORD" input_component="Y" input_set="0"/>
                       <bind_vertex_input_remap  shader_semantic="TEXCOORD" shader_component="X" input_semantic="BITANGENT" input_component="Z" input_set="0"/>
                   </technique>
               </extra>
           </instance_material>
       </technique_common>
   </bind_material>
</instance_geometry>


Scene Bindings

FX Composer 2.0 allows binding of lights, cameras and node properties to material instances. The internal mechanism automatically binds scene item parameters such as light position, color, direction, transformation to material parameters. To store these bindings in Collada files, FX Composer 2.0 uses an extra at the material instance level (instance_material).

<bind_object> Attributes Description
object The name of the binding connection at the material level. Binding connections are defined in shader parameter annotations
target The target node
sid The sid of the instance object to bind to

Example

<instance_material symbol="SphereMaterial" target="#Material">
   <extra type="bind_object">
       <technique profile="NV_bind_object">
           <bind_object object="diffuselight" target="#Node1" sid="FXLightInstance"/>
       </technique>
   </extra>
</instance_material>