Production Renderer
At the heart of Scissor2D functionality is the Dynamic Geometry Renderer. This is an Actor you place into your level that performs all the actual drawing of ScissorComponents. ScissorComponents (such as the SpriteComponent) send render commands to this renderer that allows it to later batch and layer sort the scene correctly.
Batching
Sprites (and other components) that share the same material, textures and layering requirements will be batched together into as few draw calls as possible before being sent to the actual Unreal Renderer for drawing. Here you can see a scene that has 2 sprite types but with a few instances of each in the scene. The profiler correctly shows only 2 draw calls being made. This scales to any number of sprite and material types.
Layering
All scissor components support ‘Sorting Layer’ and ‘Order in Layer’ variables for scene ordering. I am currently working on a Layer Manager that will give you a gui to setup layer names, visibility and selection locking for each layer.
External components to the plugin such as particle systems and in world ui can also be correctly layer sorted by placing a child ScissorLayerComponent onto the external component you need to sort. This notifies the renderer that something else is rendering here and allows it to take the external component into consideration when layer sorting.
I also want to look at Grouping functionality further down the road, but this is quite complicated to implement so has been moved to a later release.
Material Cache
To save the pain of setting up hundreds of dynamic materials for the sprites you want to use, the renderer has a Material Cache that will auto instance, cache and release them for you. You can used the supplied materials with the plugin or make custom ones as long as they meet the requirements described in the docs.
Dynamic Geometry Renderer
The renderer is designed to be a high performance dynamic geometry renderer that can accept render calls from a variety of component types. This means currently all scene rendering through the Scissor Renderer is in fact frame by frame dynamic geometry, which has been proven to be efficient for 2D work where vertex counts are relatively low, while most data is changing frame by frame.
The interface to the render is simple to use for any custom rendering your project may need.
Editor Selection
It has taken me a little time to get sprite selection working correctly. In the editor selection is calculated via a pixel perfect hitmap that components are rendered into. The issue was the ScissorRenderer is always rendering all the geometry, so would get selected over the component representing the item to be drawn. After some experimentation I have a work around that correctly selects the right Actor in the scene, but there is a down side to get this to work, batching must be turned off in the editor viewport, as when batched the geometry is rendered as one big chunk and I cannot find a way (currently) to assign actor hit proxies to subsections of the chunk.
Known Issues:
- No batching in editor to make selection work
- Needs real time viewport to render (battery drain)
- All materials must be translucent