MeshNormalMaterial.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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">一种把法向量映射到RGB颜色的材质。</p>
  13. <iframe id="scene" src="scenes/material-browser.html#MeshNormalMaterial"></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> [page:Object parameters] - (可选)用于定义材质外观的对象,具有一个或多个属性。材质的任何属性都可以从此处传入(包括从[page:Material]继承的任何属性)。
  26. </p>
  27. <h2>属性(Properties)</h2>
  28. <p>共有属性请参见其基类[page:Material]。</p>
  29. <h3>[property:Texture bumpMap]</h3>
  30. <p> 用于创建凹凸贴图的纹理。黑色和白色值映射到与光照相关的感知深度。凹凸实际上不会影响对象的几何形状,只影响光照。如果定义了法线贴图,则将忽略该贴图。
  31. </p>
  32. <h3>[property:Float bumpScale]</h3>
  33. <p> 凹凸贴图会对材质产生多大影响。典型范围是0-1。默认值为1。</p>
  34. <h3>[property:Texture displacementMap]</h3>
  35. <p> 位移贴图会影响网格顶点的位置,与仅影响材质的光照和阴影的其他贴图不同,移位的顶点可以投射阴影,阻挡其他对象,
  36. 以及充当真实的几何体。位移纹理是指:网格的所有顶点被映射为图像中每个像素的值(白色是最高的),并且被重定位。
  37. </p>
  38. <h3>[property:Float displacementScale]</h3>
  39. <p> 位移贴图对网格的影响程度(黑色是无位移,白色是最大位移)。如果没有设置位移贴图,则不会应用此值。默认值为1。
  40. </p>
  41. <h3>[property:Float displacementBias]</h3>
  42. <p>
  43. 位移贴图在网格顶点上的偏移量。如果没有设置位移贴图,则不会应用此值。默认值为0。
  44. </p>
  45. <h3>[property:Boolean flatShading]</h3>
  46. <p> 定义材质是否使用平面着色进行渲染。默认值为false。
  47. </p>
  48. <h3>[property:Texture normalMap]</h3>
  49. <p> 用于创建法线贴图的纹理。RGB值会影响每个像素片段的曲面法线,并更改颜色照亮的方式。法线贴图不会改变曲面的实际形状,只会改变光照。
  50. In case the material has a normal map authored using the left handed convention, the y component of normalScale
  51. should be negated to compensate for the different handedness.
  52. </p>
  53. <h3>[property:Integer normalMapType]</h3>
  54. <p> 法线贴图的类型。<br /><br />
  55. 选项为[page:constant THREE.TangentSpaceNormalMap](默认)和[page:constant THREE.ObjectSpaceNormalMap]。
  56. </p>
  57. <h3>[property:Vector2 normalScale]</h3>
  58. <p> 法线贴图对材质的影响程度。典型范围是0-1。默认值是[page:Vector2]设置为(1,1)。
  59. </p>
  60. <h3>[property:Boolean wireframe]</h3>
  61. <p>
  62. 将几何体渲染为线框。默认值为*false*(即渲染为平滑着色)。
  63. </p>
  64. <h3>[property:Float wireframeLinewidth]</h3>
  65. <p>控制线框宽度。默认值为1。<br /><br />
  66. 由于[link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile]与大多数平台上[page:WebGLRenderer WebGL]渲染器的限制,无论如何设置该值,线宽始终为1。
  67. </p>
  68. <h2>方法(Methods)</h2>
  69. <p>共有方法请参见其基类[page:Material]。</p>
  70. <h2>源码(Source)</h2>
  71. <p>
  72. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  73. </p>
  74. </body>
  75. </html>