Ver Fonte

Added .ior property

WestLangley há 4 anos atrás
pai
commit
5444703dfc

+ 7 - 2
docs/api/en/materials/MeshPhysicalMaterial.html

@@ -121,11 +121,16 @@
 			This is used by the [page:WebGLRenderer] for selecting shaders.
 		</p>
 
+		<h3>[property:Float ior]</h3>
+		<p>
+			Index-of-refraction for non-metallic materials, from *1.0* to *2.333*. Default is *1.5*.<br />
+		</p>
+
 		<h3>[property:Float reflectivity]</h3>
 		<p>
-		Degree of reflectivity, from *0.0* to *1.0*. Default is *0.5*.<br />
+			Degree of reflectivity, from *0.0* to *1.0*. Default is *0.5*, which corresponds to an index-of-refraction of 1.5.<br />
 
-		This models the reflectivity of non-metallic materials. It has no effect when [page:MeshStandardMaterial.metalness metalness] is *1.0*
+			This models the reflectivity of non-metallic materials. It has no effect when [page:MeshStandardMaterial.metalness metalness] is *1.0*
 		</p>
 
 		<h3>[property:Float transmission]</h3>

+ 8 - 1
docs/api/zh/materials/MeshPhysicalMaterial.html

@@ -118,8 +118,15 @@
 			[page:WebGLRenderer]使用它来选择shaders。
 		</p>
 
+		<h3>[property:Float ior]</h3>
+		<p>
+			Index-of-refraction for non-metallic materials, from *1.0* to *2.333*. Default is *1.5*.<br />
+		</p>
+
 		<h3>[property:Float reflectivity]</h3>
-		<p> 反射度,从*0.0*到*1.0*。默认值为*0.5*。<br />
+		<p>
+			Degree of reflectivity, from *0.0* to *1.0*. Default is *0.5*, which corresponds to an index-of-refraction of 1.5.<br />
+
 			这模拟了非金属材质的反射率。当[page:MeshStandardMaterial]为*1.0*时,此属性无效。
 		</p>
 

+ 6 - 0
src/materials/MeshPhysicalMaterial.d.ts

@@ -17,6 +17,7 @@ export interface MeshPhysicalMaterialParameters
 	clearcoatNormalMap?: Texture | null;
 
 	reflectivity?: number;
+	ior?: number;
 
 	sheen?: Color;
 
@@ -74,6 +75,11 @@ export class MeshPhysicalMaterial extends MeshStandardMaterial {
 	 */
 	reflectivity: number;
 
+	/**
+	 * @default 1.5
+	 */
+	ior: number;
+
 	/**
 	 * @default null
 	 */