Class MaterialBuilder
Configures a material's name, shader, passes and requirements. The shader manager passes one to the configuring callback of its material registration.
public sealed class MaterialBuilder
- Inheritance
-
MaterialBuilder
- Inherited Members
Methods
AllowPasses(RenderPassTag)
Sets the passes the material may be drawn in. None allows every pass.
public MaterialBuilder AllowPasses(RenderPassTag passes)
Parameters
passesRenderPassTag
Returns
RequireTexture(string)
Adds a texture name the material needs. A blank name is ignored.
public MaterialBuilder RequireTexture(string textureName)
Parameters
textureNamestring
Returns
RequireUniform(string)
Adds a uniform name the material's shader must have. A blank name is ignored.
public MaterialBuilder RequireUniform(string uniformName)
Parameters
uniformNamestring
Returns
WithName(string)
Sets the material's name. A blank name keeps the current one.
public MaterialBuilder WithName(string name)
Parameters
namestring
Returns
WithShader(Func<IShaderProgram>)
Sets the factory that creates the material's shader program. A shader factory is required.
public MaterialBuilder WithShader(Func<IShaderProgram> factory)
Parameters
factoryFunc<IShaderProgram>