Return a new material with the same parameters as this material.
Returns this
copy
copy(source:any):this
Copy the parameters from the passed material into this material.
Parameters
source: any
Returns this
customProgramCacheKey
customProgramCacheKey():string
In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader as needed.
Deserializes the material from JSON.
Note: some properties that are not serialized in Material.toJSON when they are default values (like side, alphaTest, blending, maps), they wont be reverted back if not present in JSON
If _internal = true, Textures should be loaded and in meta.textures before calling this method.
An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter.
Useful for the modification of built-in materials.
Sets the values of this material based on the values of the passed material or an object with material properties
The input is expected to be a valid material or a deserialized material parameters object(including the deserialized userdata)
if undefined, then depends on material.isMaterial. if true, the current userdata is cleared before setting the new values, because it can have data which wont be overwritten if not present in the new material.
Calls only super.toJSON, does internal three.js serialization and @serialize tags. Set it to true only if you know what you are doing. This is used in Serialization->serializer->material
And extension of three.js MeshPhysicalMaterial that can be assigned to objects, and support threepipe features, uiconfig, and serialization.