hdr.material
上传用户:xhbjoy
上传日期:2014-10-07
资源大小:38068k
文件大小:7k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. // Downsample a 2x2 area & turn into luminence (unclamped)
  2. fragment_program Ogre/Compositor/HDR/downscale2x2LuminenceHLSL_fp hlsl
  3. {
  4. source hdr.hlsl
  5. entry_point downscale2x2Luminence
  6. target ps_2_0
  7. }
  8. fragment_program Ogre/Compositor/HDR/downscale2x2LuminenceGLSL_fp glsl
  9. {
  10. source hdr_downscale2x2luminence.glsl
  11. default_params
  12. {
  13. param_named inRTT int 0
  14. }
  15. }
  16. material Ogre/Compositor/HDR/Downsample2x2Luminence
  17. {
  18. technique
  19. {
  20. pass
  21. {
  22. cull_hardware none
  23. cull_software none
  24. depth_check off
  25. vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
  26. {
  27. }
  28. fragment_program_ref Ogre/Compositor/HDR/downscale2x2LuminenceHLSL_fp
  29. {
  30. }
  31. texture_unit
  32. {
  33.                 tex_coord_set 0
  34. tex_address_mode clamp
  35. filtering none 
  36. }
  37. }
  38. }
  39. technique
  40. {
  41. pass
  42. {
  43. cull_hardware none
  44. cull_software none
  45. depth_check off
  46. vertex_program_ref Ogre/Compositor/StdQuad_GLSL_vp
  47. {
  48. }
  49. fragment_program_ref Ogre/Compositor/HDR/downscale2x2LuminenceGLSL_fp
  50. {
  51. }
  52. texture_unit
  53. {
  54.                 tex_coord_set 0
  55. tex_address_mode clamp
  56. filtering none 
  57. }
  58. }
  59. }
  60. }
  61. // Downsample a 3x3 area
  62. fragment_program Ogre/Compositor/HDR/downscale3x3HLSL_fp hlsl
  63. {
  64. source hdr.hlsl
  65. entry_point downscale3x3
  66. target ps_2_0
  67. }
  68. fragment_program Ogre/Compositor/HDR/downscale3x3GLSL_fp glsl
  69. {
  70. source hdr_downscale3x3.glsl
  71. default_params
  72. {
  73. param_named inRTT int 0
  74. }
  75. }
  76. material Ogre/Compositor/HDR/Downsample3x3
  77. {
  78. technique
  79. {
  80. pass
  81. {
  82. cull_hardware none
  83. cull_software none
  84. depth_check off
  85. vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
  86. {
  87. }
  88. fragment_program_ref Ogre/Compositor/HDR/downscale3x3HLSL_fp
  89. {
  90. }
  91. texture_unit
  92. {
  93.                 tex_coord_set 0
  94. tex_address_mode clamp
  95. filtering none 
  96. }
  97. }
  98. }
  99. technique
  100. {
  101. pass
  102. {
  103. cull_hardware none
  104. cull_software none
  105. depth_check off
  106. vertex_program_ref Ogre/Compositor/StdQuad_GLSL_vp
  107. {
  108. }
  109. fragment_program_ref Ogre/Compositor/HDR/downscale3x3GLSL_fp
  110. {
  111. }
  112. texture_unit
  113. {
  114.                 tex_coord_set 0
  115. tex_address_mode clamp
  116. filtering none 
  117. }
  118. }
  119. }
  120. }
  121. // Downsample a 3x3 area and perform a brightness filter pass
  122. fragment_program Ogre/Compositor/HDR/downscale3x3brightpassHLSL_fp hlsl
  123. {
  124. source hdr.hlsl
  125. entry_point downscale3x3brightpass
  126. target ps_2_0
  127. }
  128. fragment_program Ogre/Compositor/HDR/utils_fp glsl
  129. {
  130. source hdr_tonemap_util.glsl
  131. }
  132. fragment_program Ogre/Compositor/HDR/downscale3x3brightpassGLSL_fp glsl
  133. {
  134. source hdr_downscale3x3brightpass.glsl
  135. // re-use common functions
  136. attach Ogre/Compositor/HDR/utils_fp
  137. default_params
  138. {
  139. param_named inRTT int 0
  140. param_named inLum int 1
  141. }
  142. }
  143. material Ogre/Compositor/HDR/Downsample3x3Brightpass
  144. {
  145. technique
  146. {
  147. pass
  148. {
  149. cull_hardware none
  150. cull_software none
  151. depth_check off
  152. vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
  153. {
  154. }
  155. fragment_program_ref Ogre/Compositor/HDR/downscale3x3brightpassHLSL_fp
  156. {
  157. }
  158. // Scene 
  159. texture_unit
  160. {
  161.                 tex_coord_set 0
  162. tex_address_mode clamp
  163. filtering none 
  164. }
  165. // Luminence 
  166. texture_unit
  167. {
  168. tex_address_mode clamp
  169. filtering none 
  170. }
  171. }
  172. }
  173. technique
  174. {
  175. pass
  176. {
  177. cull_hardware none
  178. cull_software none
  179. depth_check off
  180. vertex_program_ref Ogre/Compositor/StdQuad_GLSL_vp
  181. {
  182. }
  183. fragment_program_ref Ogre/Compositor/HDR/downscale3x3brightpassGLSL_fp
  184. {
  185. }
  186. // Scene 
  187. texture_unit
  188. {
  189.                 tex_coord_set 0
  190. tex_address_mode clamp
  191. filtering none 
  192. }
  193. // Luminence 
  194. texture_unit
  195. {
  196. tex_address_mode clamp
  197. filtering none 
  198. }
  199. }
  200. }
  201. }
  202. // Bloom an area using gaussian distribution
  203. fragment_program Ogre/Compositor/HDR/bloomHLSL_fp hlsl
  204. {
  205. source hdr.hlsl
  206. entry_point bloom
  207. target ps_2_0
  208. }
  209. fragment_program Ogre/Compositor/HDR/bloomGLSL_fp glsl
  210. {
  211. source hdr_bloom.glsl
  212. default_params
  213. {
  214. param_named inRTT int 0
  215. }
  216. }
  217. material Ogre/Compositor/HDR/GaussianBloom0
  218. {
  219. technique
  220. {
  221. pass
  222. {
  223. cull_hardware none
  224. cull_software none
  225. depth_check off
  226. vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
  227. {
  228. }
  229. fragment_program_ref Ogre/Compositor/HDR/bloomHLSL_fp
  230. {
  231. }
  232. // Input 
  233. texture_unit
  234. {
  235.                 tex_coord_set 0
  236. tex_address_mode clamp
  237. filtering none 
  238. }
  239. }
  240. }
  241. technique
  242. {
  243. pass
  244. {
  245. cull_hardware none
  246. cull_software none
  247. depth_check off
  248. vertex_program_ref Ogre/Compositor/StdQuad_GLSL_vp
  249. {
  250. }
  251. fragment_program_ref Ogre/Compositor/HDR/bloomGLSL_fp
  252. {
  253. }
  254. // Input 
  255. texture_unit
  256. {
  257.                 tex_coord_set 0
  258. tex_address_mode clamp
  259. filtering none 
  260. }
  261. }
  262. }
  263. }
  264. material Ogre/Compositor/HDR/GaussianBloom1
  265. {
  266. technique
  267. {
  268. pass
  269. {
  270. cull_hardware none
  271. cull_software none
  272. depth_check off
  273. vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
  274. {
  275. }
  276. fragment_program_ref Ogre/Compositor/HDR/bloomHLSL_fp
  277. {
  278. }
  279. // Input 
  280. texture_unit
  281. {
  282.                 tex_coord_set 0
  283. tex_address_mode clamp
  284. filtering none 
  285. }
  286. }
  287. }
  288. technique
  289. {
  290. pass
  291. {
  292. cull_hardware none
  293. cull_software none
  294. depth_check off
  295. vertex_program_ref Ogre/Compositor/StdQuad_GLSL_vp
  296. {
  297. }
  298. fragment_program_ref Ogre/Compositor/HDR/bloomGLSL_fp
  299. {
  300. }
  301. // Input 
  302. texture_unit
  303. {
  304.                 tex_coord_set 0
  305. tex_address_mode clamp
  306. filtering none 
  307. }
  308. }
  309. }
  310. }
  311. // Perform final tone mapping
  312. fragment_program Ogre/Compositor/HDR/finaltonemappingHLSL_fp hlsl
  313. {
  314. source hdr.hlsl
  315. entry_point finalToneMapping
  316. target ps_2_0
  317. }
  318. fragment_program Ogre/Compositor/HDR/finaltonemappingGLSL_fp glsl
  319. {
  320. source hdr_finalToneMapping.glsl
  321. // re-use common functions
  322. attach Ogre/Compositor/HDR/utils_fp
  323. default_params
  324. {
  325. param_named inRTT int 0
  326. param_named inBloom int 1
  327. param_named inLum int 2
  328. }
  329. }
  330. material Ogre/Compositor/HDR/ToneMapping
  331. {
  332. technique
  333. {
  334. pass
  335. {
  336. cull_hardware none
  337. cull_software none
  338. depth_check off
  339. vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
  340. {
  341. }
  342. fragment_program_ref Ogre/Compositor/HDR/finaltonemappingHLSL_fp
  343. {
  344. }
  345. // Scene 
  346. texture_unit
  347. {
  348.                 tex_coord_set 0
  349. tex_address_mode clamp
  350. }
  351. // Bloom
  352. texture_unit
  353. {
  354. tex_address_mode clamp
  355. }
  356. // Luminence 
  357. texture_unit
  358. {
  359. tex_address_mode clamp
  360. }
  361. }
  362. }
  363. technique
  364. {
  365. pass
  366. {
  367. cull_hardware none
  368. cull_software none
  369. depth_check off
  370. vertex_program_ref Ogre/Compositor/StdQuad_GLSL_vp
  371. {
  372. }
  373. fragment_program_ref Ogre/Compositor/HDR/finaltonemappingGLSL_fp
  374. {
  375. }
  376. // Scene 
  377. texture_unit
  378. {
  379.                 tex_coord_set 0
  380. tex_address_mode clamp
  381. }
  382. // Bloom
  383. texture_unit
  384. {
  385. tex_address_mode clamp
  386. }
  387. // Luminence 
  388. texture_unit
  389. {
  390. tex_address_mode clamp
  391. }
  392. }
  393. }
  394. }