LightShadow.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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:WebGLRenderTarget map]</h3>
  41. <p>
  42. The depth map generated using the internal camera; a location beyond a
  43. pixel's depth is in shadow. Computed internally during rendering.
  44. </p>
  45. <h3>[property:WebGLRenderTarget mapPass]</h3>
  46. <p>
  47. The distribution map generated using the internal camera; an occlusion is
  48. calculated based on the distribution of depths. Computed internally during
  49. rendering.
  50. </p>
  51. <h3>[property:Vector2 mapSize]</h3>
  52. <p>
  53. A [Page:Vector2] defining the width and height of the shadow map.<br /><br />
  54. Higher values give better quality shadows at the cost of computation time.
  55. Values must be powers of 2, up to the
  56. [page:WebGLRenderer.capabilities].maxTextureSize for a given device,
  57. although the width and height don't have to be the same (so, for example,
  58. (512, 1024) is valid). The default is *( 512, 512 )*.
  59. </p>
  60. <h3>[property:Matrix4 matrix]</h3>
  61. <p>
  62. Model to shadow camera space, to compute location and depth in shadow map.
  63. Stored in a [page:Matrix4 Matrix4]. This is computed internally during
  64. rendering.
  65. </p>
  66. <h3>[property:Boolean needsUpdate]</h3>
  67. <p>
  68. When set to `true`, shadow maps will be updated in the next `render` call.
  69. Default is `false`. If you have set [page:.autoUpdate] to `false`, you
  70. will need to set this property to `true` and then make a render call to
  71. update the light's shadow.
  72. </p>
  73. <h3>[property:Float normalBias]</h3>
  74. <p>
  75. Defines how much the position used to query the shadow map is offset along
  76. the object normal. The default is 0. Increasing this value can be used to
  77. reduce shadow acne especially in large scenes where light shines onto
  78. geometry at a shallow angle. The cost is that shadows may appear
  79. distorted.
  80. </p>
  81. <h3>[property:Float radius]</h3>
  82. <p>
  83. Setting this to values greater than 1 will blur the edges of the
  84. shadow.<br />
  85. High values will cause unwanted banding effects in the shadows - a greater
  86. [page:.mapSize mapSize] will allow for a higher value to be used here
  87. before these effects become visible.<br />
  88. If [page:WebGLRenderer.shadowMap.type] is set to [page:Renderer PCFSoftShadowMap],
  89. radius has no effect and it is recommended to increase
  90. softness by decreasing [page:.mapSize mapSize] instead.<br /><br />
  91. Note that this has no effect if the [page:WebGLRenderer.shadowMap.type] is
  92. set to [page:Renderer BasicShadowMap].
  93. </p>
  94. <h2>Methods</h2>
  95. <h3>[method:Vector2 getFrameExtents]()</h3>
  96. <p>
  97. Used internally by the renderer to extend the shadow map to contain all
  98. viewports
  99. </p>
  100. <h3>[method:undefined updateMatrices]( [param:Light light] )</h3>
  101. <p>
  102. Update the matrices for the camera and shadow, used internally by the
  103. renderer.<br /><br />
  104. light -- the light for which the shadow is being rendered.
  105. </p>
  106. <h3>[method:Frustum getFrustum]()</h3>
  107. <p>
  108. Gets the shadow cameras frustum. Used internally by the renderer to cull
  109. objects.
  110. </p>
  111. <h3>[method:number getViewportCount]()</h3>
  112. <p>
  113. Used internally by the renderer to get the number of viewports that need
  114. to be rendered for this shadow.
  115. </p>
  116. <h3>[method:undefined dispose]()</h3>
  117. <p>
  118. Frees the GPU-related resources allocated by this instance. Call this
  119. method whenever this instance is no longer used in your app.
  120. </p>
  121. <h3>[method:this copy]( [param:LightShadow source] )</h3>
  122. <p>
  123. Copies value of all the properties from the [page:LightShadow source] to
  124. this Light.
  125. </p>
  126. <h3>[method:LightShadow clone]()</h3>
  127. <p>Creates a new LightShadow with the same properties as this one.</p>
  128. <h3>[method:Object toJSON]()</h3>
  129. <p>Serialize this LightShadow.</p>
  130. <h2>Source</h2>
  131. <p>
  132. [link:https://github.com/mrdoob/three.js/blob/master/src/lights/[name].js src/lights/[name].js]
  133. </p>
  134. </body>
  135. </html>