class FoxMaterial
package foxlite.material
Static variables
static__GLOBAL_ID:Int = 0x69
Global ID to keep track of FoxMaterials, increments when a new one is created
Static methods
staticcreate(shader:FoxShader, ?textures:Map<String, FoxTexture>, ?params:Map<String, Dynamic>):FoxMaterial
staticinlinecreateCustom(shaderPath:String, ?shaderFlags:Array<String>, ?textures:Map<String, FoxTexture>, ?params:Map<String, Dynamic>):FoxMaterial
Short and more straightforward version of create()
staticinlinecreateBasic(?shaderFlags:Array<String>, ?textures:Map<String, FoxTexture>, ?params:Map<String, Dynamic>):FoxMaterial
Creates a material with foxlite's basic ubershader by default
staticinlinecreateMinimal(?shaderFlags:Array<String>, ?textures:Map<String, FoxTexture>, ?params:Map<String, Dynamic>):FoxMaterial
Creates a material with foxlite's minimal shader by default
The minimal shader handles very basic 3D rendering, and does not have any lights
staticinlinecreateSky(texture:FoxTexture):FoxMaterial
Creates a material with foxlite's sky shader by default
staticcreateSkyCustom(shaderPath:String, texture:FoxTexture, ?params:Map<String, Dynamic>):FoxMaterial
Creates a material with a custom sky shader, this also accepts custom shader parameters
staticcreateLine(?shaderFlags:Array<String>, thickness:Float = 1):FoxMaterial
Creates a line material using foxlite's minimal shader
staticcreateLineShaded(?shaderFlags:Array<String>, thickness:Float = 1):FoxMaterial
Creates a line material using foxlite's basic shader. This material can recieve lights and shadows, aswell as having reflections and custom vertex transforms
staticcreateLineCustom(shaderPath:String, ?shaderFlags:Array<String>, thickness:Float = 1):FoxMaterial
Creates a line material using a custom shader
staticfromJSON(name:String):Any
Loads a material from a Foxlite's custom JSON format
Returns:
A Map containing material entries from the JSON, or a single FoxMaterial if specified with "path/to/mat:<material name>"
staticfromMTL(name:String):Any
Loads a material from a MTL file
Returns:
A Map containing material entries from the MTL, or a single FoxMaterial if specified with "path/to/mat:<material name>"
Constructor
Variables
__tid:String = ""
A sortable identifier for the BalancedTree draw list.
Cached for speed, do not modify.
renderPriority:Int = 0
This controls the rendering order of materials.
Lower priority means the model will be rendered before other models.
renderMode:Int = 0x0004
The render mode of this material, switches between GL.TRIANGLES and GL.LINES.
To render models in wireframe mode, use the later.
Methods
setColor(color:FlxColor):FoxMaterial
Sets the material tint color, acts like colorMultipliers
Returns:
the current material, useful for chaining calls, if you're into that
setEmissiveColor(emissive:FlxColor):FoxMaterial
Sets the material emissive color, this is the light emitted from the model, acts like colorOffsets
Returns:
the current material, useful for chaining calls, if you're into that
setRoughness(roughness:Float = 0):FoxMaterial
Sets the material roughness factor, this controls how blurry the reflections are
setMetallic(metallic:Float = 0):FoxMaterial
Sets the material metallic factor, this controls how reflective it is
setScattering(scattering:Float = 0):FoxMaterial
Sets the material subsurface-scattering factor, this controls how much light passes trough it
setSpecularLevels(red:Float = 0, green:Float = 0, blue:Float = 0):FoxMaterial
Sets the material specular levels, this controls how strongly light bounces off it. It can "reflect" a custom color
pushShaderUniforms(passShader:FoxShader):Void
Uploads uniform data to the shader when this material is active.