Contents

init(from:surfaceShader:geometryModifier:)

Creates a custom material from an existing material, surface shader, and geometry modifier.

Declaration

init(from material: any Material, surfaceShader: CustomMaterial.SurfaceShader, geometryModifier: CustomMaterial.GeometryModifier? = nil) throws

Parameters

  • material:

    The material from which to copy properties.

  • surfaceShader:

    The surface shader function.

  • geometryModifier:

    The geometry modifier shader function.

Discussion

Use this initializer to create a custom material with the same properties as another existing material, but with a geometry modifier and surface shader.

See Also

Creating custom materials