LightShadow.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">Serves as a base class for the other shadow classes.</p>
  12. <h2>Constructor</h2>
  13. <h3>[name]( [param:Camera camera] )</h3>
  14. <p>
  15. [page:Camera camera] - the light's view of the world.<br /><br />
  16. Create a new [name]. This is not intended to be called directly - it is
  17. used as a base class by other light shadows.
  18. </p>
  19. <h2>Properties</h2>
  20. <h3>[property:Boolean autoUpdate]</h3>
  21. <p>
  22. Enables automatic updates of the light's shadow. Default is `true`. If you
  23. do not require dynamic lighting / shadows, you may set this to `false`.
  24. </p>
  25. <h3>[property:Camera camera]</h3>
  26. <p>
  27. The light's view of the world. This is used to generate a depth map of the
  28. scene; objects behind other objects from the light's perspective will be
  29. in shadow.
  30. </p>
  31. <h3>[property:Float bias]</h3>
  32. <p>
  33. Shadow map bias, how much to add or subtract from the normalized depth
  34. when deciding whether a surface is in shadow.<br />
  35. The default is `0`. Very tiny adjustments here (in the order of `0.0001`) may
  36. help reduce artifacts in shadows
  37. </p>
  38. <h3>[property:Integer blurSamples]</h3>
  39. <p>The amount of samples to use when blurring a VSM shadow map.</p>
  40. <h3>[property:Float intensity]</h3>
  41. <p>
  42. The intensity of the shadow. The default is `1`. Valid values are in the range `[0, 1]`.
  43. </p>
  44. <h3>[property:WebGLRenderTarget map]</h3>
  45. <p>
  46. The depth map generated using the internal camera; a location beyond a
  47. pixel's depth is in shadow. Computed internally during rendering.
  48. </p>
  49. <h3>[property:WebGLRenderTarget mapPass]</h3>
  50. <p>
  51. The distribution map generated using the internal camera; an occlusion is
  52. calculated based on the distribution of depths. Computed internally during
  53. rendering.
  54. </p>
  55. <h3>[property:Vector2 mapSize]</h3>
  56. <p>
  57. A [Page:Vector2] defining the width and height of the shadow map.<br /><br />
  58. Higher values give better quality shadows at the cost of computation time.
  59. Values must be powers of 2, up to the
  60. [page:WebGLRenderer.capabilities].maxTextureSize for a given device,
  61. although the width and height don't have to be the same (so, for example,
  62. (512, 1024) is valid). The default is `( 512, 512 )`.
  63. </p>
  64. <h3>[property:Matrix4 matrix]</h3>
  65. <p>
  66. Model to shadow camera space, to compute location and depth in shadow map.
  67. Stored in a [page:Matrix4 Matrix4]. This is computed internally during
  68. rendering.
  69. </p>
  70. <h3>[property:Boolean needsUpdate]</h3>
  71. <p>
  72. When set to `true`, shadow maps will be updated in the next `render` call.
  73. Default is `false`. If you have set [page:.autoUpdate] to `false`, you
  74. will need to set this property to `true` and then make a render call to
  75. update the light's shadow.
  76. </p>
  77. <h3>[property:Float normalBias]</h3>
  78. <p>
  79. Defines how much the position used to query the shadow map is offset along
  80. the object normal. The default is `0`. Increasing this value can be used to
  81. reduce shadow acne especially in large scenes where light shines onto
  82. geometry at a shallow angle. The cost is that shadows may appear
  83. distorted.
  84. </p>
  85. <h3>[property:Float radius]</h3>
  86. <p>
  87. Setting this to values greater than 1 will blur the edges of the
  88. shadow.<br />
  89. High values will cause unwanted banding effects in the shadows - a greater
  90. [page:.mapSize mapSize] will allow for a higher value to be used here
  91. before these effects become visible.<br />
  92. If [page:WebGLRenderer.shadowMap.type] is set to [page:Renderer PCFSoftShadowMap],
  93. radius has no effect and it is recommended to increase
  94. softness by decreasing [page:.mapSize mapSize] instead.<br /><br />
  95. Note that this has no effect if the [page:WebGLRenderer.shadowMap.type] is
  96. set to [page:Renderer BasicShadowMap].
  97. </p>
  98. <h2>Methods</h2>
  99. <h3>[method:Vector2 getFrameExtents]()</h3>
  100. <p>
  101. Used internally by the renderer to extend the shadow map to contain all
  102. viewports
  103. </p>
  104. <h3>[method:undefined updateMatrices]( [param:Light light] )</h3>
  105. <p>
  106. Update the matrices for the camera and shadow, used internally by the
  107. renderer.<br /><br />
  108. light -- the light for which the shadow is being rendered.
  109. </p>
  110. <h3>[method:Frustum getFrustum]()</h3>
  111. <p>
  112. Gets the shadow cameras frustum. Used internally by the renderer to cull
  113. objects.
  114. </p>
  115. <h3>[method:number getViewportCount]()</h3>
  116. <p>
  117. Used internally by the renderer to get the number of viewports that need
  118. to be rendered for this shadow.
  119. </p>
  120. <h3>[method:undefined dispose]()</h3>
  121. <p>
  122. Frees the GPU-related resources allocated by this instance. Call this
  123. method whenever this instance is no longer used in your app.
  124. </p>
  125. <h3>[method:this copy]( [param:LightShadow source] )</h3>
  126. <p>
  127. Copies value of all the properties from the [page:LightShadow source] to
  128. this Light.
  129. </p>
  130. <h3>[method:LightShadow clone]()</h3>
  131. <p>Creates a new LightShadow with the same properties as this one.</p>
  132. <h3>[method:Object toJSON]()</h3>
  133. <p>Serialize this LightShadow.</p>
  134. <h2>Source</h2>
  135. <p>
  136. [link:https://github.com/mrdoob/three.js/blob/master/src/lights/[name].js src/lights/[name].js]
  137. </p>
  138. </body>
  139. </html>