MeshDepthMaterial.html 3.8 KB

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