UniformsLib.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /**
  2. * Uniforms library for shared webgl shaders
  3. */
  4. THREE.UniformsLib = {
  5. common: {
  6. "diffuse": { type: "c", value: new THREE.Color( 0xeeeeee ) },
  7. "opacity": { type: "f", value: 1.0 },
  8. "map": { type: "t", value: null },
  9. "offsetRepeat": { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) },
  10. "specularMap": { type: "t", value: null },
  11. "alphaMap": { type: "t", value: null },
  12. "envMap": { type: "t", value: null },
  13. "flipEnvMap": { type: "f", value: - 1 },
  14. "reflectivity": { type: "f", value: 1.0 },
  15. "refractionRatio": { type: "f", value: 0.98 }
  16. },
  17. aomap: {
  18. "aoMap": { type: "t", value: null },
  19. "aoMapIntensity": { type: "f", value: 1 }
  20. },
  21. lightmap: {
  22. "lightMap": { type: "t", value: null },
  23. "lightMapIntensity": { type: "f", value: 1 }
  24. },
  25. emissivemap: {
  26. "emissiveMap": { type: "t", value: null }
  27. },
  28. bumpmap: {
  29. "bumpMap": { type: "t", value: null },
  30. "bumpScale": { type: "f", value: 1 }
  31. },
  32. normalmap: {
  33. "normalMap": { type: "t", value: null },
  34. "normalScale": { type: "v2", value: new THREE.Vector2( 1, 1 ) }
  35. },
  36. displacementmap: {
  37. "displacementMap": { type: "t", value: null },
  38. "displacementScale": { type: "f", value: 1 },
  39. "displacementBias": { type: "f", value: 0 }
  40. },
  41. roughnessmap: {
  42. "roughnessMap": { type: "t", value: null }
  43. },
  44. metalnessmap: {
  45. "metalnessMap": { type: "t", value: null }
  46. },
  47. fog: {
  48. "fogDensity": { type: "f", value: 0.00025 },
  49. "fogNear": { type: "f", value: 1 },
  50. "fogFar": { type: "f", value: 2000 },
  51. "fogColor": { type: "c", value: new THREE.Color( 0xffffff ) }
  52. },
  53. ambient: {
  54. "ambientLightColor": { type: "fv", value: [] }
  55. },
  56. lights: {
  57. "directionalLights": { type: "sa", value: [], properties: {
  58. "direction": { type: "v3" },
  59. "color": { type: "c" },
  60. "shadow": { type: "i" },
  61. "shadowBias": { type: "f" },
  62. "shadowRadius": { type: "f" },
  63. "shadowMapSize": { type: "v2" }
  64. } },
  65. "directionalShadowMap": { type: "tv", value: [] },
  66. "directionalShadowMatrix": { type: "m4v", value: [] },
  67. "spotLights": { type: "sa", value: [], properties: {
  68. "color": { type: "c" },
  69. "position": { type: "v3" },
  70. "direction": { type: "v3" },
  71. "distance": { type: "f" },
  72. "angleCos": { type: "f" },
  73. "exponent": { type: "f" },
  74. "decay": { type: "f" },
  75. "shadow": { type: "i" },
  76. "shadowBias": { type: "f" },
  77. "shadowRadius": { type: "f" },
  78. "shadowMapSize": { type: "v2" }
  79. } },
  80. "spotShadowMap": { type: "tv", value: [] },
  81. "spotShadowMatrix": { type: "m4v", value: [] },
  82. "pointLights": { type: "sa", value: [], properties: {
  83. "color": { type: "c" },
  84. "position": { type: "v3" },
  85. "decay": { type: "f" },
  86. "distance": { type: "f" },
  87. "shadow": { type: "i" },
  88. "shadowBias": { type: "f" },
  89. "shadowRadius": { type: "f" },
  90. "shadowMapSize": { type: "v2" }
  91. } },
  92. "pointShadowMap": { type: "tv", value: [] },
  93. "pointShadowMatrix": { type: "m4v", value: [] },
  94. "hemisphereLights": { type: "sa", value: [], properties: {
  95. "direction": { type: "v3" },
  96. "skyColor": { type: "c" },
  97. "groundColor": { type: "c" }
  98. } }
  99. },
  100. points: {
  101. "diffuse": { type: "c", value: new THREE.Color( 0xeeeeee ) },
  102. "opacity": { type: "f", value: 1.0 },
  103. "size": { type: "f", value: 1.0 },
  104. "scale": { type: "f", value: 1.0 },
  105. "map": { type: "t", value: null },
  106. "offsetRepeat": { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) }
  107. }
  108. };