Advertisement
Guest User

Untitled

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