ÿþ<?xml version="1.0" encoding="UTF-16" standalone="no"?> <fxstudio_project fileversion="3" buildversion="1.7.419.0" originalpath="E:\sw\devrel\SDK\MEDIA\projects\raytrace.fxproj"><system_settings><searchpaths><texture><path name="E:\sw\devrel\SDK\MEDIA\projects\"/><path name="D:\src\sw\devtools\FXComposer1.5\SDK\MEDIA\projects\"/><path name="D:\src\sw\devrel\SDK\MEDIA\fxcomposer\"/><path name="C:\depot\sw\devrel\SDK\MEDIA\fxcomposer\"/><path name="C:\Documents and Settings\cmaughan\Desktop\new_projects\"/><path name="F:\src\sw\devtools\FXComposer1.0\SDK\MEDIA\fxcomposer\"/><path name="C:\Documents and Settings\cmaughan\Desktop\"/><path name="C:\depot\devrel\Playpen\simon\fx\raytrace\"/></texture><shader><path name="E:\sw\devrel\SDK\MEDIA\projects\"/><path name="D:\src\sw\devtools\FXComposer1.5\SDK\MEDIA\projects\"/><path name="D:\src\sw\devrel\SDK\MEDIA\fxcomposer\"/><path name="C:\depot\sw\devrel\SDK\MEDIA\fxcomposer\"/><path name="C:\Documents and Settings\cmaughan\Desktop\new_projects\"/><path name="F:\src\sw\devtools\FXComposer1.0\SDK\MEDIA\fxcomposer\"/><path name="C:\Documents and Settings\cmaughan\Desktop\"/><path name="C:\depot\devrel\Playpen\simon\fx\raytrace\"/></shader><model><path name="E:\sw\devrel\SDK\MEDIA\projects\"/><path name="D:\src\sw\devtools\FXComposer1.5\SDK\MEDIA\projects\"/><path name="D:\src\sw\devrel\SDK\MEDIA\fxcomposer\"/><path name="C:\depot\sw\devrel\SDK\MEDIA\fxcomposer\"/><path name="C:\Documents and Settings\cmaughan\Desktop\new_projects\"/><path name="F:\src\sw\devtools\FXComposer1.0\SDK\MEDIA\fxcomposer\"/><path name="C:\Documents and Settings\cmaughan\Desktop\"/><path name="C:\depot\devrel\Playpen\simon\fx\raytrace\"/></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="3710064" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.676524e-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="3722784" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="5.222393e-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="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,5.048965e+000,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Projection" semantic="PROJECTION" type="5" rows="4" columns="4" handle="3727304" animated="0" numkeys="1" defaulttype="float4x4" defaultvalue="1.679173e-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.121407e+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,-1.979986e-002,0.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Scene Center" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="68067336" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="0.000000e+000, -6.332994e-008, -3.211982e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Scene Extents" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="68069416" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, 0.000000e+000"><keys><key num="0" value="0.000000e+000, 6.332994e-008, 3.211982e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Screen Size" semantic="UNKNOWN" type="2" rows="0" columns="0" handle="3722008" animated="0" numkeys="1" defaulttype="float2" defaultvalue="2.560000e+002, 2.560000e+002"><keys><key num="0" value="2.880000e+002, 2.710000e+002"/></keys></connectionparameter><connectionparameter objectid="3" name="Show Lights" semantic="UNKNOWN" type="4" rows="0" columns="0" handle="68089128" animated="0" numkeys="1" defaulttype="bool" defaultvalue="1"><keys><key num="0" value="1"/></keys></connectionparameter><connectionparameter objectid="3" name="Show Cameras" semantic="UNKNOWN" type="4" rows="0" columns="0" handle="68069696" 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="68128712" animated="0" numkeys="1" defaulttype="bool" defaultvalue="1"><keys><key num="0" value="0"/></keys></connectionparameter></parameterlist><material objectid="4" name="raytrace_2_2_2_3" handle="1189" effect="E:\sw\devrel\SDK\MEDIA\HLSL\raytrace_spheres.fx"><parameterlist objectid="2"><connectionparameter objectid="3" name="Script" semantic="STANDARDSGLOBAL" type="3" rows="0" columns="0" handle="143952736" 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=PS20;"/><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="view" semantic="VIEWINVERSE" type="5" rows="4" columns="4" handle="123585688" 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.771003e-001,9.662094e-002,-1.895770e-001,0.000000e+000,-4.717328e-002,9.671509e-001,2.497877e-001,0.000000e+000,2.074843e-001,-2.351246e-001,9.495614e-001,0.000000e+000,-5.187107e-001,5.878116e-001,-2.373903e+000,1.000000e+000,"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="time" semantic="TIME" type="3" rows="0" columns="0" handle="121137960" animated="0" numkeys="1" defaulttype="float" defaultvalue="0.000000e+000"><keys><key num="0" value="5.054865e+004"/></keys><annotation nametype="9" valuetype="9" name="UIWIDGET" value="NONE"/></connectionparameter><connectionparameter objectid="3" name="viewport" semantic="VIEWPORTPIXELSIZE" type="2" rows="0" columns="0" handle="90551992" 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="foclen" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="121790592" animated="0" numkeys="1" defaulttype="float" defaultvalue="5.000000e+002"><keys><key num="0" value="1.000000e+003"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="5.000000e+003"/><annotation nametype="9" valuetype="3" name="UIMIN" value="1.000000e+000"/><annotation nametype="9" valuetype="9" name="UINAME" value="Focal Length"/><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="lightPosition" semantic="POSITION" type="1" rows="0" columns="0" handle="121464432" animated="0" numkeys="1" defaulttype="float3" defaultvalue="1.000000e+001, 1.000000e+001, -1.000000e+001"><keys><key num="0" value="1.000000e+001, 1.000000e+001, -1.000000e+001"/></keys><annotation nametype="9" valuetype="9" name="OBJECT" value="POINTLIGHT"/><annotation nametype="9" valuetype="9" name="SPACE" value="WORLD"/><annotation nametype="9" valuetype="9" name="UINAME" value="Light Position"/></connectionparameter><connectionparameter objectid="3" name="lightColor" semantic="DIFFUSE" type="0" rows="0" columns="0" handle="146177888" animated="0" 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><annotation nametype="9" valuetype="9" name="OBJECT" value="POINTLIGHT"/><annotation nametype="9" valuetype="9" name="UINAME" value="Light Color"/></connectionparameter><connectionparameter objectid="3" name="shininess" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="68114440" animated="0" numkeys="1" defaulttype="float" defaultvalue="4.000000e+001"><keys><key num="0" value="4.000000e+001"/></keys><annotation nametype="9" valuetype="3" name="UIMAX" value="1.000000e+002"/><annotation nametype="9" valuetype="3" name="UIMIN" value="1.000000e+000"/><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="backgroundColor" semantic="DIFFUSE" type="0" rows="0" columns="0" handle="121061368" animated="0" numkeys="1" defaulttype="float4" 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><annotation nametype="9" valuetype="9" name="UINAME" value="Background Color"/><annotation nametype="9" valuetype="9" name="UIWIDGET" value="COLOR"/></connectionparameter><connectionparameter objectid="3" name="checkTexture" semantic="UNKNOWN" type="6" rows="0" columns="0" handle="124095120" animated="0" numkeys="1" defaulttype="texture" defaultvalue=""><keys><key num="0" value=""/></keys><annotation nametype="9" valuetype="9" name="FUNCTION" value="GenerateCheck"/><annotation nametype="9" valuetype="8" name="HEIGHT" value="256"/><annotation nametype="9" valuetype="9" name="RESOURCETYPE" value="2D"/><annotation nametype="9" valuetype="8" name="WIDTH" value="256"/></connectionparameter><connectionparameter objectid="3" name="checkSampler" semantic="UNKNOWN" type="12" rows="0" columns="0" handle="121777440" animated="0" numkeys="1" defaulttype="sampler" defaultvalue="UNKNOWN"><keys><key num="0" value="UNKNOWN"/></keys></connectionparameter><connectionparameter objectid="3" name="eps" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="90682376" animated="0" numkeys="1" defaulttype="float" defaultvalue="1.000000e-003"><keys><key num="0" value="1.000000e-003"/></keys></connectionparameter></parameterlist><ScriptParams num="0" value="1.000000e-003"><parameterlist objectid="2"/></ScriptParams></material><node objectid="5" name="Default Scene Camera" handle="430" target="4294967295" defaultcamera="1" activecamera="1"><parameterlist objectid="2"><connectionparameter objectid="3" name="Focal Length" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="121852896" animated="0" numkeys="1" defaulttype="float" defaultvalue="1.000000e+000"><keys><key num="0" value="5.048965e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Field of View" semantic="UNKNOWN" type="3" rows="0" columns="0" handle="90575400" 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="144552688" animated="0" numkeys="1" defaulttype="float2" defaultvalue="0.000000e+000, 1.000000e+000"><keys><key num="0" value="1.972252e-002, 5.048965e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Look Direction" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="90410696" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, 1.000000e+000"><keys><key num="0" value="0.000000e+000, 0.000000e+000, 1.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Up Direction" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="145879256" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 1.000000e+000, 0.000000e+000"><keys><key num="0" value="0.000000e+000, 1.000000e+000, 0.000000e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Lookat Matrix" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="143877720" 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,5.048965e+000,1.000000e+000,"/></keys></connectionparameter><connectionparameter objectid="3" name="Camera Position" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="145931200" animated="0" numkeys="1" defaulttype="float3" defaultvalue="0.000000e+000, 0.000000e+000, -1.000000e+000"><keys><key num="0" value="0.000000e+000, 0.000000e+000, -5.048965e+000"/></keys></connectionparameter></parameterlist></node><nvtransformlink objectid="6" parent="0" handle="429" 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="90605592" 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="120868608" 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="146115016" 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="120847280" 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="123599848" 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="120943720" 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="6" parent="429" handle="431" name="Default Camera Transform" animated="0" separable="1"><nodes><node handle="430"/></nodes><parameterlist objectid="2"><connectionparameter objectid="3" name="Matrix" semantic="UNKNOWN" type="5" rows="4" columns="4" handle="120722920" 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="124100616" 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="124235752" animated="0" 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="144551160" 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, -5.048965e+000"/></keys></connectionparameter><connectionparameter objectid="3" name="Scale" semantic="UNKNOWN" type="1" rows="0" columns="0" handle="123834752" 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="124690272" 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,-5.048965e+000,1.000000e+000,"/></keys></connectionparameter></parameterlist></nvtransformlink></nvtransformlink><scenematerials scenematerial="1189"/></scene><objects><object objectid="3" objectguid="1178903711_54835_17816_162_225_77_133_92_204_97_107" objectname="NVConnectionParameter Object" progid="nvsys.NVConnectionParameter.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="5" objectguid="1675712286_15683_20022_149_108_42_250_122_123_231_64" objectname="NVCamera Object" progid="nvsys.NVCamera.1"/><object objectid="6" objectguid="2342579002_10168_19906_178_150_26_144_17_106_220_182" objectname="NVTransformLink Object" progid="nvsys.NVTransformLink.1"/><object objectid="2" objectguid="3275223899_28196_19999_162_153_111_232_35_119_165_23" objectname="NVParameterList Object" progid="nvsys.NVParameterList.1"/></objects><media_objects><effect path="E:\sw\devrel\SDK\MEDIA\HLSL\raytrace_spheres.fx"><![CDATA[// Simple ray tracer in a pixel shader // - based on Paul Heckbert's code from "An Introduction to Ray Tracing" // - it only supports spheres currently // sgreen@nvidia.com // v1.1 - fixed camera, updated to use if statements, added checkerboard floor // $Id: //sw/devrel/SDK/MEDIA/HLSL/raytrace_spheres.fx#2 $ float Script : STANDARDSGLOBAL < string UIWidget = "none"; string ScriptClass = "scene"; string ScriptOrder = "standard"; string ScriptOutput = "color"; string Script = "Technique=PS20;"; > = 0.8; // version # float4x4 view : ViewInverse < string UIWidget = "none"; >; float time : Time < string UIWidget = "none"; >; float2 viewport : VIEWPORTPIXELSIZE < string UIWidget = "none"; >; float foclen < string UIWidget="Slider"; string UIName="Focal Length"; float UIMin = 1.0f; float UIMax = 5000.0f; float UIStep = 10.0f; > = 500.0; float3 lightPosition : POSITION < string UIName="Light Position"; string Object = "PointLight"; string Space = "World"; > = { 10.0, 10.0, -10.0 }; float4 lightColor : DIFFUSE < string UIName = "Light Color"; string Object = "PointLight"; > = { 1.0, 1.0, 1.0, 1.0 }; float shininess < string UIWidget = "slider"; float UIMin = 1.0f; float UIStep = 1.0f; float UIMax = 100.0f; > = 40.0; float4 backgroundColor : DIFFUSE < string UIName="Background Color"; string UIWidget = "color"; > = { 0.0, 0.0, 0.0, 1.0 }; // build a 2D texture with a Whitted-style checkerboard pattern! texture checkTexture < string texturetype = "2D"; string function = "GenerateCheck"; int width = 256, height = 256; >; sampler2D checkSampler = sampler_state { Texture = <checkTexture>; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; }; float4 GenerateCheck(float2 p : POSITION) : COLOR { float4 c1 = { 1.0, 0.0, 0.0, 1.0 }; float4 c2 = { 1.0, 1.0, 0.0, 1.0 }; float2 s = step(p, 0.5); float check = (s.x || s.y) && !(s.x && s.y); // no XOR in HLSL! return lerp(c1, c2, check); } struct Ray { float3 o; // origin float3 d; // direction }; struct Sphere { float3 centre; float rad2; // radius^2 float4 color; float Kd, Ks, Kr; }; // Object database stored in constants #define SQR(N) (N*N) #define NOBJECTS 3 static Sphere object[NOBJECTS] = { { 0.0, 0.0, 0.0, SQR(1.0), 0.0, 0.5, 1.0, 1.0, 1.0, 1.0, 0.5, }, { 1.5, -0.5, 0.0, SQR(0.5), 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.5, }, { 0.0, -101.0, 0.0, SQR(100.0), // 0.0, 0.0, 1.0, 1.0 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, } }; const float eps = 0.001; // error epsilon float SphereIntersect(Sphere s, Ray ray, out bool hit) { float3 v = s.centre - ray.o; float b = dot(v, ray.d); float disc = (b*b) - dot(v, v) + s.rad2; hit = true; // note - early returns not supported by HLSL compiler currently: // if (disc<=0) return -1.0; // ray misses if (disc<=0) hit = false;; disc = sqrt(disc); float t2 = b + disc; // if (t2<=eps) return -1.0; // behind ray origin if (t2<=eps) hit = false; // behind ray origin float t1 = b - disc; if ((t1>eps) && (t1<t2)) // return nearest intersection return t1; else return t2; } float3 SphereNormal(Sphere s, float3 i) { return normalize(i - s.centre); } // find nearest hit // returns intersection point float3 NearestHit(Ray ray, out int hitobj, out bool anyhit) { float mint = 1e10; hitobj = -1; anyhit = false; for(int i=0; i<NOBJECTS; i++) { bool hit; float t = SphereIntersect(object[i], ray, hit); if (hit) { if (t < mint) { hitobj = i; mint = t; anyhit = true; } } } return ray.o + ray.d*mint; } // test for any hit (for shadow rays) bool AnyHit(Ray ray) { bool anyhit = false; for(int i=0; i<NOBJECTS; i++) { bool hit; float t = SphereIntersect(object[i], ray, hit); if (hit) { // return true; anyhit = true; } } return anyhit; } // Phong lighting model float4 Phong(float3 n, float3 l, float3 v, float shininess, float4 diffuseColor, float4 specularColor) { float ndotl = dot(n, l); float diff = saturate(ndotl); float3 r = reflect(l, n); float spec = pow(saturate(dot(v, r)), shininess) * (ndotl > 0.0); return diff*diffuseColor + spec*specularColor; } float4 Shade(float3 i, float3 n, float3 v, int hitobj) { float3 l = normalize(lightPosition - i); // check if shadowed Ray shadowray; shadowray.o = i; shadowray.d = l; bool shadowed = AnyHit(shadowray); // lighting float4 diff = object[hitobj].color * object[hitobj].Kd; if (hitobj==2) { diff *= tex2D(checkSampler, i.xz); // floor texture } float4 spec = lightColor * object[hitobj].Ks; float shadowFactor = 0.25 + 0.75*!shadowed; return Phong(n, l, v, shininess, diff, spec) * shadowFactor; } // Vertex shader struct Vertex { float4 pos : POSITION; float4 texcoord : TEXCOORD0; }; Vertex RayTraceVS(Vertex v) { return v; } void animate_scene(float time) { object[1].centre.x = sin(time)*1.5; object[1].centre.z = cos(time)*1.5; } // Pixel shader float4 RayTracePS(Vertex IN) : COLOR { animate_scene(time); // calculate eye ray float3 d; d.xy = ((IN.texcoord*2.0)-1.0) * viewport; d.y = -d.y; // flip y axis d.z = foclen; // transform by view matrix Ray eyeray; eyeray.o = mul(float4(0, 0, 0, 1), view); eyeray.d = mul(d, (float3x3) view); eyeray.d = normalize(eyeray.d); // find nearest hit int hitobj; bool hit; float3 i = NearestHit(eyeray, hitobj, hit); float4 c = 0; if (hit) { // shade surface float3 n = SphereNormal(object[hitobj], i); c = Shade(i, n, eyeray.d, hitobj); // shoot reflection ray float3 r = reflect(eyeray.d, n); Ray reflray; reflray.o = i; reflray.d = r; int hitobj2; i = NearestHit(reflray, hitobj2, hit); if (hit) { n = SphereNormal(object[hitobj2], i); c += Shade(i, n, reflray.d, hitobj2) * object[hitobj].Kr; } else { c += backgroundColor; } } else { c = backgroundColor; } return c; } technique PS20 < string Script = "pass=p0;"; > { pass p0 < string Script = "Draw=Buffer;"; > { VertexShader = compile vs_1_1 RayTraceVS(); PixelShader = compile ps_2_a RayTracePS(); } } technique PS30 < string Script = "pass=p0;"; > { pass p0< string Script = "Draw=Buffer;"; > { VertexShader = compile vs_3_0 RayTraceVS(); PixelShader = compile ps_3_0 RayTracePS(); } } ]]></effect></media_objects></fxstudio_project>