DirectionalLight.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../list.js"></script>
  6. <script src="../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../page.css" />
  8. </head>
  9. <body>
  10. [page:Object3D] &rarr; [page:Light] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">
  13. Affects objects using [page:MeshLambertMaterial] or [page:MeshPhongMaterial].
  14. </div>
  15. <h2>Example</h2>
  16. <code>// White directional light at half intensity shining from the top.
  17. var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
  18. directionalLight.position.set( 0, 1, 0 );
  19. scene.add( directionalLight );</code>
  20. <h2>Constructor</h2>
  21. <h3>[name]([page:Integer hex], [page:Float intensity])</h3>
  22. <div>
  23. [page:Integer hex] -- Numeric value of the RGB component of the color. <br />
  24. [page:Float intensity] -- Numeric value of the light's strength/intensity.
  25. </div>
  26. <div>
  27. Creates a light that shines from a specific direction not from a specific position. This light will behave
  28. as though it is infinitely far away and the rays produced from it are all parallel. The best
  29. analogy would be a light source that acts like the sun: the sun is so far away that all sunlight
  30. hitting objects comes from the same angle.
  31. </div>
  32. <h2>Properties</h2>
  33. <h3>.[page:Object3D target]</h3>
  34. <div>
  35. Target used for shadow camera orientation.
  36. </div>
  37. <h3>.[page:Float intensity]</h3>
  38. <div>
  39. Light's intensity.<br />
  40. Default — *1.0*.
  41. </div>
  42. <h3>.[page:Boolean onlyShadow]</h3>
  43. <div>
  44. If set to *true* light will only cast shadow but not contribute any lighting (as if *intensity* was 0 but cheaper to compute).<br />
  45. Default — *false*.
  46. </div>
  47. <h3>.[page:Float shadowCameraNear]</h3>
  48. <div>
  49. Orthographic shadow camera frustum parameter.<br />
  50. Default — *50*.
  51. </div>
  52. <h3>.[page:Float shadowCameraFar]</h3>
  53. <div>
  54. Orthographic shadow camera frustum parameter.<br />
  55. Default — *5000*.
  56. </div>
  57. <h3>.[page:Float shadowCameraLeft]</h3>
  58. <div>
  59. Orthographic shadow camera frustum parameter.<br />
  60. Default — *-500*.
  61. </div>
  62. <h3>.[page:Float shadowCameraRight]</h3>
  63. <div>
  64. Orthographic shadow camera frustum parameter.<br />
  65. Default — *500*.
  66. </div>
  67. <h3>.[page:Float shadowCameraTop]</h3>
  68. <div>
  69. Orthographic shadow camera frustum parameter.<br />
  70. Default — *500*.
  71. </div>
  72. <h3>.[page:Float shadowCameraBottom]</h3>
  73. <div>
  74. Orthographic shadow camera frustum parameter.<br />
  75. Default — *-500*.
  76. </div>
  77. <h3>.[page:Boolean shadowCameraVisible]</h3>
  78. <div>
  79. Show debug shadow camera frustum.<br />
  80. Default — *false*.
  81. </div>
  82. <h3>.[page:Float shadowBias]</h3>
  83. <div>
  84. Shadow map bias.<br />
  85. Default — *0*.
  86. </div>
  87. <h3>.[page:Float shadowDarkness]</h3>
  88. <div>
  89. Darkness of shadow casted by this light (from *0* to *1*).<br />
  90. Default — *0.5*.
  91. </div>
  92. <h3>.[page:Integer shadowMapWidth]</h3>
  93. <div>
  94. Shadow map texture width in pixels.<br />
  95. Default — *512*.
  96. </div>
  97. <h3>.[page:Integer shadowMapHeight]</h3>
  98. <div>
  99. Shadow map texture height in pixels.<br />
  100. Default — *512*.
  101. </div>
  102. <h3>.[page:Boolean shadowCascade]</h3>
  103. <div>
  104. ??? <br />
  105. Default — *false*.
  106. </div>
  107. <h3>.[page:Vector3 shadowCascadeOffset]</h3>
  108. <div>
  109. ??? <br />
  110. Default — *Three.Vector3( 0, 0, -1000 )*.
  111. </div>
  112. <h3>.[page:Integer shadowCascadeCount]</h3>
  113. <div>
  114. ??? <br />
  115. Default — *2*.
  116. </div>
  117. <h3>.[page:Array shadowCascadeBias]</h3>
  118. <div>
  119. ??? <br />
  120. Default — <strong>[ 0, 0, 0 ]</strong>.
  121. </div>
  122. <h3>.[page:Array shadowCascadeWidth]</h3>
  123. <div>
  124. ??? <br />
  125. Default — <strong>[ 512, 512, 512 ]</strong>.
  126. </div>
  127. <h3>.[page:Array shadowCascadeHeight]</h3>
  128. <div>
  129. ??? <br />
  130. Default — <strong>[ 512, 512, 512 ]</strong>.
  131. </div>
  132. <h3>.[page:Array shadowCascadeNearZ]</h3>
  133. <div>
  134. ??? <br />
  135. Default — <strong>[ -1.000, 0.990, 0.998 ]</strong>.
  136. </div>
  137. <h3>.[page:Array shadowCascadeFarZ]</h3>
  138. <div>
  139. ??? <br />
  140. Default — <strong>[ 0.990, 0.998, 1.000 ]</strong>.
  141. </div>
  142. <h3>.[page:Array shadowCascadeArray]</h3>
  143. <div>
  144. ??? <br />
  145. Default — <strong>[ ]</strong>.
  146. </div>
  147. <h3>.[page:RenderTarget shadowMap]</h3>
  148. <div>
  149. ??? <br />
  150. Default — *null*.
  151. </div>
  152. <h3>.[page:Integer shadowMapSize]</h3>
  153. <div>
  154. ??? <br />
  155. Default — *null*.
  156. </div>
  157. <h3>.[page:Camera shadowCamera]</h3>
  158. <div>
  159. ??? <br />
  160. Default — *null*.
  161. </div>
  162. <h3>.[page:Matrix shadowMatrix]</h3>
  163. <div>
  164. ??? <br />
  165. Default — *null*.
  166. </div>
  167. <h2>Methods</h2>
  168. <h2>Source</h2>
  169. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  170. </body>
  171. </html>