Advertisement
Guest User

Untitled

a guest
Aug 8th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.70 KB | None | 0 0
  1. #ifndef D3D11
  2.  
  3. // D3D9 uniforms (no constant buffers)
  4.  
  5. #ifdef COMPILEVS
  6.  
  7. // Vertex shader uniforms
  8. uniform float3 cAmbientStartColor;
  9. uniform float3 cAmbientEndColor;
  10. #ifdef BILLBOARD
  11. uniform float3x3 cBillboardRot;
  12. #endif
  13. uniform float3 cCameraPos;
  14. uniform float3x3 cCameraRot;
  15. uniform float cNearClip;
  16. uniform float cFarClip;
  17. uniform float4 cDepthMode;
  18. uniform float cDeltaTime;
  19. uniform float cElapsedTime;
  20. uniform float3 cFrustumSize;
  21. uniform float4 cGBufferOffsets;
  22. uniform float3 cLightDir;
  23. uniform float4 cLightPos;
  24. uniform float4x3 cModel;
  25. uniform float4x4 cViewProj;
  26. uniform float4 cUOffset;
  27. uniform float4 cVOffset;
  28. uniform float4x3 cZone;
  29. #ifdef SKINNED
  30.     uniform float4x3 cSkinMatrices[MAXBONES];
  31. #endif
  32. #ifdef NUMVERTEXLIGHTS
  33.     uniform float4 cVertexLights[4*3];
  34. #else
  35.     uniform float4x4 cLightMatrices[4];
  36. #endif
  37. #endif
  38.  
  39. #ifdef COMPILEPS
  40.  
  41. // Pixel shader uniforms
  42. uniform float3 cAmbientColor;
  43. uniform float3 cCameraPosPS;
  44. uniform float cDeltaTimePS;
  45. uniform float4 cDepthReconstruct;
  46. uniform float cElapsedTimePS;
  47. uniform float4 cFogParams;
  48. uniform float3 cFogColor;
  49. uniform float2 cGBufferInvSize;
  50. uniform float4 cLightColor;
  51. uniform float4 cLightPosPS;
  52. uniform float3 cLightDirPS;
  53. uniform float4 cMatDiffColor;
  54. uniform float3 cMatEmissiveColor;
  55. uniform float3 cMatEnvMapColor;
  56. uniform float4 cMatSpecColor;
  57. uniform float cNearClipPS;
  58. uniform float cFarClipPS;
  59. uniform float4 cShadowCubeAdjust;
  60. uniform float4 cShadowDepthFade;
  61. uniform float2 cShadowIntensity;
  62. uniform float2 cShadowMapInvSize;
  63. uniform float4 cShadowSplits;
  64. uniform float4x4 cLightMatricesPS[4];
  65. #endif
  66.  
  67. #else
  68.  
  69. // D3D11 uniforms (using constant buffers)
  70.  
  71. #ifdef COMPILEVS
  72.  
  73. // Vertex shader uniforms
  74. cbuffer FrameVS : register(b0)
  75. {
  76.     float cDeltaTime;
  77.     float cElapsedTime;
  78. }
  79.  
  80. cbuffer CameraVS : register(b1)
  81. {
  82.     float3 cCameraPos;
  83.     float3x3 cCameraRot;
  84.     float cNearClip;
  85.     float cFarClip;
  86.     float4 cDepthMode;
  87.     float3 cFrustumSize;
  88.     float4 cGBufferOffsets;
  89.     float4x4 cViewProj;
  90.     float4 cClipPlane;
  91. }
  92.  
  93. cbuffer ZoneVS : register(b2)
  94. {
  95.     float3 cAmbientStartColor;
  96.     float3 cAmbientEndColor;
  97.     float4x3 cZone;
  98. }
  99.  
  100. cbuffer LightVS : register(b3)
  101. {
  102.     float3 cLightDir;
  103.     float4 cLightPos;
  104. #ifdef NUMVERTEXLIGHTS
  105.     float4 cVertexLights[4 * 3];
  106. #else
  107.     float4x4 cLightMatrices[4];
  108. #endif
  109. }
  110.  
  111. #ifndef CUSTOM_MATERIAL_CBUFFER
  112. cbuffer MaterialVS : register(b4)
  113. {
  114.     float4 cUOffset;
  115.     float4 cVOffset;
  116.     float3 cChannelFactor;
  117.     float cDisplacement;
  118. }
  119. #endif
  120.  
  121. cbuffer ObjectVS : register(b5)
  122. {
  123.     float4x3 cModel;
  124. #ifdef BILLBOARD
  125.     float3x3 cBillboardRot;
  126. #endif
  127. #ifdef SKINNED
  128.     uniform float4x3 cSkinMatrices[MAXBONES];
  129. #endif
  130. }
  131. #endif
  132.  
  133. #ifdef COMPILEPS
  134.  
  135. // Pixel shader uniforms
  136. cbuffer FramePS : register(b0)
  137. {
  138.     float cDeltaTimePS;
  139.     float cElapsedTimePS;
  140. }
  141.  
  142. cbuffer CameraPS : register(b1)
  143. {
  144.     float3 cCameraPosPS;
  145.     float4 cDepthReconstruct;
  146.     float2 cGBufferInvSize;
  147.     float cNearClipPS;
  148.     float cFarClipPS;
  149. }
  150.  
  151. cbuffer ZonePS : register(b2)
  152. {
  153.     float3 cAmbientColor;
  154.     float4 cFogParams;
  155.     float3 cFogColor;
  156. }
  157.  
  158. cbuffer LightPS : register(b3)
  159. {
  160.     float4 cLightColor;
  161.     float4 cLightPosPS;
  162.     float3 cLightDirPS;
  163.     float4 cShadowCubeAdjust;
  164.     float4 cShadowDepthFade;
  165.     float2 cShadowIntensity;
  166.     float2 cShadowMapInvSize;
  167.     float4 cShadowSplits;
  168.     float4x4 cLightMatricesPS[4];
  169. }
  170.  
  171. #ifndef CUSTOM_MATERIAL_CBUFFER
  172. cbuffer MaterialPS : register(b4)
  173. {
  174.     float4 cMatDiffColor;
  175.     float3 cMatEmissiveColor;
  176.     float3 cMatEnvMapColor;
  177.     float4 cMatSpecColor;
  178.     float2 cRampRange;
  179.     float cClipRange;
  180. }
  181. #endif
  182.  
  183. #endif
  184.  
  185. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement