IconGizmo.bsl 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. Parameters =
  2. {
  3. mat4x4 matViewProj;
  4. Sampler2D mainTexSamp : alias("mainTexture");
  5. Texture2D mainTexture;
  6. };
  7. Technique =
  8. {
  9. Language = "HLSL11";
  10. Pass =
  11. {
  12. Target =
  13. {
  14. Blend = true;
  15. Color = { SRCA, SRCIA, ADD };
  16. };
  17. DepthWrite = false;
  18. CompareFunc = LTE;
  19. Vertex =
  20. {
  21. float4x4 matViewProj;
  22. void main(
  23. in float3 inPos : POSITION,
  24. in float2 uv : TEXCOORD0,
  25. in float4 color : COLOR0,
  26. out float4 oPosition : SV_Position,
  27. out float2 oUv : TEXCOORD0,
  28. out float4 oColor : COLOR0)
  29. {
  30. oPosition = mul(matViewProj, float4(inPos.xyz, 1));
  31. oUv = uv;
  32. oColor = color;
  33. }
  34. };
  35. Fragment =
  36. {
  37. SamplerState mainTexSamp : register(s0);
  38. Texture2D mainTexture : register(t0);
  39. float4 main(
  40. in float4 inPos : SV_Position,
  41. float2 uv : TEXCOORD0,
  42. float4 color : COLOR0) : SV_Target
  43. {
  44. return color * mainTexture.Sample(mainTexSamp, uv);
  45. }
  46. };
  47. };
  48. Pass =
  49. {
  50. Target =
  51. {
  52. Blend = true;
  53. Color = { SRCA, SRCIA, ADD };
  54. };
  55. DepthWrite = false;
  56. CompareFunc = GT;
  57. Vertex =
  58. {
  59. float4x4 matViewProj;
  60. void main(
  61. in float3 inPos : POSITION,
  62. in float2 uv : TEXCOORD0,
  63. in float4 color : COLOR1,
  64. out float4 oPosition : SV_Position,
  65. out float2 oUv : TEXCOORD0,
  66. out float4 oColor : COLOR0)
  67. {
  68. oPosition = mul(matViewProj, float4(inPos.xyz, 1));
  69. oUv = uv;
  70. oColor = color;
  71. }
  72. };
  73. Fragment =
  74. {
  75. SamplerState mainTexSamp : register(s0);
  76. Texture2D mainTexture : register(t0);
  77. float4 main(
  78. in float4 inPos : SV_Position,
  79. float2 uv : TEXCOORD0,
  80. float4 color : COLOR0) : SV_Target
  81. {
  82. return color * mainTexture.Sample(mainTexSamp, uv);
  83. }
  84. };
  85. };
  86. };
  87. Technique =
  88. {
  89. Language = "HLSL9";
  90. Pass =
  91. {
  92. Target =
  93. {
  94. Blend = true;
  95. Color = { SRCA, SRCIA, ADD };
  96. };
  97. DepthWrite = false;
  98. CompareFunc = LTE;
  99. Vertex =
  100. {
  101. float4x4 matViewProj;
  102. void main(
  103. in float3 inPos : POSITION,
  104. in float4 color : COLOR0,
  105. in float2 uv : TEXCOORD0,
  106. out float4 oPosition : POSITION,
  107. out float4 oColor : COLOR0,
  108. out float2 oUv : TEXCOORD0)
  109. {
  110. oPosition = mul(matViewProj, float4(inPos.xyz, 1));
  111. oColor = color;
  112. oUv = uv;
  113. }
  114. };
  115. Fragment =
  116. {
  117. sampler2D mainTexture;
  118. float4 main(float2 uv : TEXCOORD0, float4 color : COLOR0) : COLOR0
  119. {
  120. return color * tex2D(mainTexture, uv);
  121. }
  122. };
  123. };
  124. Pass =
  125. {
  126. Target =
  127. {
  128. Blend = true;
  129. Color = { SRCA, SRCIA, ADD };
  130. };
  131. DepthWrite = false;
  132. CompareFunc = GT;
  133. Vertex =
  134. {
  135. float4x4 matViewProj;
  136. void main(
  137. in float3 inPos : POSITION,
  138. in float4 color : COLOR1,
  139. in float2 uv : TEXCOORD0,
  140. out float4 oPosition : POSITION,
  141. out float4 oColor : COLOR0,
  142. out float2 oUv : TEXCOORD0)
  143. {
  144. oPosition = mul(matViewProj, float4(inPos.xyz, 1));
  145. oColor = color;
  146. oUv = uv;
  147. }
  148. };
  149. Fragment =
  150. {
  151. sampler2D mainTexture;
  152. float4 main(float2 uv : TEXCOORD0, float4 color : COLOR0) : COLOR0
  153. {
  154. return color * tex2D(mainTexture, uv);
  155. }
  156. };
  157. };
  158. };
  159. Technique =
  160. {
  161. Language = "GLSL";
  162. Pass =
  163. {
  164. Target =
  165. {
  166. Blend = true;
  167. Color = { SRCA, SRCIA, ADD };
  168. };
  169. DepthWrite = false;
  170. CompareFunc = LTE;
  171. Vertex =
  172. {
  173. uniform mat4 matViewProj;
  174. in vec3 bs_position;
  175. in vec4 bs_color0;
  176. in vec2 bs_texcoord0;
  177. out vec4 color0;
  178. out vec2 texcoord0;
  179. out gl_PerVertex
  180. {
  181. vec4 gl_Position;
  182. };
  183. void main()
  184. {
  185. gl_Position = matViewProj * vec4(bs_position.xyz, 1);
  186. texcoord0 = bs_texcoord0;
  187. color0 = bs_color0;
  188. }
  189. };
  190. Fragment =
  191. {
  192. uniform sampler2D mainTexture;
  193. in vec4 color0;
  194. in vec2 texcoord0;
  195. out vec4 fragColor;
  196. void main()
  197. {
  198. vec4 texColor = texture2D(mainTexture, texcoord0.st);
  199. fragColor = color0 * texColor;
  200. }
  201. };
  202. };
  203. Pass =
  204. {
  205. Target =
  206. {
  207. Blend = true;
  208. Color = { SRCA, SRCIA, ADD };
  209. };
  210. DepthWrite = false;
  211. CompareFunc = GT;
  212. Vertex =
  213. {
  214. uniform mat4 matViewProj;
  215. in vec3 bs_position;
  216. in vec4 bs_color1;
  217. in vec2 bs_texcoord0;
  218. out vec4 color0;
  219. out vec2 texcoord0;
  220. out gl_PerVertex
  221. {
  222. vec4 gl_Position;
  223. };
  224. void main()
  225. {
  226. gl_Position = matViewProj * vec4(bs_position.xyz, 1);
  227. texcoord0 = bs_texcoord0;
  228. color0 = bs_color1;
  229. }
  230. };
  231. Fragment =
  232. {
  233. uniform sampler2D mainTexture;
  234. in vec4 color0;
  235. in vec2 texcoord0;
  236. out vec4 fragColor;
  237. void main()
  238. {
  239. vec4 texColor = texture2D(mainTexture, texcoord0.st);
  240. fragColor = color0 * texColor;
  241. }
  242. };
  243. };
  244. };