<!--
Copyright 2013 Autodesk, Inc. All rights reserved. 

Use of this software is subject to the terms of the Autodesk 
license agreement provided at the time of installation or download, 
or which otherwise accompanies this software in either electronic 
or hard copy form.
-->
<fragment  uiName="xgenVSVw" name="xgenVSVw" type="interpolant" class="ShadeFragment" version="1.0" feature_level="0" >
    <description>
        <![CDATA[
Generate vector in world space for xgen splines.]]>
    </description>
    <properties>
        <float3  name="PmFinal" flags="varyingInputParam" />
        <float4x4  name="world" semantic="world" />
        <float3  name="worldCameraPosition" semantic="worldcameraposition" />
    </properties>
    <values>
    </values>
    <outputs>
        <float3  name="Vw" semantic="Vw" />
    </outputs>
    <implementation>
        <implementation  render="OGSRenderer" language="Cg" lang_version="2.100000" >
            <function_name val="xgenVSVw" />
            <vertex_source>
                <![CDATA[
float3 ixgenVSVw(float3 PmFinal, float4x4 world, float3 worldCameraPosition)
{
    return worldCameraPosition - mul(world, float4(PmFinal, 1.0f)).xyz;
}
                ]]>
            </vertex_source>
            <source>
                <![CDATA[
float3 xgenVSVw(float3 iVw)
{
    return normalize(iVw);
}
               ]]>
             </source>
        </implementation>
        <implementation  render="OGSRenderer" language="HLSL" lang_version="11.000000" >
            <function_name val="xgenVSVw" />
            <vertex_source>
                <![CDATA[
float3 ixgenVSVw(float3 PmFinal, float4x4 world, float3 worldCameraPosition)
{
    return worldCameraPosition - mul(world, float4(PmFinal, 1.0f)).xyz;
}
                ]]>
            </vertex_source>
            <source>
                <![CDATA[
float3 xgenVSVw(float3 iVw)
{
    return normalize(iVw);
}
               ]]>
            </source>
        </implementation>
        <implementation  render="OGSRenderer" language="HLSL" lang_version="10.000000" >
            <function_name val="xgenVSVw" />
            <vertex_source>
                <![CDATA[
float3 ixgenVSVw(float3 PmFinal, float4x4 world, float3 worldCameraPosition)
{
    return worldCameraPosition - mul(world, float4(PmFinal, 1.0f)).xyz;
}
                ]]>
            </vertex_source>
            <source>
                <![CDATA[
float3 xgenVSVw(float3 iVw)
{
    return normalize(iVw);
}
               ]]>
            </source>
        </implementation>
    </implementation>
</fragment>