All Projects → olokobayusuf → Compositor Api

olokobayusuf / Compositor Api

Licence: mit
Compositor is a lightweight utility API for compositing images quickly and efficiently in Unity.

Projects that are alternatives of or similar to Compositor Api

Unitynativescripting
Unity Scripting in C++
Stars: ✭ 844 (+9277.78%)
Mutual labels:  unity, unity-scripts
Modio Unity
Unity Plugin for integrating mod.io - a modding API for game developers
Stars: ✭ 53 (+488.89%)
Mutual labels:  api, unity
Unitysingleton
The best way to implement singleton pattern in Unity.
Stars: ✭ 185 (+1955.56%)
Mutual labels:  unity, unity-scripts
Qframework
Unity3D System Design Architecture
Stars: ✭ 2,326 (+25744.44%)
Mutual labels:  unity, unity-scripts
Savegamefree
Save Game Free is a free and simple but powerful solution for saving and loading game data in unity.
Stars: ✭ 279 (+3000%)
Mutual labels:  unity, unity-scripts
Unity resources
A list of resources and tutorials for those doing programming in Unity.
Stars: ✭ 170 (+1788.89%)
Mutual labels:  unity, unity-scripts
Apple Signin Unity
Unity plugin to support Sign In With Apple Id
Stars: ✭ 228 (+2433.33%)
Mutual labels:  unity, unity-scripts
Beatsabercustomavatars
Allows the use of custom player models for body presence in Beat Saber.
Stars: ✭ 137 (+1422.22%)
Mutual labels:  unity, unity-scripts
Eazy Sound Manager
Eazy Sound Manager is a simple Unity3D tool which aims to make sound and music management in games easier
Stars: ✭ 135 (+1400%)
Mutual labels:  api, unity
Simulator
A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Stars: ✭ 1,260 (+13900%)
Mutual labels:  api, unity
Unity Ui Examples
📚 A collection of UI examples for Unity.
Stars: ✭ 152 (+1588.89%)
Mutual labels:  unity, unity-scripts
Actors.unity
🚀Actors is a framework empowering developers to make better games faster on Unity.
Stars: ✭ 437 (+4755.56%)
Mutual labels:  unity, unity-scripts
Unity Curve Utils
A utility that can use 18 kinds of curve algorithm.
Stars: ✭ 151 (+1577.78%)
Mutual labels:  unity, unity-scripts
Nvjob Water Shader Simple And Fast
#NVJOB Simple Water Shaders. Free Unity Asset.
Stars: ✭ 172 (+1811.11%)
Mutual labels:  unity, unity-scripts
Metasprite
A fast, self-contained, highly customizable Aseprite-to-Unity importer.
Stars: ✭ 148 (+1544.44%)
Mutual labels:  unity, image-processing
Nativecollections
Native Collection Types for Unity
Stars: ✭ 213 (+2266.67%)
Mutual labels:  unity, unity-scripts
Infinity Square Space
Infinity Square/Space. The prototype of the game is open source. Unity Asset.
Stars: ✭ 122 (+1255.56%)
Mutual labels:  unity, unity-scripts
U.movin
Unity library for rendering After Effects shape animations
Stars: ✭ 122 (+1255.56%)
Mutual labels:  unity, unity-scripts
Uploadcare Php
PHP API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
Stars: ✭ 77 (+755.56%)
Mutual labels:  api, image-processing
Unity Script Collection
A maintained collection of useful & free unity scripts / library's / plugins and extensions
Stars: ✭ 3,640 (+40344.44%)
Mutual labels:  unity, unity-scripts

Compositor API

Compositor

Compositor is a lightweight utility API for compositing images quickly and efficiently in Unity. Download the unitypackage here.

ICompositor

Compositor treats images as layers. First, you create a compositor:

ICompositor compositor = new RenderCompositor();

Then you add layers:

// Add a layer with no offset, no rotation, and default size (1, 1)
compositor.AddLayer(new Layer(texture1, Vector2.zero, 0f, Vector2.one));
// Add a layer with an offset
compositor.AddLayer(new Layer(texture1, new Point(40, 70), 0f, Vector2.one));
// Add a layer, but free the layer texture immediately it has been composited
compositor.AddLayer(new Layer(texture1, Vector2.zero, 0f, Vector2.one, Layer.Release));
// Add a layer, and execute a callback once the layer has been composited // This is useful for texture resource management
compositor.AddLayer(new Layer(texture1, Vector2.zero, 0f, Vector2.one, layerTexture => OnCompositeLayer(layerTexture)));

Then composite, providing a callback to be invoked with the resulting texture:

compositor.Composite(OnComposite);

void OnComposite (Texture2D result) {
    // Display it on a material
    material.mainTexture = result;
}

Finally, release the compositor's resources:

compositor.Dispose();

Compositors implement the IDisposable interface, so you can use it in a using block:

using (var compositor = new RenderCompositor()) {
    // Add layers...
    compositor.Composite(OnComposite);
} // The compositor is automatically freed at the end of this block

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].