MeshDepthMaterial.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. [page:Material] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. A material for drawing geometry by depth. Depth is based off of the camera
  14. near and far plane. White is nearest, black is farthest.
  15. </p>
  16. <iframe
  17. id="scene"
  18. src="scenes/material-browser.html#MeshDepthMaterial"
  19. ></iframe>
  20. <script>
  21. // iOS iframe auto-resize workaround
  22. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  23. const scene = document.getElementById( 'scene' );
  24. scene.style.width = getComputedStyle( scene ).width;
  25. scene.style.height = getComputedStyle( scene ).height;
  26. scene.setAttribute( 'scrolling', 'no' );
  27. }
  28. </script>
  29. <h2>Constructor</h2>
  30. <h3>[name]( [param:Object parameters] )</h3>
  31. <p>
  32. [page:Object parameters] - (optional) an object with one or more
  33. properties defining the material's appearance. Any property of the
  34. material (including any property inherited from [page:Material]) can be
  35. passed in here.
  36. </p>
  37. <h2>Properties</h2>
  38. <p>See the base [page:Material] class for common properties.</p>
  39. <h3>[property:Texture alphaMap]</h3>
  40. <p>
  41. The alpha map is a grayscale texture that controls the opacity across the
  42. surface (black: fully transparent; white: fully opaque). Default is
  43. null.<br /><br />
  44. Only the color of the texture is used, ignoring the alpha channel if one
  45. exists. For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer
  46. will use the green channel when sampling this texture due to the extra bit
  47. of precision provided for green in DXT-compressed and uncompressed RGB 565
  48. formats. Luminance-only and luminance/alpha textures will also still work
  49. as expected.
  50. </p>
  51. <h3>[property:Constant depthPacking]</h3>
  52. <p>Type for depth packing. Default is [page:Textures BasicDepthPacking].</p>
  53. <h3>[property:Texture displacementMap]</h3>
  54. <p>
  55. The displacement map affects the position of the mesh's vertices. Unlike
  56. other maps which only affect the light and shade of the material the
  57. displaced vertices can cast shadows, block other objects, and otherwise
  58. act as real geometry. The displacement texture is an image where the value
  59. of each pixel (white being the highest) is mapped against, and
  60. repositions, the vertices of the mesh.
  61. </p>
  62. <h3>[property:Float displacementScale]</h3>
  63. <p>
  64. How much the displacement map affects the mesh (where black is no
  65. displacement, and white is maximum displacement). Without a displacement
  66. map set, this value is not applied. Default is `1`.
  67. </p>
  68. <h3>[property:Float displacementBias]</h3>
  69. <p>
  70. The offset of the displacement map's values on the mesh's vertices.
  71. Without a displacement map set, this value is not applied. Default is `0`.
  72. </p>
  73. <h3>[property:Boolean fog]</h3>
  74. <p>Whether the material is affected by fog. Default is `false`.</p>
  75. <h3>[property:Texture map]</h3>
  76. <p>
  77. The color map. May optionally include an alpha channel, typically combined
  78. with [page:Material.transparent .transparent] or [page:Material.alphaTest .alphaTest].
  79. Default is null.
  80. </p>
  81. <h3>[property:Boolean wireframe]</h3>
  82. <p>
  83. Render geometry as wireframe. Default is false (i.e. render as smooth
  84. shaded).
  85. </p>
  86. <h3>[property:Float wireframeLinewidth]</h3>
  87. <p>
  88. Controls wireframe thickness. Default is `1`.<br /><br />
  89. Due to limitations of the
  90. [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile]
  91. with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be `1` regardless of the set value.
  92. </p>
  93. <h2>Methods</h2>
  94. <p>See the base [page:Material] class for common methods.</p>
  95. <h2>Source</h2>
  96. <p>
  97. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  98. </p>
  99. </body>
  100. </html>