Explorar o código

Support wireframe (#31917)

WestLangley hai 3 meses
pai
achega
ae1ecc9349

+ 16 - 0
docs/api/en/materials/MeshMatcapMaterial.html

@@ -157,6 +157,22 @@
 			Default is a [page:Vector2] set to (1,1).
 		</p>
 
+		<h3>[property:Boolean wireframe]</h3>
+		<p>
+			Render geometry as wireframe. Default is false (i.e. render as smooth
+			shaded).
+		</p>
+
+		<h3>[property:Float wireframeLinewidth]</h3>
+		<p>
+			Controls wireframe thickness. Default is `1`.<br /><br />
+
+			Due to limitations of the
+			[link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile]
+			with the [page:WebGLRenderer WebGL] renderer on most
+			platforms linewidth will always be `1` regardless of the set value.
+		</p>
+
 		<h2>Methods</h2>
 		<p>See the base [page:Material] class for common methods.</p>
 

+ 21 - 0
src/materials/MeshMatcapMaterial.js

@@ -164,6 +164,24 @@ class MeshMatcapMaterial extends Material {
 		 */
 		this.alphaMap = null;
 
+		/**
+		 * Renders the geometry as a wireframe.
+		 *
+		 * @type {boolean}
+		 * @default false
+		 */
+		this.wireframe = false;
+
+		/**
+		 * Controls the thickness of the wireframe.
+		 *
+		 * Can only be used with {@link SVGRenderer}.
+		 *
+		 * @type {number}
+		 * @default 1
+		 */
+		this.wireframeLinewidth = 1;
+
 		/**
 		 * Whether the material is rendered with flat shading or not.
 		 *
@@ -210,6 +228,9 @@ class MeshMatcapMaterial extends Material {
 
 		this.alphaMap = source.alphaMap;
 
+		this.wireframe = source.wireframe;
+		this.wireframeLinewidth = source.wireframeLinewidth;
+
 		this.flatShading = source.flatShading;
 
 		this.fog = source.fog;

粤ICP备19079148号