LightShadow.html 4.4 KB

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