ÿþ<?xml version="1.0" encoding="UTF-16" standalone="no"?> <fxstudio_project fileversion="3" buildversion="1.7.202.1100" originalpath="F:\devrel\SDK\MEDIA\projects\subsurface1.fxproj"><system_settings><searchpaths><texture><path name="F:\devrel\SDK\MEDIA\projects\"/><path name="E:\sw\devrel\SDK\MEDIA\projects\"/><path name="C:\devrel\NV_SDK_DOCS\Presentations\2004\SIGGRAPH_2004\Projects\"/></texture><shader><path name="F:\devrel\SDK\MEDIA\projects\"/><path name="E:\sw\devrel\SDK\MEDIA\projects\"/><path name="C:\devrel\NV_SDK_DOCS\Presentations\2004\SIGGRAPH_2004\Projects\"/></shader><model><path name="F:\devrel\SDK\MEDIA\projects\"/><path name="E:\sw\devrel\SDK\MEDIA\projects\"/><path name="C:\devrel\NV_SDK_DOCS\Presentations\2004\SIGGRAPH_2004\Projects\"/></model></searchpaths></system_settings><scene objectid="1" sceneticks="100"><parameterlist objectid="2"><connectionparameter objectid="3" name="World" semantic="WORLD" type="5" rows="4" columns="4" handle="65077624" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.320243e-036,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="View" semantic="VIEW" type="5" rows="4" columns="4" handle="3531648" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="4.945586e-039,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="7.110909e-001,3.728862e-001,-5.960751e-001,0.000000e+000,-1.001109e-007,8.477813e-001,5.303458e-001,0.000000e+000,7.030999e-001,-3.771240e-001,6.028498e-001,0.000000e+000,-2.756824e-001,-5.149505e-001,8.583422e-001,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Projection" semantic="PROJECTION" type="5" rows="4" columns="4" handle="3531064" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.321590e-036,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.275299e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.191754e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.003922e+000,1.000000e+000,0.000000e+000,0.000000e+000,-5.099155e-003,0.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Scene Center" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="65053056" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="8.543206e-001, 2.736306e-002, -6.733689e-001"/></keys></connectionparameter><connectionparameter objectid="3" name="Scene Extents" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="65055136" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="8.649721e-001, 7.752414e-001, 6.733689e-001"/></keys></connectionparameter><connectionparameter objectid="3" name="Screen Size" semantic="UNKNOWN" type="2" rows="0" columns="0" handle="3525776" animated="0" numkeys="1" defaulttype="float2" defaultvalue="2.560000e+002, 2.560000e+002"><keys><key num="0" value="4.850000e+002, 5.190000e+002"/></keys></connectionparameter><connectionparameter objectid="3" name="Show Lights" semantic="UNKNOWN" type="4" rows="0" columns="0" handle="65114568" animated="0" numkeys="1" defaulttype="bool" defaultvalue="1"><keys><key num="0" value="0"/></keys></connectionparameter><connectionparameter objectid="3" name="Show Cameras" semantic="UNKNOWN" type="4" rows="0" columns="0" handle="3538656" animated="0" numkeys="1" defaulttype="bool" defaultvalue="1"><keys><key num="0" value="1"/></keys></connectionparameter><connectionparameter objectid="3" name="Show Text" semantic="UNKNOWN" type="4" rows="0" columns="0" handle="65054744" animated="0" numkeys="1" defaulttype="bool" defaultvalue="1"><keys><key num="0" value="1"/></keys></connectionparameter></parameterlist><material objectid="4" name="Translucent2_2" handle="256" effect="F:\devrel\SDK\MEDIA\HLSL\Translucent2.fx"><parameterlist objectid="2"><connectionparameter objectid="3" name="QuadTexOffset" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="100263984" animated="0" numkeys="1" defaulttype="float" defaultvalue="5.000000e-001"><keys><key num="0" value="5.000000e-001"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="QuadScreenSize" semantic="VIEWPORTPIXELSIZE" type="2" rows="0" columns="0" handle="99900184" animated="0" numkeys="1" defaulttype="float2" defaultvalue="0.000000e+000, 0.000000e+000"><keys><key num="0" value="6.400000e+001, 6.400000e+001"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="Script" semantic="STANDARDSGLOBAL" type="3" rows="0" columns="0" handle="99413328" animated="0" numkeys="1" defaulttype="float" defaultvalue="8.000000e-001"><keys><key num="0" value="8.000000e-001"/></keys><annotation nametype="9" valuetype="9" name="SCRIPT" value="Technique=Main;"/><annotation nametype="9" valuetype="9" name="SCRIPTCLASS" value="SCENE"/><annotation nametype="9" valuetype="9" name="SCRIPTORDER" value="STANDARD"/><annotation nametype="9" valuetype="9" name="SCRIPTOUTPUT" value="COLOR"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="ClearColor" semantic="UNKNOWN" type="0" rows="0" columns="0" handle="99953832" animated="1" numkeys="1" defaulttype="float4" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="0.000000e+000, 0.000000e+000, 0.000000e+000, 0.000000e+000"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="ShadowClearColor" semantic="UNKNOWN" type="0" rows="0" columns="0" handle="99954216" animated="1" numkeys="1" defaulttype="float4" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="0.000000e+000, 0.000000e+000, 0.000000e+000, 0.000000e+000"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="ClearDepth" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="99563936" animated="1" numkeys="1" defaulttype="float" defaultvalue="1.000000e+000"><keys><key num="0" value="1.000000e+000"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="WorldITXf" semantic="WORLDINVERSETRANSPOSE" type="5" rows="4" columns="4" handle="99563408" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="WorldViewProjXf" semantic="WORLDVIEWPROJECTION" type="5" rows="4" columns="4" handle="99219120" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,"><keys><key num="0" value="1.732051e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.732051e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.012658e+000,1.000000e+000,0.000000e+000,0.000000e+000,2.481013e+000,2.500000e+000,"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="WorldXf" semantic="WORLD" type="5" rows="4" columns="4" handle="100440384" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="ViewIXf" semantic="VIEWINVERSE" type="5" rows="4" columns="4" handle="99219528" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,-2.500000e+000,1.000000e+000,"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="WorldViewITXf" semantic="WORLDVIEWINVERSETRANSPOSE" type="5" rows="4" columns="4" handle="99220056" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,-2.500000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="WorldViewXf" semantic="WORLDVIEW" type="5" rows="4" columns="4" handle="102689472" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,"><keys><key num="0" value="9.999999e-001,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,9.999999e-001,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,2.500000e+000,1.000000e+000,"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="ViewXf" semantic="VIEW" type="5" rows="4" columns="4" handle="102690040" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,"><keys><key num="0" value="9.999999e-001,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,9.999999e-001,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,2.500000e+000,1.000000e+000,"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="ViewITXf" semantic="VIEWINVERSETRANSPOSE" type="5" rows="4" columns="4" handle="99412544" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,-2.500000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="LampViewXf" semantic="VIEW" type="5" rows="4" columns="4" handle="87415904" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,"><keys><key num="0" value="0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,"/></keys><annotation nametype="9" valuetype="9" name="FRUSTUM" value="LIGHT"/><calculator objectid="5" name="Light0 Connection"><nvcalculator_loadindexed objectid="6" regdest="0" index="0" loopindex="0" type="0"/></calculator></connectionparameter><connectionparameter objectid="3" name="LampProjXf" semantic="PROJECTION" type="5" rows="4" columns="4" handle="87416880" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,"><keys><key num="0" value="1.732051e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.732051e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.012658e+000,1.000000e+000,0.000000e+000,0.000000e+000,-5.063291e-002,0.000000e+000,"/></keys><annotation nametype="9" valuetype="9" name="FRUSTUM" value="LIGHT"/><calculator objectid="5" name="Light0 Connection"><nvcalculator_loadindexed objectid="6" regdest="0" index="0" loopindex="0" type="0"/></calculator></connectionparameter><connectionparameter objectid="3" name="InternalPower" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="87416312" animated="0" numkeys="1" defaulttype="float" defaultvalue="5.000000e-001"><keys><key num="0" value="1.690000e+000"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="8.000000e+000"/><annotation nametype="9" valuetype="3" name="UIMIN" value="1.000000e-001"/><annotation nametype="9" valuetype="9" name="UINAME" value="Internal Exponent"/><annotation nametype="9" valuetype="3" name="UISTEP" value="1.000000e-002"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="SLIDER"/></connectionparameter><connectionparameter objectid="3" name="InternalScale" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="101361264" animated="0" numkeys="1" defaulttype="float" defaultvalue="2.000000e+000"><keys><key num="0" value="1.670000e+000"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="5.000000e+000"/><annotation nametype="9" valuetype="3" name="UIMIN" value="1.000000e-002"/><annotation nametype="9" valuetype="9" name="UINAME" value="Internal Falloff Scale"/><annotation nametype="9" valuetype="3" name="UISTEP" value="1.000000e-002"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="SLIDER"/></connectionparameter><connectionparameter objectid="3" name="Ki" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="99242992" animated="0" numkeys="1" defaulttype="float" defaultvalue="1.000000e+000"><keys><key num="0" value="1.000000e+000"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="2.050000e+001"/><annotation nametype="9" valuetype="3" name="UIMIN" value="0.000000e+000"/><annotation nametype="9" valuetype="9" name="UINAME" value="Internal Strength"/><annotation nametype="9" valuetype="3" name="UISTEP" value="1.000000e-002"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="SLIDER"/></connectionparameter><connectionparameter objectid="3" name="InternalColor" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="102996032" animated="0" numkeys="1" defaulttype="float3" defaultvalue="7.000000e-001, 7.000000e-001, 1.000000e+000"><keys><key num="0" value="7.000000e-001, 7.000000e-001, 1.000000e+000"/></keys><annotation nametype="9" valuetype="9" name="UINAME" value="Internal"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="COLOR"/></connectionparameter><connectionparameter objectid="3" name="Inset" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="87242624" animated="0" numkeys="1" defaulttype="float" defaultvalue="3.000000e-002"><keys><key num="0" value="7.900000e-001"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="1.040000e+001"/><annotation nametype="9" valuetype="3" name="UIMIN" value="1.000000e-002"/><annotation nametype="9" valuetype="9" name="UINAME" value="Internal Inset Distance"/><annotation nametype="9" valuetype="3" name="UISTEP" value="1.000000e-002"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="SLIDER"/></connectionparameter><connectionparameter objectid="3" name="FresExp" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="87242792" animated="0" numkeys="1" defaulttype="float" defaultvalue="5.000000e-001"><keys><key num="0" value="5.000000e-001"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="8.100000e+000"/><annotation nametype="9" valuetype="3" name="UIMIN" value="1.000000e-001"/><annotation nametype="9" valuetype="9" name="UINAME" value="Fresnel Exponent"/><annotation nametype="9" valuetype="3" name="UISTEP" value="1.000000e-002"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="SLIDER"/></connectionparameter><connectionparameter objectid="3" name="SurfColor" semantic="DIFFUSE" type="1" rows="0" columns="0" handle="87242960" animated="0" numkeys="1" defaulttype="float3" defaultvalue="1.000000e+000, 7.000000e-001, 3.000000e-001"><keys><key num="0" value="1.000000e+000, 7.000000e-001, 3.000000e-001"/></keys><annotation nametype="9" valuetype="9" name="UINAME" value="Surface"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="COLOR"/></connectionparameter><connectionparameter objectid="3" name="Kd" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="87273432" animated="0" numkeys="1" defaulttype="float" defaultvalue="1.000000e+000"><keys><key num="0" value="1.000000e+000"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="1.500000e+000"/><annotation nametype="9" valuetype="3" name="UIMIN" value="0.000000e+000"/><annotation nametype="9" valuetype="9" name="UINAME" value="Diffuse"/><annotation nametype="9" valuetype="3" name="UISTEP" value="1.000000e-002"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="SLIDER"/></connectionparameter><connectionparameter objectid="3" name="Ks" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="99552200" animated="0" numkeys="1" defaulttype="float" defaultvalue="1.000000e+000"><keys><key num="0" value="1.000000e+000"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="1.500000e+000"/><annotation nametype="9" valuetype="3" name="UIMIN" value="0.000000e+000"/><annotation nametype="9" valuetype="9" name="UINAME" value="Specular"/><annotation nametype="9" valuetype="3" name="UISTEP" value="1.000000e-002"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="SLIDER"/></connectionparameter><connectionparameter objectid="3" name="SpecExpon" semantic="SPECULARPOWER" type="3" rows="0" columns="0" handle="99552552" animated="0" numkeys="1" defaulttype="float" defaultvalue="5.200000e+001"><keys><key num="0" value="5.200000e+001"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="1.280000e+002"/><annotation nametype="9" valuetype="3" name="UIMIN" value="1.000000e+000"/><annotation nametype="9" valuetype="9" name="UINAME" value="Specular power"/><annotation nametype="9" valuetype="3" name="UISTEP" value="1.000000e+000"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="SLIDER"/></connectionparameter><connectionparameter objectid="3" name="ShadDensity" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="87246152" animated="0" numkeys="1" defaulttype="float" defaultvalue="1.000000e+000"><keys><key num="0" value="1.000000e+000"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="1.000000e+000"/><annotation nametype="9" valuetype="3" name="UIMIN" value="0.000000e+000"/><annotation nametype="9" valuetype="9" name="UINAME" value="Shadow Density"/><annotation nametype="9" valuetype="3" name="UISTEP" value="1.000000e-001"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="SLIDER"/></connectionparameter><connectionparameter objectid="3" name="ShadBias" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="87246720" animated="0" numkeys="1" defaulttype="float" defaultvalue="4.000000e-003"><keys><key num="0" value="7.000000e-003"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="1.000000e-001"/><annotation nametype="9" valuetype="3" name="UIMIN" value="0.000000e+000"/><annotation nametype="9" valuetype="9" name="UINAME" value="Shad Bias"/><annotation nametype="9" valuetype="3" name="UISTEP" value="1.000000e-003"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="SLIDER"/></connectionparameter><connectionparameter objectid="3" name="SpotLightPos" semantic="POSITION" type="1" rows="0" columns="0" handle="99311888" animated="0" numkeys="1" defaulttype="float3" defaultvalue="-1.000000e+000, 1.000000e+000, 0.000000e+000"><keys><key num="0" value="-1.000000e+000, 1.000000e+000, 0.000000e+000"/></keys><annotation nametype="9" valuetype="9" name="OBJECT" value="SPOTLIGHT"/><annotation nametype="9" valuetype="9" name="SPACE" value="WORLD"/><annotation nametype="9" valuetype="9" name="UINAME" value="Spot Pos"/><calculator objectid="5" name="Default Spot Light : POSITION"><nvcalculator_load objectid="7" scenehandle="104" paramname="Object Position" regdest="1" constantvalue="UNKNOWN" constanttype="2147483647" constantrows="0" constantcolumns="0"/><nvcalculator_load objectid="7" scenehandle="107" paramname="Current Transform" regdest="2" constantvalue="UNKNOWN" constanttype="2147483647" constantrows="0" constantcolumns="0"/><nvcalculator_mul objectid="8" regdest="3" reg1="1" reg2="2" op="0"/><nvcalculator_mov objectid="9" type="1" rows="0" columns="0" regdest="0" regsource="3"/></calculator></connectionparameter><connectionparameter objectid="3" name="SpotLightDir" semantic="DIRECTION" type="1" rows="0" columns="0" handle="101361832" animated="0" numkeys="1" defaulttype="float3" defaultvalue="-7.070000e-001, 7.070000e-001, 1.000000e+000"><keys><key num="0" value="-7.070000e-001, 7.070000e-001, 1.000000e+000"/></keys><annotation nametype="9" valuetype="9" name="OBJECT" value="SPOTLIGHT"/><annotation nametype="9" valuetype="9" name="SPACE" value="WORLD"/><annotation nametype="9" valuetype="9" name="UINAME" value="Spot Dir"/><calculator objectid="5" name="Default Spot Light : DIRECTION"><nvcalculator_load objectid="7" scenehandle="104" paramname="Object Direction" regdest="1" constantvalue="UNKNOWN" constanttype="2147483647" constantrows="0" constantcolumns="0"/><nvcalculator_load objectid="7" scenehandle="107" paramname="Current Transform" regdest="2" constantvalue="UNKNOWN" constanttype="2147483647" constantrows="0" constantcolumns="0"/><nvcalculator_mul objectid="8" regdest="3" reg1="1" reg2="2" op="1"/><nvcalculator_normalize objectid="10" regdest="3" regsource="3"/><nvcalculator_mov objectid="9" type="1" rows="0" columns="0" regdest="0" regsource="3"/></calculator></connectionparameter><connectionparameter objectid="3" name="SpotLightCone" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="87272904" animated="0" numkeys="1" defaulttype="float" defaultvalue="4.100000e+001"><keys><key num="0" value="4.100000e+001"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="9.050000e+001"/><annotation nametype="9" valuetype="3" name="UIMIN" value="0.000000e+000"/><annotation nametype="9" valuetype="9" name="UINAME" value="Spot Cone Angle"/><annotation nametype="9" valuetype="3" name="UISTEP" value="1.000000e-001"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="SLIDER"/></connectionparameter><connectionparameter objectid="3" name="SpotLightColor" semantic="DIFFUSE" type="1" rows="0" columns="0" handle="87272416" animated="0" numkeys="1" defaulttype="float3" defaultvalue="8.000000e-001, 1.000000e+000, 4.000000e-001"><keys><key num="0" value="8.000000e-001, 1.000000e+000, 4.000000e-001"/></keys><annotation nametype="9" valuetype="9" name="OBJECT" value="SPOTLIGHT"/><annotation nametype="9" valuetype="9" name="UINAME" value="Spot Color"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="COLOR"/><calculator objectid="5" name="Default Spot Light : DIFFUSE"><nvcalculator_load objectid="7" scenehandle="104" paramname="Diffuse" regdest="1" constantvalue="UNKNOWN" constanttype="2147483647" constantrows="0" constantcolumns="0"/><nvcalculator_mov objectid="9" type="1" rows="0" columns="0" regdest="0" regsource="1"/></calculator></connectionparameter><connectionparameter objectid="3" name="SpotLightIntensity" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="99899632" animated="0" numkeys="1" defaulttype="float" defaultvalue="1.000000e+000"><keys><key num="0" value="1.000000e+000"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="8.000000e+000"/><annotation nametype="9" valuetype="3" name="UIMIN" value="0.000000e+000"/><annotation nametype="9" valuetype="9" name="UINAME" value="Spot Intensity"/><annotation nametype="9" valuetype="3" name="UISTEP" value="1.000000e-001"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="SLIDER"/></connectionparameter><connectionparameter objectid="3" name="AmbiLightColor" semantic="AMBIENT" type="1" rows="0" columns="0" handle="99008272" animated="0" numkeys="1" defaulttype="float3" defaultvalue="7.000000e-002, 7.000000e-002, 7.000000e-002"><keys><key num="0" value="7.000000e-002, 7.000000e-002, 7.000000e-002"/></keys><annotation nametype="9" valuetype="9" name="UINAME" value="Ambient Light"/></connectionparameter><connectionparameter objectid="3" name="ShadMap" semantic="RENDERCOLORTARGET" type="6" rows="0" columns="0" handle="87244480" animated="0" numkeys="1" defaulttype="texture" defaultvalue=""><keys><key num="0" value=""/></keys><annotation nametype="9" valuetype="9" name="FORMAT" value="a16b16g16r16f"/><annotation nametype="9" valuetype="8" name="HEIGHT" value="1024"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/><annotation nametype="9" valuetype="8" name="WIDTH" value="1024"/></connectionparameter><connectionparameter objectid="3" name="ShadSampler" semantic="UNKNOWN" type="12" rows="0" columns="0" handle="99481720" animated="0" numkeys="1" defaulttype="sampler" defaultvalue="UNKNOWN"><keys><key num="0" value="UNKNOWN"/></keys></connectionparameter><connectionparameter objectid="3" name="ShadDepthTarget" semantic="RENDERDEPTHSTENCILTARGET" type="6" rows="0" columns="0" handle="99482696" animated="0" numkeys="1" defaulttype="texture" defaultvalue=""><keys><key num="0" value=""/></keys><annotation nametype="9" valuetype="9" name="FORMAT" value="D24S8"/><annotation nametype="9" valuetype="8" name="HEIGHT" value="1024"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/><annotation nametype="9" valuetype="8" name="WIDTH" value="1024"/></connectionparameter></parameterlist><ScriptParams nametype="9" valuetype="8" name="WIDTH" value="1024"><parameterlist objectid="2"/></ScriptParams></material><node objectid="11" name="3DText" materialoverride="0" handle="103" worldskin="0"><text3d objectid="12" name=""><parameterlist objectid="2"><connectionparameter objectid="3" name="Display Text" semantic="UNKNOWN" type="9" rows="7" columns="0" handle="99540336" animated="1" numkeys="1" defaulttype="string" defaultvalue="geForce"><keys><key num="0" value="ab"/></keys></connectionparameter><connectionparameter objectid="3" name="Font" semantic="UNKNOWN" type="9" rows="16" columns="0" handle="99578512" animated="0" numkeys="1" defaulttype="string" defaultvalue="Monotype Corsiva"><keys><key num="0" value="Monotype Corsiva"/></keys></connectionparameter><connectionparameter objectid="3" name="Extrusion" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="99577864" animated="1" numkeys="1" defaulttype="float" defaultvalue="2.500000e-001"><keys><key num="0" value="2.500000e-001"/></keys></connectionparameter></parameterlist></text3d><texgen objectid="13" name=""><parameterlist objectid="2"><connectionparameter objectid="3" name="Coord Set" semantic="UNKNOWN" type="7" rows="0" columns="0" handle="99971080" animated="0" numkeys="1" defaulttype="dword" defaultvalue="0"><keys><key num="0" value="0"/></keys></connectionparameter></parameterlist></texgen><meshmender objectid="14" name=""><parameterlist objectid="2"/></meshmender></node><node objectid="15" name="Default Spot Light" handle="104" type="3"><parameterlist objectid="2"><connectionparameter objectid="3" name="Diffuse" semantic="DIFFUSE" type="0" rows="0" columns="0" handle="99971472" animated="1" numkeys="1" defaulttype="float4" defaultvalue="1.000000e+000, 1.000000e+000, 1.000000e+000, 1.000000e+000"><keys><key num="0" value="1.000000e+000, 1.000000e+000, 1.000000e+000, 1.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Specular" semantic="SPECULAR" type="0" rows="0" columns="0" handle="99972040" animated="1" numkeys="1" defaulttype="float4" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="2.000000e-001, 2.000000e-001, 2.000000e-001, 2.000000e-001"/></keys></connectionparameter><connectionparameter objectid="3" name="Ambient" semantic="AMBIENT" type="0" rows="0" columns="0" handle="87274096" animated="1" numkeys="1" defaulttype="float4" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="1.500000e-001, 1.500000e-001, 1.500000e-001, 1.500000e-001"/></keys></connectionparameter><connectionparameter objectid="3" name="Exponent" semantic="SPECULARPOWER" type="3" rows="0" columns="0" handle="99340632" animated="1" numkeys="1" defaulttype="float" defaultvalue="1.000000e+000"><keys><key num="0" value="3.000000e+001"/></keys></connectionparameter><connectionparameter objectid="3" name="Object Position" semantic="POSITION" type="1" rows="0" columns="0" handle="138607472" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="0.000000e+000, 0.000000e+000, 0.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Object Direction" semantic="DIRECTION" type="1" rows="0" columns="0" handle="87311664" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="0.000000e+000, 0.000000e+000, 1.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Umbra" semantic="LIGHTUMBRA" type="3" rows="0" columns="0" handle="99539808" animated="1" numkeys="1" defaulttype="float" defaultvalue="5.000000e-001"><keys><key num="0" value="7.000000e-001"/></keys></connectionparameter><connectionparameter objectid="3" name="Penumbra" semantic="LIGHTPENUMBRA" type="3" rows="0" columns="0" handle="99538712" animated="1" numkeys="1" defaulttype="float" defaultvalue="1.000000e+000"><keys><key num="0" value="1.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Falloff" semantic="LIGHTFALLOFF" type="3" rows="0" columns="0" handle="99276440" animated="1" numkeys="1" defaulttype="float" defaultvalue="1.000000e+000"><keys><key num="0" value="0.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Range" semantic="LIGHTRANGE" type="3" rows="0" columns="0" handle="87428464" animated="1" numkeys="1" defaulttype="float" defaultvalue="1.000000e+000"><keys><key num="0" value="0.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Attenuation" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="99539240" animated="1" numkeys="1" defaulttype="float3" defaultvalue="1.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="1.000000e+000, 0.000000e+000, 0.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="View" semantic="VIEW" type="5" rows="4" columns="4" handle="99273944" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="7.337232e-001,4.470995e-001,5.116171e-001,0.000000e+000,-1.116829e-001,8.221084e-001,-5.582691e-001,0.000000e+000,-6.702067e-001,3.524761e-001,6.531336e-001,0.000000e+000,-4.573791e-001,-3.700843e-001,8.822801e-001,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Projection" semantic="PROJECTION" type="5" rows="4" columns="4" handle="87378216" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.958810e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.830488e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.003922e+000,1.000000e+000,0.000000e+000,0.000000e+000,-8.654508e-003,0.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Depth Range" semantic="UNKNOWN" type="2" rows="0" columns="0" handle="87376864" animated="0" numkeys="1" defaulttype="float2" defaultvalue="0.000000e+000, 1.000000e+000"><keys><key num="0" value="8.620701e-003, 2.206899e+000"/></keys></connectionparameter></parameterlist></node><node objectid="16" name="Default Scene Camera" handle="105" target="4294967295" defaultcamera="1" activecamera="1"><parameterlist objectid="2"><connectionparameter objectid="3" name="Focal Length" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="87274624" animated="0" numkeys="1" defaulttype="float" defaultvalue="1.000000e+000"><keys><key num="0" value="8.188383e-001"/></keys></connectionparameter><connectionparameter objectid="3" name="Field of View" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="87275680" animated="0" numkeys="1" defaulttype="float" defaultvalue="8.000000e+001"><keys><key num="0" value="8.000000e+001"/></keys></connectionparameter><connectionparameter objectid="3" name="Depth Range" semantic="UNKNOWN" type="2" rows="0" columns="0" handle="87275152" animated="0" numkeys="1" defaulttype="float2" defaultvalue="0.000000e+000, 1.000000e+000"><keys><key num="0" value="5.079236e-003, 1.300285e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Look Direction" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="87273752" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, 1.000000e+000"><keys><key num="0" value="-5.960751e-001, 5.303458e-001, 6.028498e-001"/></keys></connectionparameter><connectionparameter objectid="3" name="Up Direction" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="99538144" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 1.000000e+000, 0.000000e+000"><keys><key num="0" value="3.728862e-001, 8.477814e-001, -3.771241e-001"/></keys></connectionparameter><connectionparameter objectid="3" name="Lookat Matrix" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="87470776" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="7.110909e-001,3.728862e-001,-5.960751e-001,0.000000e+000,-1.001109e-007,8.477813e-001,5.303458e-001,0.000000e+000,7.030999e-001,-3.771240e-001,6.028498e-001,0.000000e+000,-2.756824e-001,-5.149505e-001,8.583422e-001,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Camera Position" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="87470208" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, -1.000000e+000"><keys><key num="0" value="8.996896e-001, -1.865274e-002, -5.178193e-001"/></keys></connectionparameter></parameterlist></node><nvtransformlink objectid="17" parent="0" handle="102" name="Root Transform" animated="1" separable="0"><nodes/><parameterlist objectid="2"><connectionparameter objectid="3" name="Matrix" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="87402896" animated="1" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Reference Matrix" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="99234064" animated="1" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Rotation" semantic="UNKNOWN" type="25" rows="0" columns="0" handle="99335248" animated="1" numkeys="1" defaulttype="quat" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000, 1.000000e+000"><keys><key num="0" value="0.000000e+000, 0.000000e+000, 0.000000e+000, 1.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Translation" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="99146784" animated="1" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="0.000000e+000, 0.000000e+000, 0.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Scale" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="137682952" animated="1" numkeys="1" defaulttype="float3" defaultvalue="1.000000e+000, 1.000000e+000, 1.000000e+000"><keys><key num="0" value="1.000000e+000, 1.000000e+000, 1.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Current Transform" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="99608888" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys></connectionparameter></parameterlist><nvtransformlink objectid="17" parent="102" handle="106" name="Object Transform" animated="1" separable="1"><nodes><node handle="103"/></nodes><parameterlist objectid="2"><connectionparameter objectid="3" name="Matrix" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="87310448" animated="1" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Reference Matrix" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="99769000" animated="1" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Rotation" semantic="UNKNOWN" type="25" rows="0" columns="0" handle="87367800" animated="1" numkeys="1" defaulttype="quat" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000, 1.000000e+000"><keys><key num="0" value="0.000000e+000, 0.000000e+000, 0.000000e+000, 1.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Translation" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="99764896" animated="1" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="0.000000e+000, 0.000000e+000, 0.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Scale" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="87454608" animated="1" numkeys="1" defaulttype="float3" defaultvalue="1.000000e+000, 1.000000e+000, 1.000000e+000"><keys><key num="0" value="1.000000e+000, 1.000000e+000, 1.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Current Transform" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="87442520" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys></connectionparameter></parameterlist></nvtransformlink><nvtransformlink objectid="17" parent="102" handle="107" name="Light Transform" animated="1" separable="1"><nodes><node handle="104"/></nodes><parameterlist objectid="2"><connectionparameter objectid="3" name="Matrix" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="139622648" animated="1" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Reference Matrix" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="99202552" animated="1" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Rotation" semantic="UNKNOWN" type="25" rows="0" columns="0" handle="87415008" animated="1" numkeys="1" defaulttype="quat" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000, 1.000000e+000"><keys><key num="0" value="2.542084e-001, 3.298704e-001, -1.559657e-001, 8.956676e-001"/></keys></connectionparameter><connectionparameter objectid="3" name="Translation" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="87456216" animated="1" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="4.966465e-002, 7.457178e-001, -7.523394e-001"/></keys></connectionparameter><connectionparameter objectid="3" name="Scale" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="87310704" animated="1" numkeys="1" defaulttype="float3" defaultvalue="1.000000e+000, 1.000000e+000, 1.000000e+000"><keys><key num="0" value="1.000000e+000, 1.000000e+000, 1.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Current Transform" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="87166536" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="7.337204e-001,-1.116752e-001,-6.702040e-001,0.000000e+000,4.470985e-001,8.221056e-001,3.524755e-001,0.000000e+000,5.116129e-001,-5.582694e-001,6.531273e-001,0.000000e+000,4.966465e-002,7.457178e-001,-7.523394e-001,1.000000e+000,"/></keys></connectionparameter></parameterlist></nvtransformlink><nvtransformlink objectid="17" parent="102" handle="108" name="Default Camera Transform" animated="0" separable="1"><nodes><node handle="105"/></nodes><parameterlist objectid="2"><connectionparameter objectid="3" name="Matrix" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="87377736" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Reference Matrix" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="87062688" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Rotation" semantic="UNKNOWN" type="25" rows="0" columns="0" handle="87179248" animated="0" numkeys="1" defaulttype="quat" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000, 1.000000e+000"><keys><key num="0" value="-2.551763e-001, -3.653220e-001, -1.048539e-001, 8.890616e-001"/></keys></connectionparameter><connectionparameter objectid="3" name="Translation" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="99225568" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="8.996896e-001, -1.865274e-002, -5.178193e-001"/></keys></connectionparameter><connectionparameter objectid="3" name="Scale" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="99550176" animated="0" numkeys="1" defaulttype="float3" defaultvalue="1.000000e+000, 1.000000e+000, 1.000000e+000"><keys><key num="0" value="1.000000e+000, 1.000000e+000, 1.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Current Transform" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="65878064" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,0.000000e+000,1.000000e+000,"><keys><key num="0" value="7.110910e-001,-1.192093e-007,7.031000e-001,0.000000e+000,3.728862e-001,8.477814e-001,-3.771241e-001,0.000000e+000,-5.960751e-001,5.303458e-001,6.028498e-001,0.000000e+000,8.996896e-001,-1.865274e-002,-5.178193e-001,1.000000e+000,"/></keys></connectionparameter></parameterlist></nvtransformlink></nvtransformlink><scenematerials scenematerial="256"/></scene><objects><object objectid="10" objectguid="579911188_50621_18994_170_80_102_6_63_80_234_94" objectname="NVCalculator_Normalize Object" progid="nvsys.NVCalculator_Normalize.1"/><object objectid="5" objectguid="687344697_14784_17624_175_112_25_78_110_206_178_195" objectname="NVCalculator Object" progid="nvsys.NVCalculator.1"/><object objectid="3" objectguid="1178903711_54835_17816_162_225_77_133_92_204_97_107" objectname="NVConnectionParameter Object" progid="nvsys.NVConnectionParameter.1"/><object objectid="11" objectguid="1335965045_63750_16786_166_174_116_14_177_170_26_82" objectname="NVGeoPipe Object" progid="nvsys.NVGeoPipe.1"/><object objectid="1" objectguid="1394174672_42515_16399_189_63_62_31_182_9_209_60" objectname="NVScene Object" progid="nvsys.NVScene.1"/><object objectid="4" objectguid="1401340335_59252_17807_172_96_248_52_119_74_181_173" objectname="NVMaterial Object" progid="nvsys.NVMaterial.1"/><object objectid="15" objectguid="1473613511_28199_19656_142_150_59_31_21_147_173_150" objectname="NVLight_Spot Object" progid="nvsys.NVLight_Spot.1"/><object objectid="16" objectguid="1675712286_15683_20022_149_108_42_250_122_123_231_64" objectname="NVCamera Object" progid="nvsys.NVCamera.1"/><object objectid="9" objectguid="1755565597_56309_18722_149_152_96_3_18_125_126_123" objectname="NVCalculator_Assign Object" progid="nvsys.NVCalculator_Assign.1"/><object objectid="12" objectguid="1950628075_6623_16666_186_134_199_52_87_175_101_21" objectname="NVGeoPipeObject_3DText Object" progid="nvrenderdevice9.3DText.1"/><object objectid="17" objectguid="2342579002_10168_19906_178_150_26_144_17_106_220_182" objectname="NVTransformLink Object" progid="nvsys.NVTransformLink.1"/><object objectid="14" objectguid="2516468428_38854_16959_155_101_192_176_42_10_71_202" objectname="NVGeoPipeObject_MeshMender Object" progid="nvsys.NVGeoPipeObject_MeshMender.1"/><object objectid="6" objectguid="2739247491_20870_19692_162_171_236_45_242_106_70_222" objectname="NVCalculator_LoadIndexed Object" progid="nvsys.NVCalculator_LoadIndexed.1"/><object objectid="7" objectguid="3098681227_22869_16810_191_237_249_13_61_143_28_123" objectname="NVCalculator_Load Object" progid="nvsys.NVCalculator_Load.1"/><object objectid="2" objectguid="3275223899_28196_19999_162_153_111_232_35_119_165_23" objectname="NVParameterList Object" progid="nvsys.NVParameterList.1"/><object objectid="13" objectguid="4057994036_6371_17546_152_57_13_140_51_98_219_190" objectname="NVGeoPipeObject_TexGen Object" progid="nvsys.NVGeoPipeObject_TexGen.1"/><object objectid="8" objectguid="4162726501_8958_17137_170_77_131_38_3_90_246_20" objectname="NVCalculator_Mul Object" progid="nvsys.NVCalculator_Mul.1"/></objects><media_objects><effect path="F:\devrel\SDK\MEDIA\HLSL\Translucent2.fx"><![CDATA[/*********************************************************************NVMH3**** File: $Id: //sw/devrel/SDK/MEDIA/HLSL/Translucent2.fx#5 $ Copyright NVIDIA Corporation 2004 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Comments: This shader models translucent materials, and shows light shadowing/diffusing through the model. Shadow using a floating-point texture -- place depth into the r channel, but also a fresnel term (relative to the light position) in the b. When rendering, use the depth of the shaded point, relative to the lamp, to determine if it's in shadow and HOW MUCH it's in shadow based on diffusion of light through the surface. Diminish the intensity based on the light-space fresnel term to realistically model the loss of penetrating light along glancing angles. ******************************************************************************/ #include <include\\nvMatrix.fxh> #include <include\\Quad.fxh> float Script : STANDARDSGLOBAL < string UIWidget = "none"; string ScriptClass = "scene"; string ScriptOrder = "standard"; string ScriptOutput = "color"; string Script = "Technique=Main;"; > = 0.8; // version # float4 ClearColor <string UIWidget="none";> = {0,0,0,0}; float4 ShadowClearColor <string UIWidget="none";> = {0,0,0,0}; float ClearDepth <string UIWidget="none";> = 1; /************* "UN-TWEAKABLES," TRACKED BY CPU APPLICATION **************/ float4x4 WorldITXf : WorldInverseTranspose <string UIWidget="None";>; float4x4 WorldViewProjXf : WorldViewProjection <string UIWidget="None";>; float4x4 WorldXf : World <string UIWidget="None";>; float4x4 ViewIXf : ViewInverse <string UIWidget="None";>; float4x4 WorldViewITXf : WorldViewInverseTranspose <string UIWidget="None";>; float4x4 WorldViewXf : WorldView <string UIWidget="None";>; float4x4 ViewXf : View <string UIWidget="None";>; float4x4 ViewITXf : ViewInverseTranspose <string UIWidget="None";>; float4x4 LampViewXf : View < //string UIWidget="None"; string frustum = "light0"; >; float4x4 LampProjXf : Projection < //string UIWidget="None"; string frustum = "light0"; >; /////////////////////////////////////////////////////////////// /// TWEAKABLES //////////////////////////////////////////////// /////////////////////////////////////////////////////////////// ////////////////////////////////////////////// surface float InternalPower < string UIWidget = "slider"; float UIMin = 0.1; float UIMax = 8.0; float UIStep = 0.01; string UIName = "Internal Exponent"; > = 0.5; float InternalScale < string UIWidget = "slider"; float UIMin = 0.01; float UIMax = 5.0; float UIStep = 0.01; string UIName = "Internal Falloff Scale"; > = 2.0; float Ki < string UIWidget = "slider"; float UIMin = 0.0; float UIMax = 20.5; float UIStep = 0.01; string UIName = "Internal Strength"; > = 1.0; float3 InternalColor < string UIWidget = "Color"; string UIName = "Internal"; > = {0.7f, 0.7f, 1.0f}; float Inset < string UIWidget = "slider"; float UIMin = 0.01; float UIMax = 10.4; float UIStep = 0.01; string UIName = "Internal Inset Distance"; > = 0.03; ////////////// float FresExp < string UIWidget = "slider"; float UIMin = 0.1; float UIMax = 8.1; float UIStep = 0.01; string UIName = "Fresnel Exponent"; > = 0.5; ///////////// float3 SurfColor : Diffuse < string UIName = "Surface"; string UIWidget = "Color"; > = {1.0f, 0.7f, 0.3f}; float Kd < string UIWidget = "slider"; float UIMin = 0.0; float UIMax = 1.5; float UIStep = 0.01; string UIName = "Diffuse"; > = 1.0; float Ks < string UIWidget = "slider"; float UIMin = 0.0; float UIMax = 1.5; float UIStep = 0.01; string UIName = "Specular"; > = 1.0; float SpecExpon : SpecularPower < string UIWidget = "slider"; float UIMin = 1.0; float UIMax = 128.0; float UIStep = 1.0; string UIName = "Specular power"; > = 52.0; /////////////////// float ShadDensity < string UIName = "Shadow Density"; string UIWidget = "slider"; float UIMin = 0.0; float UIMax = 1.0; float UIStep = 0.1; > = 1; float ShadBias < string UIWidget = "slider"; float UIMin = 0.0; float UIMax = 0.1; float UIStep = 0.001; string UIName = "Shad Bias"; > = 0.004; ////////////////////////////////////////////// spot light float3 SpotLightPos : POSITION < string UIName = "Spot Pos"; string Object = "SpotLight"; string Space = "World"; > = {-1.0f, 1.0f, 0.0f}; float3 SpotLightDir : DIRECTION < string UIName = "Spot Dir"; string Object = "SpotLight"; string Space = "World"; > = {-0.707f, 0.707f, 1.0f}; float SpotLightCone < string UIWidget = "slider"; float UIMin = 0.0; float UIMax = 90.5; float UIStep = 0.1; string UIName = "Spot Cone Angle"; > = 41.0; float3 SpotLightColor : Diffuse < string UIName = "Spot Color"; string Object = "SpotLight"; string UIWidget = "Color"; > = {0.8f, 1.0f, 0.4f}; float SpotLightIntensity < string UIName = "Spot Intensity"; string UIWidget = "slider"; float UIMin = 0.0; float UIMax = 8; float UIStep = 0.1; > = 1; ////////////////////////////////////////////// ambient light float3 AmbiLightColor : Ambient < string UIName = "Ambient Light"; > = {0.07f, 0.07f, 0.07f}; //////////////////////////////////////////////////////// /// TEXTURES /////////////////////////////////////////// //////////////////////////////////////////////////////// #define SHADOW_SIZE 1024 // fixed-size shadow texture texture ShadMap : RENDERCOLORTARGET < // float2 ViewPortDimensions = {1.0,1.0}; int Width = SHADOW_SIZE; int Height = SHADOW_SIZE; //int MIPLEVELS = 0; string format = "a16b16g16r16f"; string UIWidget = "None"; >; sampler ShadSampler = sampler_state { texture = <ShadMap>; AddressU = BORDER; AddressV = BORDER; MIPFILTER = NONE; MINFILTER = POINT; MAGFILTER = POINT; }; texture ShadDepthTarget : RENDERDEPTHSTENCILTARGET < int Width = SHADOW_SIZE; int Height = SHADOW_SIZE; string format = "D24S8"; string UIWidget = "None"; >; ///////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// SHADER CODE BEGINS ///////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /*********************************************************/ /************* SHARED DATA STRUCT ************************/ /*********************************************************/ /* data from application vertex buffer */ struct appdata { float3 Position : POSITION; float4 UV : TEXCOORD0; float4 Normal : NORMAL; }; /////////////////////////////////////////////////////////////////////////////// /// Basic Version Does Almost All Calcs in the Pixel Shader /////////////////// /////////////////////////////////////////////////////////////////////////////// struct vertexOutput { float4 HPosition : POSITION; float2 UV : TEXCOORD0; float3 LightVec : TEXCOORD1; float3 WNormal : TEXCOORD2; float3 WView : TEXCOORD3; float4 LP : TEXCOORD4; float4 LPin : TEXCOORD5; }; /*********************************************************/ /*********** vertex shader *******************************/ /*********************************************************/ //////////////////////////////////////////////////////////////////////////////// /// Vertex Shaders ///////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // from lamp POV vertexOutput shadVS(appdata IN, uniform float4x4 SpotViewProjXf) { vertexOutput OUT = (vertexOutput)0; OUT.WNormal = mul(IN.Normal,WorldITXf).xyz; float4 Po = float4(IN.Position.xyz,(float)1.0); // object coordinates float4 Pw = mul(Po,WorldXf); // world coordinates float4 Pl = mul(Pw,SpotViewProjXf); // "P" in light coords OUT.LP = Pl; // view coords OUT.WView = normalize(ViewIXf[3].xyz - Pw.xyz); // obj coords OUT.HPosition = Pl; // mul(Po,WorldViewProjXf); // screen clipspace coords OUT.UV = IN.UV.xy; OUT.LightVec = SpotLightPos - Pw.xyz; // in world coords return OUT; } // from scene camera POV vertexOutput mainCamVS(appdata IN, uniform float4x4 SpotViewProjXf) { vertexOutput OUT = (vertexOutput)0; float3 Nw = normalize(mul(IN.Normal,WorldITXf).xyz); OUT.WNormal = Nw; float4 Po = float4(IN.Position.xyz,(float)1.0); // object coordinates float4 Pw = mul(Po,WorldXf); // world coordinates float4 Pl = mul(Pw,SpotViewProjXf); // "P" in light coords OUT.LP = Pl; // view coords float4 Iw = Pw + -Inset*float4(Nw,0); // inset point float4 Il = mul(Iw,SpotViewProjXf); // "P" in light coords OUT.LPin = Il; // view coords OUT.WView = normalize(ViewIXf[3].xyz - Pw.xyz); // obj coords OUT.HPosition = mul(Po,WorldViewProjXf); // screen clipspace coords OUT.UV = IN.UV.xy; OUT.LightVec = SpotLightPos - Pw.xyz; // in world coords return OUT; } /*********************************************************/ /*********** pixel shader ********************************/ /*********************************************************/ float4 makeShadPS(vertexOutput IN,uniform float CosSpotAng) : COLOR { float3 Nn = normalize(IN.WNormal); float3 Ln = normalize(IN.LightVec); float ldn = abs(dot(Ln,Nn)); float fres = pow(ldn,FresExp); float dep = IN.LP.z; return float4(dep,dep,fres,1); } float4 useShadowPS(vertexOutput IN,uniform float CosSpotAng) : COLOR { float3 Nn = normalize(IN.WNormal); float3 Vn = normalize(IN.WView); float3 Ln = normalize(IN.LightVec); float3 Hn = normalize(Vn + Ln); float hdn = dot(Hn,Nn); float ldn = dot(Ln,Nn); float aldn = abs(ldn); float ildn = -min(ldn,0); float ildn2 = pow(ildn,0.8); float4 litVec = lit(ldn,hdn,SpecExpon); ldn = litVec.y * SpotLightIntensity; float dl = dot(-SpotLightDir,Ln); dl = max((float)0,((dl-CosSpotAng)/(((float)1.0)-CosSpotAng))); ldn *= dl; float3 ambiContrib = SurfColor * AmbiLightColor; float3 diffContrib = SurfColor*(Kd*ldn * SpotLightColor); float3 specContrib = ((ldn * litVec.z * Ks) * SpotLightColor); float3 result = diffContrib + specContrib; // return float4(result,1); float2 nuv = float2(.5,-.5)*IN.LP.xy/IN.LP.w + float2(.5,.5); float4 tv = tex2D(ShadSampler,nuv); float shad = tv.x; float depth = (IN.LP.z) - ShadBias; //shad = ShadBias+ShadNear + shad*(ShadFar-ShadNear); float shadowed = (shad>depth)*ShadDensity+(1.0-ShadDensity); float3 litValue = lerp(float3(0,0,0),result,shadowed)+ambiContrib; float indepth = (IN.LPin.z/IN.LPin.w) - ShadBias; float internal = (1.0+max(0,indepth-shad))*InternalScale; internal = SpotLightIntensity*dl*Ki/pow(internal,InternalPower); float3 backlit = internal*InternalColor; return float4(litValue+backlit,1); } //////////////////////////////////////////////////////////////////// /// TECHNIQUES ///////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// technique Main < string Script = "Pass=MakeShadow;" "Pass=UseShadow;"; > { pass MakeShadow < string Script = "RenderColorTarget0=ShadMap;" "RenderDepthStencilTarget=ShadDepthTarget;" "RenderPort=light0;" "ClearSetColor=ShadowClearColor;" "ClearSetDepth=ClearDepth;" "Clear=Color;" "Clear=Depth;" "Draw=geometry;"; > { VertexShader = compile vs_2_0 shadVS(mul(LampViewXf,LampProjXf)); ZEnable = true; ZWriteEnable = true; CullMode = None; PixelShader = compile ps_2_a makeShadPS(cos(SpotLightCone*(float)(3.141592/180.0))); } pass UseShadow < string Script = "RenderColorTarget0=;" "RenderDepthStencilTarget=;" "RenderPort=;" "ClearSetColor=ClearColor;" "ClearSetDepth=ClearDepth;" "Clear=Color;" "Clear=Depth;" "Draw=geometry;"; > { VertexShader = compile vs_2_0 mainCamVS(mul(LampViewXf,LampProjXf)); ZEnable = true; ZWriteEnable = true; CullMode = None; PixelShader = compile ps_2_a useShadowPS(cos(SpotLightCone*(float)(3.141592/180.0))); } } //////// final view, four previous views as panels /***************************** eof ***/ ]]></effect><effect path="f:\devrel\sdk\media\hlsl\include\\nvinverse.fxh"><![CDATA[//////////////////////////////////////////////////////////////////////NVMH3//// // File: $Id: //sw/devrel/SDK/MEDIA/HLSL/include/nvInverse.fxh#1 $ // // Copyright NVIDIA Corporation 2004 // TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS // PROVIDED *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, // EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN // NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, // INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, // WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS // INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) // ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF // NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. // // HLSL Virtual Machine code for matrix inverse // // This file provides a stand-in until HLSL has an inverse() intrinic function // /////////////////////////////////////////////////////////////////////////////// #ifndef _NVINVERSE_H #define _NVINVERSE_H // okay, so this one seems excessive float nvMatrixCollapse(float2x2 inpMatrix, int row, int column) { float result = 0; int i; int m = 0; for (i = 0; i < 1; i += 1) { if (m == row) m += 1; int j; int n = 0; for ( j = 0; j < 1; j += 1) { if (n == column) n += 1; result = inpMatrix[m][n]; n += 1; } m += 1; } return result; } float2x2 nvMatrixCollapse(float3x3 inpMatrix, int row, int column) { float2x2 result = (float2x2)0; int i; int m = 0; for (i = 0; i < 2; i += 1) { if (m == row) m += 1; int j; int n = 0; for ( j = 0; j < 2; j += 1) { if (n == column) n += 1; result[i][j] = inpMatrix[m][n]; n += 1; } m += 1; } return result; } float3x3 nvMatrixCollapse(float4x4 inpMatrix, int row, int column ) { float3x3 result = (float3x3)0; int i; int m = 0; for (i = 0; i < 3; i += 1) { if (m == row) m += 1; int j; int n = 0; for ( j = 0; j < 3; j += 1) { if (n == column) n += 1; result[i][j] = inpMatrix[m][n]; n += 1; } m += 1; } return result; } // Returns a matrix which is the Adjoint of inpMatrix. float4x4 nvAdjoint(float4x4 inpMatrix) { float4x4 result = (float4x4)0; result[0][0] = determinant(nvMatrixCollapse(inpMatrix, 0, 0)); result[0][1] = -determinant(nvMatrixCollapse(inpMatrix, 0, 1)); result[0][2] = determinant(nvMatrixCollapse(inpMatrix, 0, 2)); result[1][0] = -determinant(nvMatrixCollapse(inpMatrix, 1, 0)); result[1][1] = determinant(nvMatrixCollapse(inpMatrix, 1, 1)); result[1][2] = -determinant(nvMatrixCollapse(inpMatrix, 1, 2)); result[2][0] = determinant(nvMatrixCollapse(inpMatrix, 2, 0)); result[2][1] = -determinant(nvMatrixCollapse(inpMatrix, 2, 1)); result[2][2] = determinant(nvMatrixCollapse(inpMatrix, 2, 2)); // Cofactor of 4th column result[0][3] = -determinant(nvMatrixCollapse(inpMatrix, 0, 3)); result[1][3] = determinant(nvMatrixCollapse(inpMatrix, 1, 3)); result[2][3] = -determinant(nvMatrixCollapse(inpMatrix, 2, 3)); // Cofactor of 4th row result[3][0] = -determinant(nvMatrixCollapse(inpMatrix, 3, 0)); result[3][1] = determinant(nvMatrixCollapse(inpMatrix, 3, 1)); result[3][2] = -determinant(nvMatrixCollapse(inpMatrix, 3, 2)); result[3][3] = determinant(nvMatrixCollapse(inpMatrix, 3, 3)); // Adjoint is TRANSPOSE of matrix containing cofactors return transpose(result); } // Returns a matrix which is the Adjoint of inpMatrix. float3x3 nvAdjoint(float3x3 inpMatrix) { float3x3 result = (float3x3)0; // Cofactor of top-left 3×3 matrix result[0][0] = determinant(nvMatrixCollapse(inpMatrix, 0, 0)); result[0][1] = -determinant(nvMatrixCollapse(inpMatrix, 0, 1)); result[0][2] = determinant(nvMatrixCollapse(inpMatrix, 0, 2)); result[1][0] = -determinant(nvMatrixCollapse(inpMatrix, 1, 0)); result[1][1] = determinant(nvMatrixCollapse(inpMatrix, 1, 1)); result[1][2] = -determinant(nvMatrixCollapse(inpMatrix, 1, 2)); result[2][0] = determinant(nvMatrixCollapse(inpMatrix, 2, 0)); result[2][1] = -determinant(nvMatrixCollapse(inpMatrix, 2, 1)); result[2][2] = determinant(nvMatrixCollapse(inpMatrix, 2, 2)); // Adjoint is TRANSPOSE of matrix containing cofactors return transpose(result); } // Returns a matrix which is the Inverse of inpMatrix. float4x4 nvInverse(float4x4 inpMatrix) { float4x4 outMatrix = (float4x4)0; float det = determinant(inpMatrix); if ( det != 0.0 ) outMatrix = (1.0/ det) * nvAdjoint(inpMatrix); return outMatrix; } // Returns a matrix which is the Inverse of inpMatrix. float3x3 nvInverse(float3x3 inpMatrix) { float3x3 outMatrix = (float3x3)0; float det = determinant(inpMatrix); if ( det != 0.0 ) outMatrix = (1.0/ det) * nvAdjoint(inpMatrix); return outMatrix; } #endif /* _NVINVERSE_H */ ///////////////////////////////////////////// eof /// ]]></effect><effect path="f:\devrel\sdk\media\hlsl\include\\nvmatrix.fxh"><![CDATA[//////////////////////////////////////////////////////////////////////NVMH3//// // File: $Id: //sw/devrel/SDK/MEDIA/HLSL/include/nvMatrix.fxh#2 $ // // Copyright NVIDIA Corporation 2004 // TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS // PROVIDED *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, // EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN // NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, // INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, // WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS // INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) // ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF // NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. // // HLSL for matrix ops -- mostly useful for the Virtual Machine when setting up // state for hardware shaders. // // All functions return float4x4 // /////////////////////////////////////////////////////////////////////////////// #ifndef _NVMATRIX_H #define _NVMATRIX_H // FOR NOW, use dummy function in place of HLSL intrinsic inverse() #include <include\\nvInverse.fxh> #ifdef _NVINVERSE_H #define inverse nvInverse #endif /* _NVINVERSE_H */ ////////////////////// Super Basics ///////////////////// // Identity float4x4 nvIdentityXf() { return float4x4(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1); } /// translate float4x4 nvTranslateXf(float4 Vect) { return float4x4(1,0,0,0, 0,1,0,0, 0,0,1,0, Vect.xyz,1); } float4x4 nvTranslateXf(float3 Vect) { return float4x4(1,0,0,0, 0,1,0,0, 0,0,1,0, Vect.xyz,1); } float4x4 nvTranslateXf(float2 Vect) { return float4x4(1,0,0,0, 0,1,0,0, 0,0,1,0, Vect.xy,0,1); } float4x4 nvTranslateXf(float tx,float ty, float tz) { return float4x4(1,0,0,0, 0,1,0,0, 0,0,1,0, tx,ty,tz,1); } /// scale float4x4 nvScaleXf(float S) { return float4x4(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,S); } float4x4 nvScaleXf(float3 S) { return float4x4(S.x,0,0,0, 0,S.y,0,0, 0,0,S.z,0, 0,0,0,1); } float4x4 nvScaleXf(float4 S) { return float4x4(S.x,0,0,0, 0,S.y,0,0, 0,0,S.z,0, 0,0,0,S.w); } float4x4 nvScaleXf(float Sx, float Sy, float Sz) { return float4x4(Sx,0,0,0, 0,Sy,0,0, 0,0,Sz,0, 0,0,0,1); } /// rotate -- angles in radians float4x4 nvXRotateXf(float A) { float s = sin(A); float c = cos(A); return float4x4(1,0,0,0, 0,c,s,0, 0,-s,c,0, 0,0,0,1); } float4x4 nvYRotateXf(float A) { float s = sin(A); float c = cos(A); return float4x4(c,0,s,0, 0,1,0,0, -s,0,c,0, 0,0,0,1); } float4x4 nvZRotateXf(float A) { float s = sin(A); float c = cos(A); return float4x4(c,s,0,0, -s,c,0,0, 0,0,1,0, 0,0,0,1); } // we assume here that axis is NORMALIZED.... float4x4 nvRotateXf(float A,float3 Axis) { float s = sin(A); float c = cos(A); float t = 1.0 - c; float3 Ax2 = Axis*Axis; float txy = t*Axis.x*Axis.y; float txz = t*Axis.x*Axis.z; float tyz = t*Axis.y*Axis.z; return float4x4(t*Ax2.x+c, txy+s*Axis.z,txz-s*Axis.y,0, txy-s*Axis.z,t*Ax2.y+c, tyz+s*Axis.x,0, txz+s*Axis.y,tyz-s*Axis.x,t*Ax2.z+c, 0, 0,0,0,1); } float4x4 nvRotateXf(float A,float4 Axis) { return nvRotateXf(A,Axis.xyz); } float4x4 nvRotateXf(float A,float Ax,float Ay,float Az) { return nvRotateXf(A,normalize(float3(Ax,Ay,Az))); } // rotation submatrix // extract rotation matrix only float4x4 nvRotOnly(float4x4 inMatrix) { return float4x4(inMatrix[0].xyz,0, inMatrix[1].xyz,0, inMatrix[2].xyz,0, 0,0,0,1); } // extract translation matrix only float4x4 nvTransOnly(float4x4 inMatrix) { float4x4 R = nvRotOnly(inMatrix); float4x4 Rt = transpose(R); return mul(inMatrix,Rt); } //////////////// Projection /////////////////////////////////////// // D = distance to near Z float4x4 nvFrustumXf(float D) { return float4x4(1,0,0,0, 0,1,0,0, 0,0,1,(1.0/D), 0,0,-D,0); } // angles in radians float4x4 nvPerspAnglesXf(float AngleX,float AngleY,float ZNear, float ZFar) { float Q = ZFar/(ZFar-ZNear); float w = 1.0/tan(AngleX/2.0); float h = 1.0/tan(AngleY/2.0); return float4x4(w,0,0,0, 0,h,0,0, 0,0,Q,1, 0,0,-Q*ZNear,0); } // formula like D3DXMatrixPerspectiveLH() float4x4 nvPerspViewportXf(float Width,float Height,float ZNear, float ZFar) { float Q = ZFar/(ZFar-ZNear); float w = 2.0*ZNear / Width; float h = 2.0*ZNear / Height; return float4x4(w,0,0,0, 0,h,0,0, 0,0,Q,1, 0,0,-Q*ZNear,0); } float4x4 nvClipProjXf(float ZNear, float ZFar) { float zr = ZFar-ZNear; float a = (ZNear+ZFar)/zr; float b = (-2.0*ZNear*ZFar)/zr; return float4x4(1,0,0,0, 0,1,0,0, 0,0,a,-1, 0,0,b,0); } // Angle in Radians! float4x4 nvPerspectiveXf(float Angle,float Aspect,float ZNear, float ZFar) { float zr = ZFar-ZNear; float a = (ZNear+ZFar)/zr; float b = (-2.0*ZNear*ZFar)/zr; float t = 1.0 / tan(Angle/2.0); return float4x4(t/Aspect,0,0,0, 0,t,0,0, 0,0,a,-1, 0,0,b,0); } ///////// orthographic float4x4 nvOrthoProjXf(float Left, float Right, float Top, float Bottom, float ZNear, float ZFar) { float xr = Right-Left; float yr = Bottom-Top; float zr = ZFar-ZNear; float a = (ZNear+ZFar)/zr; float b = (-2.0*ZNear*ZFar)/zr; return float4x4(2.0/xr,0,0,0, 0,2.0/yr,0,0, 0,0,-2.0/zr,0, -(Right+Left)/xr,-(Top+Bottom)/yr,(ZNear+ZFar)/zr,1); } // handy matrices for spotlight projections ////////////////////////////////// // Since we might not ave the full xfrom of a spotlight, we can make a guess -- // we DO know its location and orientation, so by adding an arbitrary "up" // vector we can create a useful matrix for this spotlamp // // Inputs should be normalized // float4x4 nv_spot_xf(float3 Pos,float3 Aim,float3 Up) { float3 side = cross(Up,Aim); // to the side side = normalize(side); float3 top = cross(side,Aim); top = normalize(top); float4x4 tXf =nvTranslateXf(Pos.xyz); float4x4 rota = float4x4(side.xyz,0, top.xyz,0, Aim.xyz,0, 0,0,0,1); return mul(rota,tXf); } // // pass xf of a spotlight, its coneangle (in radians), near and far distances. // Handy for shadow mapping! // float4x4 nv_spot_proj_xf(float4x4 SpotXf,float ShadCone,float ShadNear,float ShadFar) { float4x4 invSpot = inverse(SpotXf); float4x4 proj = nvPerspAnglesXf(ShadCone,ShadCone,ShadNear, ShadFar); return mul(invSpot,proj); } #endif /* _NVMATRIX_H */ ///////////////////////////////////////////// eof /// ]]></effect><effect path="f:\devrel\sdk\media\hlsl\include\\quad.fxh"><![CDATA[/*********************************************************************NVMH3**** File: $Id: //sw/devrel/SDK/MEDIA/HLSL/include/Quad.fxh#1 $ Copyright NVIDIA Corporation 2004 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Comments: Header file with lots of useful macros, types, and functions for use with textures and render-to-texture-buffer effects in DirectX. Example Macro Usages: Texture-declaration Macros: FILE_TEXTURE_2D(SurfTexture,SurfSampler,"myfile.dds") // simple 2D wrap texture FILE_TEXTURE_2D_MODAL(SpotTexture,SpotSampler,"myfile.dds",CLAMP) // user-defined addr mode RenderTarget Texture-declaration Macros: DECLARE_QUAD_TEX(ObjTexture,ObjSampler,"A8R8G8B8") DECLARE_QUAD_DEPTH_BUFFER(DepthTexture,"D24S8") DECLARE_SIZED_QUAD_TEX(GlowTexture,GlowSampler,"A8R8G8B8",0.5) // scaled versions of above DECLARE_SIZED_QUAD_DEPTH_BUFFER(DepthTexture,"D24S8",0.5) DECLARE_SIZED_TEX(BlahMap,BlahSampler,"R32F",128,1) // address mode is "clamp" DECLARE_SQUARE_QUAD_TEX(ShadTexture,ShadObjSampler,"A16R16G16B16F",512) // for shadows etc DECLARE_SQUARE_QUAD_DEPTH_BUFFER(ShadDepth,"D24S8",512) Data types used in shaders: QUAD_REAL & QUAD_REAL# -- defaults to HALF but you can define QUAD_REAL float before #including "Quad.fxh" either by explicitly declaring all the QUAD_REAL types yourself, or #define-ing the symbol QUAD_FLOAT Flags (define before #including "Quad.fxh"): TWEAKABLE_TEXEL_OFFSET // shows in paramter panel NO_TEXEL_OFFSET // disables Structure: QuadVertexOutput -- used by shaders, defines simple connection for "Draw=buffer" VS and PS Shader Functions for "Draw=buffer" passes: QuadVertexOutput ScreenQuadVS(): standard vertex shader for screen-aligned quads QUAD_REAL4 TexQuadPS(QuadVertexOutput IN,uniform sampler2D InputSampler) pass this pixel shader a sampler -- will draw it to the screen QUAD_REAL4 TexQuadBiasPS(QuadVertexOutput IN,uniform sampler2D InputSampler,QUAD_REAL TBias) Same as above, but uses tex2Dbias() Utility Functions for Texture-Based Lookup Tables: QUAD_REAL scale_lookup(QUAD_REAL Value,const QUAD_REAL TableSize) QUAD_REAL2 scale_lookup(QUAD_REAL2 Value,const QUAD_REAL TableSize) QUAD_REAL3 scale_lookup(QUAD_REAL3 Value,const QUAD_REAL TableSize) Other Utility Functions: QUAD_REAL4 premultiply(QUAD_REAL4 C) QUAD_REAL4 unpremultiply(QUAD_REAL4 C) // uses macro value NV_ALPHA_EPSILON Global Variables: QUAD_REAL QuadTexOffset // reconciles difference between pixel and texel centers QUAD_REAL2 QuadScreenSize // VIEWPORTPIXELSIZE, contains dimensions of render window ******************************************************************************/ #ifndef _QUAD_FXH #define _QUAD_FXH // Numeric types we are likely to encounter.... // Redefine these before including "Quad.fxh" if you want // to use a type other than "half" for these data or just // define the symbol QUAD_FLOAT to use "floats" #ifndef QUAD_REAL #ifdef QUAD_FLOAT #define QUAD_REAL float #define QUAD_REAL2 float2 #define QUAD_REAL3 float3 #define QUAD_REAL4 float4 #define QUAD_REAL3x3 float3x3 #define QUAD_REAL4x3 float4x3 #define QUAD_REAL3x4 float3x4 #define QUAD_REAL4x4 float4x4 #else /* ! QUAD_FLOAT */ #define QUAD_REAL half #define QUAD_REAL2 half2 #define QUAD_REAL3 half3 #define QUAD_REAL4 half4 #define QUAD_REAL3x3 half3x3 #define QUAD_REAL4x3 half4x3 #define QUAD_REAL3x4 half3x4 #define QUAD_REAL4x4 half4x4 #endif /* ! QUAD_FLOAT */ #endif /* ! QUAD_REAL */ /////////////////////////////////////////////////////////////////////// /// Texture-Declaration Macros //////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // // Modal 2D File Textures // // example usage: FILE_TEXTURE_2D_MODAL(GlowMap,GlowSampler,"myfile.dds",CLAMP) // #define FILE_TEXTURE_2D_MODAL(TexName,SampName,Filename,AddrMode) texture TexName < \ string ResourceName = (Filename); \ string ResourceType = "2D"; \ >; \ sampler SampName = sampler_state { \ texture = <TexName>; \ AddressU = AddrMode; \ AddressV = AddrMode; \ MipFilter = LINEAR; \ MinFilter = LINEAR; \ MagFilter = LINEAR; \ }; // // Simple 2D File Textures // // example usage: FILE_TEXTURE_2D(GlowMap,GlowSampler,"myfile.dds") // #define FILE_TEXTURE_2D(TextureName,SamplerName,Diskfile) FILE_TEXTURE_2D_MODAL(TextureName,SamplerName,(Diskfile),WRAP) // // Use this variation of DECLARE_QUAD_TEX() if you want a *scaled* render target // // example usage: DECLARE_SIZED_QUAD_TEX(GlowMap,GlowSampler,"A8R8G8B8",1.0) #define DECLARE_SIZED_QUAD_TEX(TexName,SampName,PixFmt,Multiple) texture TexName : RENDERCOLORTARGET < \ float2 ViewPortRatio = {Multiple,Multiple}; \ int MipLevels = 1; \ string Format = PixFmt ; \ string UIWidget = "None"; \ >; \ sampler SampName = sampler_state { \ texture = <TexName>; \ AddressU = CLAMP; \ AddressV = CLAMP; \ MipFilter = POINT; \ MinFilter = LINEAR; \ MagFilter = LINEAR; \ }; // // Use this macro to easily declare typical color render targets // // example usage: DECLARE_QUAD_TEX(ObjMap,ObjSampler,"A8R8G8B8") #define DECLARE_QUAD_TEX(TextureName,SamplerName,PixelFormat) DECLARE_SIZED_QUAD_TEX(TextureName,SamplerName,(PixelFormat),1.0) // // Use this macro to easily declare variable-sized depth render targets // // example usage: DECLARE_SIZED_QUAD_DEPTH_BUFFER(DepthMap,"D24S8",0.5) #define DECLARE_SIZED_QUAD_DEPTH_BUFFER(TextureName,PixelFormat,Multiple) texture TextureName : RENDERDEPTHSTENCILTARGET < \ float2 ViewPortRatio = {Multiple,Multiple}; \ string Format = (PixelFormat); \ string UIWidget = "None"; \ >; // // Use this macro to easily declare typical depth render targets // // example usage: DECLARE_QUAD_DEPTH_BUFFER(DepthMap,"D24S8") #define DECLARE_QUAD_DEPTH_BUFFER(TexName,PixFmt) DECLARE_SIZED_QUAD_DEPTH_BUFFER(TexName,PixFmt,1.0) // // declare exact-sized arbitrary texture // // example usage: DECLARE_SIZED_TEX(BlahMap,BlahSampler,"R32F",128,1) #define DECLARE_SIZED_TEX(Tex,Samp,Fmt,Wd,Ht) texture Tex : RENDERCOLORTARGET < \ float2 Dimensions = { Wd, Ht }; \ string Format = Fmt ; \ string UIWidget = "None"; \ int miplevels=1;\ >; \ sampler Samp = sampler_state { \ texture = <Tex>; \ AddressU = CLAMP; \ AddressV = CLAMP; \ MipFilter = NONE; \ MinFilter = LINEAR; \ MagFilter = LINEAR; \ }; // // declare exact-sized square texture, as for shadow maps // // example usage: DECLARE_SQUARE_QUAD_TEX(ShadMap,ShadObjSampler,"A16R16G16B16F",512) #define DECLARE_SQUARE_QUAD_TEX(TexName,SampName,PixFmt,Size) DECLARE_SIZED_TEX(TexName,SampName,(PixFmt),Size,Size) // // likewise for shadow depth targets // // example usage: DECLARE_SQUARE_QUAD_DEPTH_BUFFER(ShadDepth,"D24S8",512) #define DECLARE_SQUARE_QUAD_DEPTH_BUFFER(TextureName,PixelFormat,Size) texture TextureName : RENDERDEPTHSTENCILTARGET < \ float2 Dimensions = { Size, Size }; \ string Format = (PixelFormat) ; \ string UIWidget = "None"; \ >; //////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////// Utility Functions //////// //////////////////////////////////////////////////////////////////////////// // // Scale inputs for use with texture-based lookup tables. A value ranging from zero to one needs // a slight scaling and offset to be sure to point at the centers of the first and last pixels // of that lookup texture. Pass the integer size of the table in TableSize // For now we'll assume that all tables are 1D, square, or cube-shaped -- all axes of equal size // // Cost of this operation for pixel shaders: two const-register // entries and a MAD (one cycle) QUAD_REAL scale_lookup(QUAD_REAL Value,const QUAD_REAL TableSize) { QUAD_REAL scale = ((TableSize - 1.0)/TableSize); QUAD_REAL shift = (0.5 / TableSize); return (scale*Value + shift); } QUAD_REAL2 scale_lookup(QUAD_REAL2 Value,const QUAD_REAL TableSize) { QUAD_REAL scale = ((TableSize - 1.0)/TableSize); QUAD_REAL shift = (0.5 / TableSize); return (scale.xx*Value + shift.xx); } QUAD_REAL3 scale_lookup(QUAD_REAL3 Value,const QUAD_REAL TableSize) { QUAD_REAL scale = ((TableSize - 1.0)/TableSize); QUAD_REAL shift = (0.5 / TableSize); return (scale.xxx*Value + shift.xxx); } // pre-multiply and un-pre-mutliply functions. The precision // of thse operatoions is often limited to 8-bit so don't // always count on them! // The macro value of NV_ALPHA_EPSILON, if defined, is used to // avoid IEEE "NaN" values that may occur when erroneously // dividing by a zero alpha (thanks to Pete Warden @ Apple // Computer for the suggestion in GPU GEMS II) // multiply color by alpha to turn an un-premultipied // pixel value into a premultiplied one QUAD_REAL4 premultiply(QUAD_REAL4 C) { return QUAD_REAL4((C.w*C.xyz),C.w); } #define NV_ALPHA_EPSILON 0.0001 // given a premultiplied pixel color, try to undo the premultiplication. // beware of precision errors QUAD_REAL4 unpremultiply(QUAD_REAL4 C) { #ifdef NV_ALPHA_EPSILON QUAD_REAL a = C.w + NV_ALPHA_EPSILON; return QUAD_REAL4((C.xyz / a),C.w); #else /* ! NV_ALPHA_EPSILON */ return QUAD_REAL4((C.xyz / C.w),C.w); #endif /* ! NV_ALPHA_EPSILON */ } ///////////////////////////////////////////////////////////////////////////////////// // Structure Declaration //////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// struct QuadVertexOutput { QUAD_REAL4 Position : POSITION; QUAD_REAL2 UV : TEXCOORD0; }; ///////////////////////////////////////////////////////////////////////////////////// // Hidden tweakables declared by this .fxh file ///////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// #ifndef NO_TEXEL_OFFSET #ifdef TWEAKABLE_TEXEL_OFFSET QUAD_REAL QuadTexOffset = 0.5; #else /* !TWEAKABLE_TEXEL_OFFSET */ QUAD_REAL QuadTexOffset < string UIWidget="None"; > = 0.5; #endif /* !TWEAKABLE_TEXEL_OFFSET */ QUAD_REAL2 QuadScreenSize : VIEWPORTPIXELSIZE < string UIWidget="None"; >; #endif /* NO_TEXEL_OFFSET */ //////////////////////////////////////////////////////////// ////////////////////////////////// vertex shaders ////////// //////////////////////////////////////////////////////////// QuadVertexOutput ScreenQuadVS( QUAD_REAL3 Position : POSITION, QUAD_REAL3 TexCoord : TEXCOORD0 ) { QuadVertexOutput OUT; OUT.Position = QUAD_REAL4(Position, 1); #ifdef NO_TEXEL_OFFSET OUT.UV = TexCoord.xy; #else /* NO_TEXEL_OFFSET */ QUAD_REAL2 off = QUAD_REAL2(QuadTexOffset/(QuadScreenSize.x),QuadTexOffset/(QuadScreenSize.y)); OUT.UV = QUAD_REAL2(TexCoord.xy+off); #endif /* NO_TEXEL_OFFSET */ return OUT; } ////////////////////////////////////////////////////// ////////////////////////////////// pixel shaders ///// ////////////////////////////////////////////////////// // add glow on top of model QUAD_REAL4 TexQuadPS(QuadVertexOutput IN,uniform sampler2D InputSampler) : COLOR { QUAD_REAL4 texCol = tex2D(InputSampler, IN.UV); return texCol; } QUAD_REAL4 TexQuadBiasPS(QuadVertexOutput IN,uniform sampler2D InputSampler,QUAD_REAL TBias) : COLOR { QUAD_REAL4 texCol = tex2Dbias(InputSampler, QUAD_REAL4(IN.UV,0,TBias)); return texCol; } ////////////////////////////////////////////////////////////////// /// Macros to define passes within Techniques //////////////////// ////////////////////////////////////////////////////////////////// // older HLSL syntax #define TEX_TECH(TechName,SamplerName) technique TechName { \ pass TexturePass { \ VertexShader = compile vs_2_0 ScreenQuadVS(); \ AlphaBlendEnable = false; ZEnable = false; \ PixelShader = compile ps_2_a TexQuadPS(SamplerName); } } #define TEX_BLEND_TECH(TechName,SamplerName) technique TechName { \ pass TexturePass { \ VertexShader = compile vs_2_0 ScreenQuadVS(); \ ZEnable = false; AlphaBlendEnable = true; \ SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; \ PixelShader = compile ps_2_a TexQuadPS(SamplerName); } } // newer HLSL syntax #define TEX_TECH2(TechName,SamplerName,TargName) technique TechName { \ pass TexturePass < \ string ScriptFunction = "RenderColorTarget0=" (TargName) ";" \ "DrawInternal=Buffer;"; \ > { \ VertexShader = compile vs_2_0 ScreenQuadVS(); \ AlphaBlendEnable = false; ZEnable = false; \ PixelShader = compile ps_2_a TexQuadPS(SamplerName); } } #define TEX_BLEND_TECH2(TechName,SamplerName) technique TechName { \ pass TexturePass < \ string ScriptFunction = "RenderColorTarget0=" (TargName) ";" \ "DrawInternal=Buffer;"; \ > { \ VertexShader = compile vs_2_0 ScreenQuadVS(); \ ZEnable = false; AlphaBlendEnable = true; \ SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; \ PixelShader = compile ps_2_a TexQuadPS(SamplerName); } } #endif /* _QUAD_FXH */ ////////////// eof /// ]]></effect></media_objects></fxstudio_project>