Browse Source

Add defines to material types

Bastien Robert 5 years ago
parent
commit
19ef82b943
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/materials/Material.d.ts

+ 7 - 0
src/materials/Material.d.ts

@@ -30,6 +30,7 @@ export interface MaterialParameters {
 	clippingPlanes?: Plane[];
 	clipShadows?: boolean;
 	colorWrite?: boolean;
+	defines?: any;
 	depthFunc?: DepthModes;
 	depthTest?: boolean;
 	depthWrite?: boolean;
@@ -125,6 +126,12 @@ export class Material extends EventDispatcher {
 	 * Whether to render the material's color. This can be used in conjunction with a mesh's .renderOrder property to create invisible objects that occlude other objects. Default is true.
 	 */
 	colorWrite: boolean;
+	
+	/**
+	 * Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI * 2 }. 
+	 * The pairs are defined in both vertex and fragment shaders. Default is undefined.
+	 */
+	defines: any;
 
 	/**
 	 * Which depth function to use. Default is {@link LessEqualDepth}. See the depth mode constants for all possible values.