OSDN Git Service

リソースおよびシェーダソースコードの追加。シェーダソースコードはDirectX SDKのサンプル(Tutorial7)そのまま。
authorSFPGMR <sfpg@git.sourceforge.jp>
Sun, 3 Jul 2011 20:07:38 +0000 (05:07 +0900)
committerSFPGMR <sfpg@git.sourceforge.jp>
Sun, 3 Jul 2011 20:07:38 +0000 (05:07 +0900)
dxgi_test/SF.dds [new file with mode: 0644]
dxgi_test/Tutorial07.fx [new file with mode: 0644]
dxgi_test/directx.ico [new file with mode: 0644]
dxgi_test/dxgi_test.rc [new file with mode: 0644]
dxgi_test/dxgi_test.vcxproj
dxgi_test/dxgi_test.vcxproj.filters
dxgi_test/seafloor.dds [new file with mode: 0644]

diff --git a/dxgi_test/SF.dds b/dxgi_test/SF.dds
new file mode 100644 (file)
index 0000000..ed00ca5
Binary files /dev/null and b/dxgi_test/SF.dds differ
diff --git a/dxgi_test/Tutorial07.fx b/dxgi_test/Tutorial07.fx
new file mode 100644 (file)
index 0000000..57623fe
--- /dev/null
@@ -0,0 +1,65 @@
+//--------------------------------------------------------------------------------------
+// File: Tutorial07.fx
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//--------------------------------------------------------------------------------------
+
+//--------------------------------------------------------------------------------------
+// Constant Buffer Variables
+//--------------------------------------------------------------------------------------
+Texture2D txDiffuse : register( t0 );
+SamplerState samLinear : register( s0 );
+
+cbuffer cbNeverChanges : register( b0 )
+{
+    matrix View;
+};
+
+cbuffer cbChangeOnResize : register( b1 )
+{
+    matrix Projection;
+};
+
+cbuffer cbChangesEveryFrame : register( b2 )
+{
+    matrix World;
+    float4 vMeshColor;
+};
+
+
+//--------------------------------------------------------------------------------------
+struct VS_INPUT
+{
+    float4 Pos : POSITION;
+    float2 Tex : TEXCOORD0;
+};
+
+struct PS_INPUT
+{
+    float4 Pos : SV_POSITION;
+    float2 Tex : TEXCOORD0;
+};
+
+
+//--------------------------------------------------------------------------------------
+// Vertex Shader
+//--------------------------------------------------------------------------------------
+PS_INPUT VS( VS_INPUT input )
+{
+    PS_INPUT output = (PS_INPUT)0;
+    output.Pos = mul( input.Pos, World );
+    output.Pos = mul( output.Pos, View );
+    output.Pos = mul( output.Pos, Projection );
+    output.Tex = input.Tex;
+    
+    return output;
+}
+
+
+//--------------------------------------------------------------------------------------
+// Pixel Shader
+//--------------------------------------------------------------------------------------
+float4 PS( PS_INPUT input) : SV_Target
+{
+    return txDiffuse.Sample( samLinear, input.Tex ) * vMeshColor ;
+}
diff --git a/dxgi_test/directx.ico b/dxgi_test/directx.ico
new file mode 100644 (file)
index 0000000..bc43c1b
Binary files /dev/null and b/dxgi_test/directx.ico differ
diff --git a/dxgi_test/dxgi_test.rc b/dxgi_test/dxgi_test.rc
new file mode 100644 (file)
index 0000000..5a9c6c6
Binary files /dev/null and b/dxgi_test/dxgi_test.rc differ
index cca3b9f..a33e300 100644 (file)
   </ItemGroup>
   <ItemGroup>
     <None Include="icon1.ico" />
+    <None Include="Tutorial07.fx" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index 9afac51..93f4ccb 100644 (file)
     <Filter Include="windows">
       <UniqueIdentifier>{ac651b31-e7cb-4909-a4cd-059605cc42dd}</UniqueIdentifier>
     </Filter>
+    <Filter Include="Shader">
+      <UniqueIdentifier>{fe14dd90-c461-462b-af11-831edc7fdb52}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <None Include="icon1.ico">
       <Filter>windows</Filter>
     </None>
+    <None Include="Tutorial07.fx">
+      <Filter>Shader</Filter>
+    </None>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="dxgi_test.rc" />
diff --git a/dxgi_test/seafloor.dds b/dxgi_test/seafloor.dds
new file mode 100644 (file)
index 0000000..c28a618
Binary files /dev/null and b/dxgi_test/seafloor.dds differ