Guest User

Untitled

a guest
Nov 3rd, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.02 KB | None | 0 0
  1.  
  2.  
  3. MaterialDef Phong Lighting {
  4.  
  5. MaterialParameters {
  6.  
  7. // Compute vertex lighting in the shader
  8. // For better performance
  9. Boolean VertexLighting
  10.  
  11. // Use more efficent algorithms to improve performance
  12. Boolean LowQuality
  13.  
  14. // Improve quality at the cost of performance
  15. Boolean HighQuality
  16.  
  17. // Output alpha from the diffuse map
  18. Boolean UseAlpha
  19.  
  20. // Alpha threshold for fragment discarding
  21. Float AlphaDiscardThreshold (AlphaTestFallOff)
  22.  
  23. // Normal map is in BC5/ATI2n/LATC/3Dc compression format
  24. Boolean LATC
  25.  
  26. // Use the provided ambient, diffuse, and specular colors
  27. Boolean UseMaterialColors
  28.  
  29. // Activate shading along the tangent, instead of the normal
  30. // Requires tangent data to be available on the model.
  31. Boolean VTangent
  32.  
  33. // Use minnaert diffuse instead of lambert
  34. Boolean Minnaert
  35.  
  36. // Use ward specular instead of phong
  37. Boolean WardIso
  38.  
  39. // Use vertex color as an additional diffuse color.
  40. Boolean UseVertexColor
  41.  
  42. // Ambient color
  43. Color Ambient (MaterialAmbient)
  44.  
  45. // Diffuse color
  46. Color Diffuse (MaterialDiffuse)
  47.  
  48. // Specular color
  49. Color Specular (MaterialSpecular)
  50.  
  51. // Specular power/shininess
  52. Float Shininess (MaterialShininess) : 1
  53.  
  54. // Diffuse map
  55. Texture2D DiffuseMap
  56.  
  57. // Normal map
  58. Texture2D NormalMap
  59.  
  60. // Specular/gloss map
  61. Texture2D SpecularMap
  62.  
  63. // Parallax/height map
  64. Texture2D ParallaxMap
  65.  
  66. //Set to true is parallax map is stored in the alpha channel of the normal map
  67. Boolean PackedNormalParallax
  68.  
  69. //Sets the relief height for parallax mapping
  70. Float ParallaxHeight : 0.05
  71.  
  72. //Set to true to activate Steep Parallax mapping
  73. Boolean SteepParallax
  74.  
  75. // Texture that specifies alpha values
  76. Texture2D AlphaMap
  77.  
  78. // Color ramp, will map diffuse and specular values through it.
  79. Texture2D ColorRamp
  80.  
  81. // Texture of the glowing parts of the material
  82. Texture2D GlowMap
  83.  
  84. // Set to Use Lightmap
  85. Texture2D LightMap
  86.  
  87. // Set to use TexCoord2 for the lightmap sampling
  88. Boolean SeparateTexCoord
  89.  
  90. // The glow color of the object
  91. Color GlowColor
  92.  
  93. // Parameters for fresnel
  94. // X = bias
  95. // Y = scale
  96. // Z = power
  97. Vector3 FresnelParams
  98.  
  99. // Env Map for reflection
  100. TextureCubeMap EnvMap
  101.  
  102. // the env map is a spheremap and not a cube map
  103. Boolean EnvMapAsSphereMap
  104.  
  105. //shadows
  106. Int FilterMode // do wywalenia
  107. Boolean HardwareShadows
  108.  
  109. Texture2D ShadowMap0
  110. Texture2D ShadowMap1
  111. Texture2D ShadowMap2
  112. Texture2D ShadowMap3
  113. //pointLights
  114. Texture2D ShadowMap4
  115. Texture2D ShadowMap5
  116.  
  117. Float ShadowIntensity
  118. Vector4 Splits
  119. Vector2 FadeInfo
  120.  
  121. Matrix4 LightViewProjectionMatrix0
  122. Matrix4 LightViewProjectionMatrix1
  123. Matrix4 LightViewProjectionMatrix2
  124. Matrix4 LightViewProjectionMatrix3
  125. //pointLight
  126. Matrix4 LightViewProjectionMatrix4
  127. Matrix4 LightViewProjectionMatrix5
  128. Vector3 LightPos
  129. //Vector4 LightPos // Pretty
  130. Vector3 LightDir
  131.  
  132.  
  133. Int LightCount
  134. Vector4 LightPosition0
  135. Vector4 LightPosition1
  136. Vector4 LightPosition2
  137. Vector4 LightPosition3
  138. Vector4 LightPosition4
  139. Vector4 LightPosition5
  140.  
  141. Float LightRadius
  142.  
  143. Float PCFEdge
  144. Float ShadowMapSize
  145.  
  146. // For hardware skinning
  147. Int NumberOfBones
  148. Matrix4Array BoneMatrices
  149.  
  150. Vector4 LightColor // Pretty
  151. }
  152.  
  153. Technique {
  154.  
  155. LightMode MultiPass
  156.  
  157. VertexShader GLSL100: MatDefs/Light/LightingMS.vert
  158. FragmentShader GLSL100: MatDefs/Light/LightingMS.frag
  159.  
  160. WorldParameters {
  161. WorldViewProjectionMatrix
  162. NormalMatrix
  163. WorldViewMatrix
  164. ViewMatrix
  165. CameraPosition
  166. WorldMatrix
  167. }
  168.  
  169. Defines {
  170. LATC : LATC
  171. VERTEX_COLOR : UseVertexColor
  172. VERTEX_LIGHTING : VertexLighting
  173. ATTENUATION : Attenuation
  174. MATERIAL_COLORS : UseMaterialColors
  175. V_TANGENT : VTangent
  176. MINNAERT : Minnaert
  177. WARDISO : WardIso
  178. LOW_QUALITY : LowQuality
  179. HQ_ATTENUATION : HighQuality
  180.  
  181. DIFFUSEMAP : DiffuseMap
  182. NORMALMAP : NormalMap
  183. SPECULARMAP : SpecularMap
  184. PARALLAXMAP : ParallaxMap
  185. NORMALMAP_PARALLAX : PackedNormalParallax
  186. STEEP_PARALLAX : SteepParallax
  187. ALPHAMAP : AlphaMap
  188. COLORRAMP : ColorRamp
  189. LIGHTMAP : LightMap
  190. SEPARATE_TEXCOORD : SeparateTexCoord
  191.  
  192. USE_REFLECTION : EnvMap
  193. SPHERE_MAP : SphereMap
  194.  
  195. NUM_BONES : NumberOfBones
  196.  
  197. }
  198.  
  199. }
  200.  
  201. Technique PreShadow {
  202.  
  203. VertexShader GLSL100 : Common/MatDefs/Shadow/PreShadow.vert
  204. FragmentShader GLSL100 : Common/MatDefs/Shadow/PreShadow.frag
  205.  
  206. WorldParameters {
  207. WorldViewProjectionMatrix
  208. WorldViewMatrix
  209. }
  210.  
  211. Defines {
  212. COLOR_MAP : ColorMap
  213. DISCARD_ALPHA : AlphaDiscardThreshold
  214. NUM_BONES : NumberOfBones
  215. }
  216.  
  217. ForcedRenderState {
  218. FaceCull Off
  219. DepthTest On
  220. DepthWrite On
  221. //PolyOffset 0.9 5
  222. PolyOffset 2 5.5
  223. ColorWrite Off
  224. }
  225.  
  226. }
  227.  
  228.  
  229. // Technique PostShadow15{
  230. // VertexShader GLSL150: MatDefs/Shadow/PostShadowMS15.vert
  231. // FragmentShader GLSL150: MatDefs/Shadow/PostShadowMS15.frag
  232. //
  233. // WorldParameters {
  234. // WorldViewProjectionMatrix
  235. // WorldMatrix
  236. // LightPosition
  237. // }
  238. //
  239. // Defines {
  240. // HARDWARE_SHADOWS : HardwareShadows
  241. // FILTER_MODE : FilterMode
  242. // PCFEDGE : PCFEdge
  243. // DISCARD_ALPHA : AlphaDiscardThreshold
  244. // COLOR_MAP : ColorMap
  245. // SHADOWMAP_SIZE : ShadowMapSize
  246. // FADE : FadeInfo
  247. // PSSM : Splits
  248. // POINTLIGHT : LightViewProjectionMatrix5
  249. // NUM_BONES : NumberOfBones
  250. // NUM_LIGHTS: LightCount
  251. // }
  252. //
  253. // ForcedRenderState {
  254. // Blend Modulate
  255. // DepthWrite Off
  256. // PolyOffset -0.01 0
  257. // }
  258. // }
  259.  
  260. Technique PostShadow15
  261. {
  262. VertexShader GLSL150: MatDefs/Shadow/PostShadow15Pretty.vert
  263. FragmentShader GLSL150: MatDefs/Shadow/PostShadow15Pretty.frag
  264.  
  265. WorldParameters {
  266. WorldViewProjectionMatrix
  267. NormalMatrix
  268. WorldViewMatrix
  269. ViewMatrix
  270. CameraPosition
  271. WorldMatrix
  272. //ViewProjectionMatrix
  273. }
  274.  
  275. Defines {
  276. LIGHT_POS_MY : LightPos
  277. LIGHT_RADIUS_MY : LightRadius
  278. LIGHT_COLOR_MY : LightColor
  279.  
  280. HARDWARE_SHADOWS : HardwareShadows
  281. FILTER_MODE : FilterMode
  282. PCFEDGE : PCFEdge
  283. // DISCARD_ALPHA : AlphaDiscardThreshold
  284. // COLOR_MAP : ColorMap
  285. SHADOWMAP_SIZE : ShadowMapSize
  286. FADE : FadeInfo
  287. PSSM : Splits
  288. POINTLIGHT : LightViewProjectionMatrix5
  289. NUM_BONES : NumberOfBones
  290. //INSTANCING : UseInstancing
  291.  
  292. LATC : LATC
  293. VERTEX_COLOR : UseVertexColor
  294. VERTEX_LIGHTING : VertexLighting
  295. ATTENUATION : Attenuation
  296. MATERIAL_COLORS : UseMaterialColors
  297. V_TANGENT : VTangent
  298. MINNAERT : Minnaert
  299. WARDISO : WardIso
  300. LOW_QUALITY : LowQuality
  301. HQ_ATTENUATION : HighQuality
  302.  
  303. DIFFUSEMAP : DiffuseMap
  304. NORMALMAP : NormalMap
  305. SPECULARMAP : SpecularMap
  306. PARALLAXMAP : ParallaxMap
  307. NORMALMAP_PARALLAX : PackedNormalParallax
  308. STEEP_PARALLAX : SteepParallax
  309. ALPHAMAP : AlphaMap
  310. COLORRAMP : ColorRamp
  311. LIGHTMAP : LightMap
  312. SEPARATE_TEXCOORD : SeparateTexCoord
  313.  
  314. USE_REFLECTION : EnvMap
  315. SPHERE_MAP : SphereMap
  316.  
  317.  
  318. }
  319.  
  320. ForcedRenderState {
  321. Blend Additive
  322. DepthTest On
  323. DepthWrite On
  324. PolyOffset -0.01 0
  325. ColorWrite On
  326. }
  327. }
  328.  
  329. Technique PostShadow{
  330. VertexShader GLSL100: Common/MatDefs/Shadow/PostShadow.vert
  331. FragmentShader GLSL100: Common/MatDefs/Shadow/PostShadow.frag
  332.  
  333. WorldParameters {
  334. WorldViewProjectionMatrix
  335. WorldMatrix
  336. LightPosition
  337. }
  338.  
  339. Defines {
  340. HARDWARE_SHADOWS : HardwareShadows
  341. FILTER_MODE : FilterMode
  342. PCFEDGE : PCFEdge
  343. DISCARD_ALPHA : AlphaDiscardThreshold
  344. COLOR_MAP : ColorMap
  345. SHADOWMAP_SIZE : ShadowMapSize
  346. FADE : FadeInfo
  347. PSSM : Splits
  348. POINTLIGHT : LightViewProjectionMatrix5
  349. NUM_BONES : NumberOfBones
  350. NUM_LIGHTS: LightCount
  351. }
  352.  
  353. ForcedRenderState {
  354. Blend Modulate
  355. DepthWrite Off
  356. PolyOffset -0.1 0
  357. }
  358. }
  359.  
  360. Technique PreNormalPass {
  361.  
  362. VertexShader GLSL100 : Common/MatDefs/SSAO/normal.vert
  363. FragmentShader GLSL100 : Common/MatDefs/SSAO/normal.frag
  364.  
  365. WorldParameters {
  366. WorldViewProjectionMatrix
  367. WorldViewMatrix
  368. NormalMatrix
  369. }
  370.  
  371. Defines {
  372. DIFFUSEMAP_ALPHA : DiffuseMap
  373. NUM_BONES : NumberOfBones
  374. }
  375.  
  376. }
  377.  
  378.  
  379. Technique PreNormalPassDerivative {
  380.  
  381. VertexShader GLSL100 : Common/MatDefs/MSSAO/normal.vert
  382. FragmentShader GLSL100 : Common/MatDefs/MSSAO/normal.frag
  383.  
  384. WorldParameters {
  385. WorldViewProjectionMatrix
  386. WorldViewMatrix
  387. NormalMatrix
  388. }
  389.  
  390. Defines {
  391. DIFFUSEMAP_ALPHA : DiffuseMap
  392. NUM_BONES : NumberOfBones
  393. }
  394.  
  395. }
  396.  
  397. Technique GBuf {
  398.  
  399. VertexShader GLSL100: Common/MatDefs/Light/GBuf.vert
  400. FragmentShader GLSL100: Common/MatDefs/Light/GBuf.frag
  401.  
  402. WorldParameters {
  403. WorldViewProjectionMatrix
  404. NormalMatrix
  405. WorldViewMatrix
  406. WorldMatrix
  407. }
  408.  
  409. Defines {
  410. VERTEX_COLOR : UseVertexColor
  411. MATERIAL_COLORS : UseMaterialColors
  412. V_TANGENT : VTangent
  413. MINNAERT : Minnaert
  414. WARDISO : WardIso
  415.  
  416. DIFFUSEMAP : DiffuseMap
  417. NORMALMAP : NormalMap
  418. SPECULARMAP : SpecularMap
  419. PARALLAXMAP : ParallaxMap
  420. }
  421. }
  422.  
  423. Technique {
  424. LightMode FixedPipeline
  425. }
  426.  
  427. Technique Glow {
  428.  
  429. VertexShader GLSL100: Common/MatDefs/Misc/Unshaded.vert
  430. FragmentShader GLSL100: Common/MatDefs/Light/Glow.frag
  431.  
  432. WorldParameters {
  433. WorldViewProjectionMatrix
  434. }
  435.  
  436. Defines {
  437. NEED_TEXCOORD1
  438. HAS_GLOWMAP : GlowMap
  439. HAS_GLOWCOLOR : GlowColor
  440.  
  441. NUM_BONES : NumberOfBones
  442. }
  443. }
  444.  
  445. }
Advertisement
Add Comment
Please, Sign In to add comment