Lysa  0.0
Lysa 3D Engine
MaterialManager Class Referenceabstract

Detailed Description

Factory and registry for Material objects.

Lua full name: lysa.MaterialManager

Public Member Functions

StandardMaterial create_standard ()
 Creates and returns a new StandardMaterial with default PBR values. More...
 
ShaderMaterial create_shader (frag: string, vert: string, param_count: integer, stage: integer)
 Creates a ShaderMaterial with custom frag/vert shaders, parameter count, and pipeline stage. More...
 
ShaderMaterial create_shader (frag: string, vert: string, param_count: integer)
 Creates a ShaderMaterial with custom frag/vert shaders and parameter count (default stage). More...
 
ShaderMaterial create_shader (frag: string, param_count: integer, stage: integer)
 Creates a ShaderMaterial with a fragment shader, parameter count, and pipeline stage (default vert shader). More...
 
ShaderMaterial create_shader (frag: string, param_count: integer)
 Creates a ShaderMaterial with a fragment shader and parameter count (default vert shader and stage). More...
 
ShaderMaterial create_shader (frag: string)
 Creates a ShaderMaterial with only a fragment shader (default vert shader, parameter count, and stage). More...
 
Material get (id: integer)
 Returns the material with the given id. More...
 
nil upload_parameters (mat: ShaderMaterial)
 Schedules an upload of the parameters SSBO block for the given ShaderMaterial to the GPU. More...
 
nil destroy (id: integer)
 Destroys the material with the given id and releases its GPU resources. More...
 
nil destroy (mat: StandardMaterial)
 Destroys the given StandardMaterial and releases its GPU resources. More...
 
nil destroy (mat: ShaderMaterial)
 Destroys the given ShaderMaterial and releases its GPU resources. More...
 
nil destroy (ids: integer[])
 Destroys all materials in the list and releases their GPU resources. More...
 

Member Function Documentation

StandardMaterial create_standard ( )

Creates and returns a new StandardMaterial with default PBR values.

Returns
StandardMaterial
ShaderMaterial create_shader ( string  frag,
string  vert,
integer  param_count,
integer  stage)

Creates a ShaderMaterial with custom frag/vert shaders, parameter count, and pipeline stage.

Parameters
fragstring
vertstring
param_countinteger
stageinteger
Returns
ShaderMaterial
ShaderMaterial create_shader ( string  frag,
string  vert,
integer  param_count)

Creates a ShaderMaterial with custom frag/vert shaders and parameter count (default stage).

Parameters
fragstring
vertstring
param_countinteger
Returns
ShaderMaterial
ShaderMaterial create_shader ( string  frag,
integer  param_count,
integer  stage)

Creates a ShaderMaterial with a fragment shader, parameter count, and pipeline stage (default vert shader).

Parameters
fragstring
param_countinteger
stageinteger
Returns
ShaderMaterial
ShaderMaterial create_shader ( string  frag,
integer  param_count)

Creates a ShaderMaterial with a fragment shader and parameter count (default vert shader and stage).

Parameters
fragstring
param_countinteger
Returns
ShaderMaterial
ShaderMaterial create_shader ( string  frag)

Creates a ShaderMaterial with only a fragment shader (default vert shader, parameter count, and stage).

Parameters
fragstring
Returns
ShaderMaterial
Material get ( integer  id)

Returns the material with the given id.

Parameters
idinteger
Returns
Material
nil upload_parameters ( ShaderMaterial  mat)

Schedules an upload of the parameters SSBO block for the given ShaderMaterial to the GPU.

Parameters
matShaderMaterial
nil destroy ( integer  id)

Destroys the material with the given id and releases its GPU resources.

Parameters
idinteger
nil destroy ( StandardMaterial  mat)

Destroys the given StandardMaterial and releases its GPU resources.

Parameters
matStandardMaterial
nil destroy ( ShaderMaterial  mat)

Destroys the given ShaderMaterial and releases its GPU resources.

Parameters
matShaderMaterial
nil destroy ( integer[]  ids)

Destroys all materials in the list and releases their GPU resources.

Parameters
idsinteger[]