Explorar el Código

Merge pull request #17589 from OlovNord/dev

All Texture values in Material type definitions are now nullable.
Mr.doob hace 5 años
padre
commit
770ddc2e30

+ 5 - 5
src/materials/MeshBasicMaterial.d.ts

@@ -8,12 +8,12 @@ import { Combine } from '../constants';
 export interface MeshBasicMaterialParameters extends MaterialParameters {
 	color?: Color | string | number;
 	opacity?: number;
-	map?: Texture;
-	aoMap?: Texture;
+	map?: Texture | null;
+	aoMap?: Texture | null;
 	aoMapIntensity?: number;
-	specularMap?: Texture;
-	alphaMap?: Texture;
-	envMap?: Texture;
+	specularMap?: Texture | null;
+	alphaMap?: Texture | null;
+	envMap?: Texture | null;
 	combine?: Combine;
 	reflectivity?: number;
 	refractionRatio?: number;

+ 1 - 1
src/materials/MeshDepthMaterial.d.ts

@@ -4,7 +4,7 @@ import { Texture } from './../textures/Texture';
 
 export interface MeshDepthMaterialParameters extends MaterialParameters {
 	depthPacking?: DepthPackingStrategies;
-	displacementMap?: Texture;
+	displacementMap?: Texture | null;
 	displacementScale?: number;
 	displacementBias?: number;
 	wireframe?: boolean;

+ 1 - 1
src/materials/MeshDistanceMaterial.d.ts

@@ -6,7 +6,7 @@ export interface MeshDistanceMaterialParameters extends MaterialParameters {
 	referencePosition?: Vector3;
 	nearDistance?: number;
 	farDistance?: number;
-	displacementMap?: Texture;
+	displacementMap?: Texture | null;
 	displacementScale?: number;
 	displacementBias?: number;
 }

+ 7 - 7
src/materials/MeshLambertMaterial.d.ts

@@ -7,15 +7,15 @@ export interface MeshLambertMaterialParameters extends MaterialParameters {
 	color?: Color | string | number;
 	emissive?: Color | string | number;
 	emissiveIntensity?: number;
-	emissiveMap?: Texture;
-	map?: Texture;
-	lightMap?: Texture;
+	emissiveMap?: Texture | null;
+	map?: Texture | null;
+	lightMap?: Texture | null;
 	lightMapIntensity?: number;
-	aoMap?: Texture;
+	aoMap?: Texture | null;
 	aoMapIntensity?: number;
-	specularMap?: Texture;
-	alphaMap?: Texture;
-	envMap?: Texture;
+	specularMap?: Texture | null;
+	alphaMap?: Texture | null;
+	envMap?: Texture | null;
 	combine?: Combine;
 	reflectivity?: number;
 	refractionRatio?: number;

+ 6 - 6
src/materials/MeshMatcapMaterial.d.ts

@@ -7,17 +7,17 @@ import { NormalMapTypes } from '../constants';
 export interface MeshMatcapMaterialParameters extends MaterialParameters {
 
 	color?: Color | string | number;
-	matcap?: Texture;
-	map?: Texture;
-	bumpMap?: Texture;
+	matcap?: Texture | null;
+	map?: Texture | null;
+	bumpMap?: Texture | null;
 	bumpScale?: number;
-	normalMap?: Texture;
+	normalMap?: Texture | null;
 	normalMapType?: NormalMapTypes;
 	normalScale?: Vector2;
-	displacementMap?: Texture;
+	displacementMap?: Texture | null;
 	displacementScale?: number;
 	displacementBias?: number;
-	alphaMap?: Texture;
+	alphaMap?: Texture | null;
 	skinning?: boolean;
 	morphTargets?: boolean;
 	morphNormals?: boolean;

+ 3 - 3
src/materials/MeshNormalMaterial.d.ts

@@ -5,12 +5,12 @@ import { NormalMapTypes } from '../constants';
 
 export interface MeshNormalMaterialParameters extends MaterialParameters {
 
-	bumpMap?: Texture;
+	bumpMap?: Texture | null;
 	bumpScale?: number;
-	normalMap?: Texture;
+	normalMap?: Texture | null;
 	normalMapType?: NormalMapTypes;
 	normalScale?: Vector2;
-	displacementMap?: Texture;
+	displacementMap?: Texture | null;
 	displacementScale?: number;
 	displacementBias?: number;
 	wireframe?: boolean;

+ 10 - 10
src/materials/MeshPhongMaterial.d.ts

@@ -10,25 +10,25 @@ export interface MeshPhongMaterialParameters extends MaterialParameters {
 	specular?: Color | string | number;
 	shininess?: number;
 	opacity?: number;
-	map?: Texture;
-	lightMap?: Texture;
+	map?: Texture | null;
+	lightMap?: Texture | null;
 	lightMapIntensity?: number;
-	aoMap?: Texture;
+	aoMap?: Texture | null;
 	aoMapIntensity?: number;
 	emissive?: Color | string | number;
 	emissiveIntensity?: number;
-	emissiveMap?: Texture;
-	bumpMap?: Texture;
+	emissiveMap?: Texture | null;
+	bumpMap?: Texture | null;
 	bumpScale?: number;
-	normalMap?: Texture;
+	normalMap?: Texture | null;
 	normalMapType?: NormalMapTypes;
 	normalScale?: Vector2;
-	displacementMap?: Texture;
+	displacementMap?: Texture | null;
 	displacementScale?: number;
 	displacementBias?: number;
-	specularMap?: Texture;
-	alphaMap?: Texture;
-	envMap?: Texture;
+	specularMap?: Texture | null;
+	alphaMap?: Texture | null;
+	envMap?: Texture | null;
 	combine?: Combine;
 	reflectivity?: number;
 	refractionRatio?: number;

+ 1 - 1
src/materials/MeshPhysicalMaterial.d.ts

@@ -15,7 +15,7 @@ export interface MeshPhysicalMaterialParameters
 	sheen?: Color;
 
 	clearcoatNormalScale?: Vector2;
-	clearcoatNormalMap?: Texture;
+	clearcoatNormalMap?: Texture | null;
 }
 
 export class MeshPhysicalMaterial extends MeshStandardMaterial {

+ 11 - 11
src/materials/MeshStandardMaterial.d.ts

@@ -8,26 +8,26 @@ export interface MeshStandardMaterialParameters extends MaterialParameters {
 	color?: Color | string | number;
 	roughness?: number;
 	metalness?: number;
-	map?: Texture;
-	lightMap?: Texture;
+	map?: Texture | null;
+	lightMap?: Texture | null;
 	lightMapIntensity?: number;
-	aoMap?: Texture;
+	aoMap?: Texture | null;
 	aoMapIntensity?: number;
 	emissive?: Color | string | number;
 	emissiveIntensity?: number;
-	emissiveMap?: Texture;
-	bumpMap?: Texture;
+	emissiveMap?: Texture | null;
+	bumpMap?: Texture | null;
 	bumpScale?: number;
-	normalMap?: Texture;
+	normalMap?: Texture | null;
 	normalMapType?: NormalMapTypes;
 	normalScale?: Vector2;
-	displacementMap?: Texture;
+	displacementMap?: Texture | null;
 	displacementScale?: number;
 	displacementBias?: number;
-	roughnessMap?: Texture;
-	metalnessMap?: Texture;
-	alphaMap?: Texture;
-	envMap?: Texture;
+	roughnessMap?: Texture | null;
+	metalnessMap?: Texture | null;
+	alphaMap?: Texture | null;
+	envMap?: Texture | null;
 	envMapIntensity?: number;
 	refractionRatio?: number;
 	wireframe?: boolean;

+ 1 - 1
src/materials/MeshToonMaterial.d.ts

@@ -2,7 +2,7 @@ import { Texture } from './../textures/Texture';
 import { MeshPhongMaterialParameters, MeshPhongMaterial } from './MeshPhongMaterial';
 
 export interface MeshToonMaterialParameters extends MeshPhongMaterialParameters {
-	gradientMap?: Texture;
+	gradientMap?: Texture | null;
 }
 
 export class MeshToonMaterial extends MeshPhongMaterial {

+ 1 - 1
src/materials/SpriteMaterial.d.ts

@@ -4,7 +4,7 @@ import { MaterialParameters, Material } from './Material';
 
 export interface SpriteMaterialParameters extends MaterialParameters {
 	color?: Color | string | number;
-	map?: Texture;
+	map?: Texture | null;
 	rotation?: number;
 	sizeAttenuation?: boolean;
 }