Instance Method

initWithName:semantic:color:

Initializes a material property with a color value.

Declaration

- (instancetype)initWithName:(NSString *)name semantic:(MDLMaterialSemantic)semantic color:(CGColorRef)color;

Parameters

name

A descriptive name for the material property. For details, see the name property.

semantic

The semantic meaning for the material property’s value. For details, see the semantic property.

color

The color value for the material property.

Return Value

A new material property object whose type property is MDLMaterialPropertyTypeColor.

Discussion

A material property with a color value uses a uniform color for all pixels rendered using the material. This option is useful for base colors of solid-colored objects, and also for material semantics where variation across the surface of the material is unnecessary. To vary colors across a surface, use a texture image instead.

See Also

Creating a Material Property

- initWithName:semantic:

Initializes a material property without a value.

- initWithName:semantic:string:

Initializes a material property with a string value.

- initWithName:semantic:URL:

Initializes a material property with a URL value.

- initWithName:semantic:textureSampler:

Initializes a material property with a texture sampler object.

- initWithName:semantic:float:

Initializes a material property with a scalar value.

- initWithName:semantic:float2:

Initializes a material property with a 2-component vector value.

- initWithName:semantic:float3:

Initializes a material property with a 3-component vector value.

- initWithName:semantic:float4:

Initializes a material property with a 4-component vector value.

- initWithName:semantic:matrix4x4:

Initializes a material property with a 4 x 4 matrix value.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software