XAudio2Sound3D.fx
资源名称:XAudio2.rar [点击查看]
上传用户:May-22
上传日期:2015-07-19
资源大小:7113k
文件大小:2k
源码类别:
DirextX编程
开发平台:
Visual C++
- //--------------------------------------------------------------------------------------
- // File: XAudio2Sound3D.fx
- //
- // The effect file for the XAudio Sound 3D sample.
- //
- // Copyright (c) Microsoft Corporation. All rights reserved.
- //--------------------------------------------------------------------------------------
- //--------------------------------------------------------------------------------------
- // Global variables
- //--------------------------------------------------------------------------------------
- float4x4 g_mTransform; // Transform
- //--------------------------------------------------------------------------------------
- // Vertex shader output structure
- //--------------------------------------------------------------------------------------
- struct VS_OUTPUT
- {
- float4 Position : POSITION; // vertex position
- float4 Color : COLOR; // color
- };
- //--------------------------------------------------------------------------------------
- // This shader computes standard transform and lighting
- //--------------------------------------------------------------------------------------
- VS_OUTPUT RenderSceneVS( float3 vPos : POSITION, float4 color : COLOR )
- {
- VS_OUTPUT output;
- output.Position = mul( float4(vPos,1), g_mTransform);
- output.Color = color;
- return output;
- }
- //--------------------------------------------------------------------------------------
- // Pixel shader output structure
- //--------------------------------------------------------------------------------------
- struct PS_OUTPUT
- {
- float4 RGBColor : COLOR0; // Pixel color
- };
- //--------------------------------------------------------------------------------------
- // This shader outputs the pixel's color by modulating the texture's
- // color with diffuse material color
- //--------------------------------------------------------------------------------------
- PS_OUTPUT RenderScenePS( VS_OUTPUT input )
- {
- PS_OUTPUT output;
- output.RGBColor = input.Color;
- return output;
- }
- //--------------------------------------------------------------------------------------
- // Renders scene
- //--------------------------------------------------------------------------------------
- technique RenderScene
- {
- pass P0
- {
- ZENABLE = FALSE;
- VertexShader = compile vs_2_0 RenderSceneVS();
- PixelShader = compile ps_2_0 RenderScenePS();
- }
- }