Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.98 KB | None | 0 0
  1. /***************************************************************************************
  2.  * This shader was generated by a tool; any changes made to this file may be lost
  3.  * Axiom Fixed Function Emulation Layer
  4.  * Vertex Program Entry Point : VS
  5.  * Fragment Program Entry Point : FP
  6.  * Vertex Buffer Delcaration : Float3 Position0;
  7. Float3 Normal0;
  8. Float2 TexCoords0;
  9.  
  10.  * Fixed Function State : Axiom.RenderSystems.Xna.FixedFunctionEmulation.FixedFunctionState
  11.  ***************************************************************************************/
  12. struct VS_INPUT
  13. {
  14.     float4 Position0 : POSITION0;
  15.     float3 Normal0 : NORMAL0;
  16.     float2 Texcoord0 : TEXCOORD0;
  17. };
  18.  
  19. float4x4  World;
  20. float4x4  View;
  21. float4x4  Projection;
  22. float4x4  ViewIT;
  23. float4x4  WorldViewIT;
  24. shared float4x4  TextureMatrix0; //technique: None
  25. float4 BaseLightAmbient;
  26. float4 MaterialAmbient=float4(1,1,1,1);
  27. float4 MaterialDiffuse=float4(1,1,1,1);
  28. float4 MaterialSpecular=(float4)0;
  29.  
  30. struct VS_OUTPUT
  31. {
  32.     float4 Pos : POSITION;
  33.     float2 Texcoord0 : TEXCOORD0;
  34.     float4 Color: COLOR0;
  35.     float4 ColorSpec: COLOR1;
  36. };
  37.  
  38. VS_OUTPUT VS( VS_INPUT input )
  39. {
  40.     VS_OUTPUT output = (VS_OUTPUT)0;
  41.     float4 worldPos = mul( World, input.Position0);
  42.     float4 cameraPos = mul( View, worldPos );
  43.     output.Pos = mul( Projection, cameraPos );
  44.     float3 Normal = input.Normal0;
  45.     //debug info : texture stage 0 coordindex: 0
  46.     {
  47.         float4 texCordWithMatrix = float4(input.Texcoord0, 1, 1);
  48.         texCordWithMatrix = mul(texCordWithMatrix, TextureMatrix0 );
  49.         output.Texcoord0 = texCordWithMatrix.xy;
  50.     }
  51.     output.ColorSpec =MaterialSpecular;
  52.     output.Color = MaterialAmbient;
  53.     return output;
  54. }
  55.  
  56. sampler2D Texture0 : register(s0);
  57.  
  58. float4 FP( VS_OUTPUT input ) : COLOR
  59. {
  60.     float4 finalColor= input.Color + input.ColorSpec;
  61.     {
  62.         float4 texColor=float4(1.0,1.0,1.0,1.0);
  63.         texColor  = tex2D(Texture0, input.Texcoord0);
  64.         float4 source1 = texColor;
  65.         float4 source2 = finalColor;
  66.         finalColor = source1 * source2;
  67.     }
  68.     return finalColor;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement