TestFX.bsl 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. Separable = false;
  2. Parameters =
  3. {
  4. float test1 = 1.0f;
  5. float2 test2 = { 1.0f, 1.0f };
  6. float3 test3 = { 1.0f, 1.0f, 1.0f };
  7. float4 test4 = { 1.0f, 1.0f, 1.0f, 1.0f };
  8. mat2x2 test5 =
  9. { 1.0f, 0.0f,
  10. 0.0f, 1.0f };
  11. mat2x3 test6 =
  12. { 1.0f, 0.0f, 0.0f,
  13. 0.0f, 1.0f, 0.0f };
  14. mat2x4 test7 =
  15. { 1.0f, 0.0f, 0.0f, 0.0f,
  16. 0.0f, 1.0f, 0.0f, 0.0f };
  17. mat3x2 test8 =
  18. { 1.0f, 0.0f,
  19. 0.0f, 1.0f,
  20. 0.0f, 0.0f };
  21. mat3x3 test9 =
  22. { 1.0f, 0.0f, 0.0f,
  23. 0.0f, 1.0f, 0.0f,
  24. 0.0f, 0.0f, 1.0f };
  25. mat3x4 test10 =
  26. { 1.0f, 0.0f, 0.0f, 0.0f,
  27. 0.0f, 1.0f, 0.0f, 0.0f,
  28. 0.0f, 0.0f, 1.0f, 0.0f };
  29. mat4x2 test11 =
  30. { 1.0f, 0.0f,
  31. 0.0f, 1.0f,
  32. 0.0f, 0.0f,
  33. 0.0f, 0.0f };
  34. mat4x3 test12 =
  35. { 1.0f, 0.0f, 0.0f,
  36. 0.0f, 1.0f, 0.0f,
  37. 0.0f, 0.0f, 1.0f,
  38. 0.0f, 0.0f, 0.0f };
  39. mat4x4 test13 =
  40. { 1.0f, 0.0f, 0.0f, 0.0f,
  41. 0.0f, 1.0f, 0.0f, 0.0f,
  42. 0.0f, 0.0f, 1.0f, 0.0f,
  43. 0.0f, 0.0f, 0.0f, 1.0f };
  44. Texture2D tex0;
  45. Sampler2D samp0 : alias("tex0") =
  46. {
  47. AddressMode =
  48. {
  49. U = WRAP;
  50. V = WRAP;
  51. W = WRAP;
  52. };
  53. MinFilter = LINEAR;
  54. MagFilter = LINEAR;
  55. MipFilter = LINEAR;
  56. MaxAniso = 0;
  57. MipmapBias = 0.0f;
  58. MipMin = 0.0f;
  59. MipMax = 0.0f;
  60. BorderColor = { 1.0f, 1.0f, 1.0f, 1.0f };
  61. CompareFunc = PASS;
  62. };
  63. Texture1D tex1;
  64. Sampler1D samp1;
  65. Texture3D tex2;
  66. Sampler3D samp2;
  67. TextureCUBE tex3;
  68. SamplerCUBE samp3;
  69. Texture2DMS tex4;
  70. Sampler2DMS samp4;
  71. ByteBuffer buffer1;
  72. StructBuffer buffer2;
  73. ByteBufferRW buffer3;
  74. StructBufferRW buffer4;
  75. AppendBuffer buffer5;
  76. ConsumeBuffer buffer6;
  77. TypedBufferRW buffer7;
  78. };
  79. Blocks =
  80. {
  81. Block global : auto("GLOBAL") : shared(false) : usage(STATIC);
  82. Block perFrame : auto("PERFRAME") : shared(false) : usage(DYNAMIC);
  83. };
  84. Technique =
  85. {
  86. Renderer = "Any";
  87. Language = "HLSL11";
  88. Pass =
  89. {
  90. Fill = SOLID;
  91. Cull = CCW;
  92. DepthBias = 0.0f;
  93. ScaledDepthBias = 0.0f;
  94. DepthClip = true;
  95. Scissor = false;
  96. Multisample = false;
  97. AALine = false;
  98. DepthRead = true;
  99. DepthWrite = true;
  100. CompareFunc = GTE;
  101. Stencil = false;
  102. StencilReadMask = 0xff;
  103. StencilWriteMask = 0xff;
  104. StencilOpFront =
  105. {
  106. Fail = KEEP;
  107. ZFail = KEEP;
  108. Pass = KEEP;
  109. CompareFunc = FAIL;
  110. };
  111. StencilOpBack =
  112. {
  113. Fail = KEEP;
  114. ZFail = KEEP;
  115. Pass = KEEP;
  116. CompareFunc = FAIL;
  117. };
  118. AlphaToCoverage = false;
  119. IndependantBlend = false;
  120. Target =
  121. {
  122. Index = 0;
  123. Blend = false;
  124. Color =
  125. {
  126. Source = ONE;
  127. Dest = ONE;
  128. Op = ADD;
  129. };
  130. Alpha =
  131. {
  132. Source = ONE;
  133. Dest = ONE;
  134. Op = ADD;
  135. };
  136. WriteMask = RGBA;
  137. };
  138. Vertex =
  139. {
  140. float invViewportWidth;
  141. float invViewportHeight;
  142. float4x4 worldTransform;
  143. void main(
  144. in float3 inPos : POSITION,
  145. in float2 uv : TEXCOORD0,
  146. out float4 oPosition : SV_Position,
  147. out float2 oUv : TEXCOORD0)
  148. {
  149. float4 tfrmdPos = mul(worldTransform, float4(inPos.xy, 0, 1));
  150. float tfrmdX = -1.0f + (tfrmdPos.x * invViewportWidth);
  151. float tfrmdY = 1.0f - (tfrmdPos.y * invViewportHeight);
  152. oPosition = float4(tfrmdX, tfrmdY, 0, 1);
  153. oUv = uv;
  154. }
  155. };
  156. Fragment =
  157. {
  158. SamplerState mainTexSamp : register(s0);
  159. Texture2D mainTexture : register(t0);
  160. float4 tint;
  161. float4 main(in float4 inPos : SV_Position, float2 uv : TEXCOORD0) : SV_Target
  162. {
  163. float4 color = mainTexture.Sample(mainTexSamp, uv);
  164. return color * tint;
  165. }
  166. };
  167. };
  168. };