Difference between revisions of "Material FX Composer 2 extension"

From COLLADA Public Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
 +
{{extensions|company=NVIDIA|product=FX Composer 2}}
 +
 +
== Scene Bindings ==
 +
FX Composer 2.0 allows binding of lights, cameras and node properties to materials.
 +
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 level (material).
 +
 +
{| border=1 cellspacing=0 cellpadding=3 align=center
 +
|-
 +
!width=20%| <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 ==
 
  <material id="Material" name="New_Effect_Material">
 
  <material id="Material" name="New_Effect_Material">
 
     <instance_effect url="#Effect">
 
     <instance_effect url="#Effect">
        <technique_hint platform="PS3" ref="Main"/>
+
      [...]
        <technique_hint platform="PC-OGL" ref="Main"/>
 
        <setparam ref="Script">
 
            <float>0.8</float>
 
        </setparam>
 
        <setparam ref="WorldITXf">
 
            <float4x4>2.64034 0 0 0 0 2.64034 0 0 0 0 2.64034 0 -0 -4.09349 -3.88875
 
        </setparam>
 
        <setparam ref="WvpXf">
 
            <float4x4>0.826384 -1.51316e-008 -0.826384 -3.2136 -0.424814 0.849628 -0.
 
        </setparam>
 
        <setparam ref="WorldXf">
 
            <float4x4>0.378739 0 0 0 0 0.378739 0 1.55037 0 0 0.378739 1.47282 0 0 0
 
        </setparam>
 
        <setparam ref="ViewIXf">
 
            <float4x4>0.707107 -0.408248 0.57735 3.07478 -2.04465e-009 0.816497 0.577
 
        </setparam>
 
        <setparam ref="Lamp0Pos">
 
            <float3>0 1.55037 1.47282</float3>
 
        </setparam>
 
        <setparam ref="Lamp0Color">
 
            <float3>1 1 1</float3>
 
        </setparam>
 
        <setparam ref="AmbiColor">
 
            <float3>0.07 0.07 0.07</float3>
 
        </setparam>
 
        <setparam ref="Ks">
 
            <float>0.4</float>
 
        </setparam>
 
        <setparam ref="Eccentricity">
 
            <float>0.3</float>
 
        </setparam>
 
        <setparam ref="Bump">
 
            <float>1</float>
 
        </setparam>
 
        <setparam ref="Kr">
 
            <float>0.5</float>
 
        </setparam>
 
        <setparam ref="ColorTexture">
 
            <surface type="2D">
 
                <init_from>default_color</init_from>
 
                <format>R8G8B8</format>
 
                <size>1024 512 1</size>
 
            </surface>
 
        </setparam>
 
        <setparam ref="NormalTexture">
 
            <surface type="2D">
 
                <init_from>default_bump_normal</init_from>
 
                <format>R8G8B8A8</format>
 
                <size>1024 512 1</size>
 
            </surface>
 
        </setparam>
 
        <setparam ref="EnvTexture">
 
            <surface type="CUBE">
 
                <init_from>default_reflection</init_from>
 
                <format>R8G8B8A8</format>
 
                <size>512 512 1</size>
 
            </surface>
 
        </setparam>
 
 
     </instance_effect>
 
     </instance_effect>
 
     <extra type="bind_object">
 
     <extra type="bind_object">

Revision as of 22:42, 13 June 2007

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

Scene Bindings

FX Composer 2.0 allows binding of lights, cameras and node properties to materials. 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 level (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

<material id="Material" name="New_Effect_Material">
   <instance_effect url="#Effect">
     [...]
   </instance_effect>
   <extra type="bind_object">
       <technique profile="NV_bind_object">
           <bind_object object="pointlight0" target="#Node2" sid="FXLightInstance"/>
       </technique>
   </extra>
</material>