fx文件:

 1 float4x4 matWorld;
 2 float Time=1.0f;
 3 
 4 struct VS_OUTPUT
 5 {
 6     float4 Pos :POSITION;
 7     float4 Color :COLOR;
 8 };
 9 
10 VS_OUTPUT VS(float4 Pos:POSITION,float4 Color:COLOR)
11 {
12     VS_OUTPUT Out=(VS_OUTPUT)0;
13     float4 pos1=Pos;
14     pos1.y+= cos( Time*2.0f)+5;
15     Out.Pos=mul(pos1,matWorld);
16     Out.Color=Color;
17     return Out;
18 }
19 
20 float4 PS(VS_OUTPUT vsout): COLOR
21 {
22     return vsout.Color;
23 }
24 
25 technique RenderScene
26 {
27     pass P0
28     {
29         CullMode=None;
30         vertexShader=compile vs_1_1 VS();
31         pixelShader=compile ps_2_0 PS();
32     }
33 }
View Code

相关文章:

  • 2021-12-09
  • 2021-09-08
  • 2021-11-30
  • 2022-01-08
  • 2022-01-07
  • 2022-01-03
  • 2021-11-23
  • 2021-09-12
猜你喜欢
  • 2021-10-14
  • 2021-07-18
  • 2021-08-20
  • 2021-12-03
  • 2021-07-26
相关资源
相似解决方案