Constructor

new(width:Int, height:Int)

Variables

@:value(new StringMap())renderTargets:Map<String, FoxFramebuffer> = new StringMap()

Scene render targets. You can add multiple of them and use them in your passes / shaders.

@:value("default")output:String = "default"

Scene output target, this will be used as pixels for the sprite.

For it to take effect, see setOutputDisplay()

@:value(0)outputColorIndex:Int = 0

This is the color index for the colorBuffers render target. Must be set to 0 if MRTs are not supported.

For it to take effect, see setOutputDisplay()

@:value(new FoxGroup())foxGroup:FoxTypedGroup<FoxBasic> = new FoxGroup()

A FoxGroup containing all of foxlite's active objects (including other groups)

@:value([])foxCameras:Array<FoxCamera> = []

An array containing FoxCameras, this is intended to be used globally

@:value(new FoxEnvironment())environment:FoxEnvironment = new FoxEnvironment()

The scene environment.

This is just a holder object for global environment variables, such as sky textures. Note: Subject to change in the future.

@:value([new BalancedTree()])drawGroups:Array<FoxDrawTree> = [new BalancedTree()]

An array of BalancedTree containing sorted FoxDrawTree for drawing. It is calculated per frame and processed per camera.

Draw groups consist of a collection of materials and meshes that can be drawn at once in a target. This target must exist on the scene as a FoxFramebuffer in the renderTargets map.

You can sort materials by priority for each group, but later groups will be draw called after previous ones.

Draw groups are meant to be used for post-processing, offscreen rendering and shadow passes. For example rendering a single mesh to a noise texture and then using that texture in the next group.

@:value(0)__width:Float = 0

@:value(0)__height:Float = 0

@:value(1.0)timeScale:Float = 1.0

context:Context3D

@:value(new FlxTypedSignalImpl())onFramebufferResized:FlxTypedSignalImpl<(width:Int, height:Int) ‑> Void> = new FlxTypedSignalImpl()

@:value(new FlxTypedSignalImpl())onPreDraw:FlxTypedSignalImpl<() ‑> Void> = new FlxTypedSignalImpl()

@:value(new FlxTypedSignalImpl())onPostDraw:FlxTypedSignalImpl<() ‑> Void> = new FlxTypedSignalImpl()

Methods

inlineadd(member:FoxBasic):FoxBasic

inlineinsert(pos:Int, member:FoxBasic):FoxBasic

@:value({ splice : true })inlineremove(member:FoxBasic, splice:Bool = true):FoxBasic

setupBuffers(width:Int, height:Int):Void

@:value({ colorIdx : 0 })setOutputDisplay(bufferName:String, colorIdx:Int = 0):Void

inlineaddDrawGroup():Int

Adds a draw group to the drawGroups list

Returns:

the new draw group index

buildDrawGroups():Array<FoxDrawTree>

Computes the draw groups indexed by materials.

Helps reducing draw calls and state switches, also makes sequential post-processing easier.

addToDrawGroups(material:FoxMaterial, mesh:FoxMesh, groups:Array<Int>, member:FoxModel):Void

Adds a material along with a mesh to be drawn by groups, providing a FoxObject for transforms.

If the material already exists in the group, the mesh is added to its draw tree instead.

Intended for internal use, make sure you know what you're doing if you're using this!