float4 position [[attribute(0)]]
float3 normal [[attribute(1)]]
float2 textureCoords [[attribute(2)]]
An attribute that allows to map the properties of the vertex structure to the layout of the corresponding data buffer provided the the vertex shader by the render pipeline. These attributes are assigned in the header file that is auto-generated by Shaderifc since the vertex structure has to match the corresponding layout of the data buffer.
float4 position [[position]]
An attribute that specifies the transformed position information returned by the vertex function. The attribute can be applied either to the return type itself or the property of a structure returned by the vertex function.
const Vertex in [[stage_in]]
An attribute that specifies the per vertex or per fragment input that is passed as an argument to the vertex or fragment function respectively.
In case of the vertex function the vertex data contains position, normal and texture information. The corresponding data structure providing the vertex data is defined in the header file that is auto-generated by Shaderific.
Varying in [[stage_in]]
In case of the fragment function the available data is determined by the return type of the vertex function. This type has to contain position information specified by the position attribute.
constant Uniforms &uniforms [[buffer(1)]]
An attribute that specifies buffer data passed as an argument to the vertex or fragment function. The data contained by the buffer is equal for every vertex or fragment. As of now only one buffer is provided by Shaderific’s render pipeline. The data structure providing the uniform buffer data is defined in the header file that is auto-generated by Shaderific. The uniform buffer contains default properties (e.g. modelViewProjectionMatrix) and custom properties can be specified by the user via the respective metadata attributes.
// unif[float3][diffuseColor][0.0:1.0][1.0,0.0,0.0]
// unif[float3][lightPosition][0.0:1.0][0.5,0.5,1.0]
// unif[bool][directional][true]
texture2d<float> texture0 [[texture(0)]]
texturecube<float> texture1 [[texture(1)]]
An attribute that specifies texture data passed as an argument to the vertex or fragment function. The image to be bound to the vertex or fragment function can be specified by the user via the respective metadata attributes.
// txrv[Earth_height, Earth_specular]
// txrf[Church_cubemap]