Table of Contents

Class MaterialBuilder

Namespace
BSGameLib.Game.Rendering
Assembly
BSGameLib.Game.dll

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

passes RenderPassTag

Returns

MaterialBuilder

RequireTexture(string)

Adds a texture name the material needs. A blank name is ignored.

public MaterialBuilder RequireTexture(string textureName)

Parameters

textureName string

Returns

MaterialBuilder

RequireUniform(string)

Adds a uniform name the material's shader must have. A blank name is ignored.

public MaterialBuilder RequireUniform(string uniformName)

Parameters

uniformName string

Returns

MaterialBuilder

WithName(string)

Sets the material's name. A blank name keeps the current one.

public MaterialBuilder WithName(string name)

Parameters

name string

Returns

MaterialBuilder

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

factory Func<IShaderProgram>

Returns

MaterialBuilder