All Projects → fabriziospadaro → Spritesheetrenderer

fabriziospadaro / Spritesheetrenderer

Licence: other
A powerful Unity ECS system to render massive numbers of animated sprites.

Labels

Projects that are alternatives of or similar to Spritesheetrenderer

Squashandstretch
A Unity 2018.10b12 project where I am experimenting with a squash and stretch shader.
Stars: ✭ 160 (-21.57%)
Mutual labels:  shaderlab
Shaders
A collection of shaders written in CG/ShaderLab for Unity.
Stars: ✭ 173 (-15.2%)
Mutual labels:  shaderlab
Outlined Diffuse Shader Fixed
This is a fixed version of diffused outline shader from http://wiki.unity3d.com/index.php/Outlined_Diffuse_3
Stars: ✭ 194 (-4.9%)
Mutual labels:  shaderlab
Unity Plugin
收集的Unity3D插件以及资源、粒子等,欢迎Star
Stars: ✭ 159 (-22.06%)
Mutual labels:  shaderlab
Nvjob Water Shader Simple And Fast
#NVJOB Simple Water Shaders. Free Unity Asset.
Stars: ✭ 172 (-15.69%)
Mutual labels:  shaderlab
Isaura
An attempt at making a aura thingie with a isoline shader.
Stars: ✭ 187 (-8.33%)
Mutual labels:  shaderlab
Spriteoutlinefx
Outline image effect for 2D sprites.
Stars: ✭ 154 (-24.51%)
Mutual labels:  shaderlab
Unity Shaders
✨ Shader demo - More than 300 examples
Stars: ✭ 198 (-2.94%)
Mutual labels:  shaderlab
Unity Dithered Transparency Shader
Unity material and shader for applying clipped, dithered transparency
Stars: ✭ 174 (-14.71%)
Mutual labels:  shaderlab
Unitywatersurface
Water Surface Simulation using CutomRenderTexture in Unity 2017.1
Stars: ✭ 190 (-6.86%)
Mutual labels:  shaderlab
Xiexes Unity Shaders
A re-write and restructure of XSToon.
Stars: ✭ 171 (-16.18%)
Mutual labels:  shaderlab
Threedscans
Scanned statue models from the Three D Scans project, optimized for real-time rendering use.
Stars: ✭ 172 (-15.69%)
Mutual labels:  shaderlab
Rtltmpro
Right-To-Left Text Mesh Pro for Unity. This plugin adds support for Persian and Arabic languages to TextMeshPro.
Stars: ✭ 187 (-8.33%)
Mutual labels:  shaderlab
Stylized Water
A stylized water shader (and material presets) for Unity.
Stars: ✭ 162 (-20.59%)
Mutual labels:  shaderlab
Unity Ecs Job System Sph
Implementation of the SPH Algorithm (fluid simulation) in Unity, comparing singlethread and ECS/Job System performances.
Stars: ✭ 197 (-3.43%)
Mutual labels:  shaderlab
Lowpolyshaders
Unity shaders optimized for Low Poly models.
Stars: ✭ 157 (-23.04%)
Mutual labels:  shaderlab
Videolabtest
OP-Z videolab examples
Stars: ✭ 186 (-8.82%)
Mutual labels:  shaderlab
Amplifyshadercommunityextras
Community made extras for Amplify Shader Editor
Stars: ✭ 201 (-1.47%)
Mutual labels:  shaderlab
Ssgi Urp
Screen Space Global Illumination for Unity Universal Render Pipeline
Stars: ✭ 198 (-2.94%)
Mutual labels:  shaderlab
Awesome Unity Shader
⛵ 关于炫酷的Unity3D Shader | About Cool Unity3D Shaders
Stars: ✭ 2,658 (+1202.94%)
Mutual labels:  shaderlab

SpriteSheetRenderer

A powerful Unity ECS system to render massive numbers of animated sprites using DynamicBuffers and ComputeBuffer:

1 million animated sprites were rendered at 60fps on a Mid-2015 MacBook Pro.

N|Solid

C# 4 required

How to use (SINGLE INSTANTIATE):

  • 1- Create the Archetype:
EntityArchetype archetype = eManager.CreateArchetype(
    typeof(Position2D),
    typeof(Rotation2D),
    typeof(Scale),
    //required params
    typeof(SpriteIndex),
    typeof(SpriteSheetAnimation),
    typeof(SpriteSheetMaterial),
    typeof(SpriteSheetColor),
    typeof(SpriteMatrix),
    typeof(BufferHook)
);
  • 2- Record and bake this spritesheet(only once)
SpriteSheetManager.RecordSpriteSheet(sprites, "emoji");
  • 3- Populate components
List<IComponentData> components = new List<IComponentData> {
    new Position2D { Value = float2.zero },
    new Scale { Value = 15 },
    new SpriteIndex { Value = UnityEngine.Random.Range(0, maxSprites) },
    new SpriteSheetAnimation { maxSprites = maxSprites, play = true, repetition = SpriteSheetAnimation.RepetitionType.Loop, samples = 10 },
    new SpriteSheetColor { color = new float4(color.r, color.g, color.b, color.a) }
};
  • 4- Instantiate the entity
Entity e = SpriteSheetManager.Instantiate(archetype, components, "emoji");
  • Update the entity
Entity e = SpriteSheetManager.UpdateEntity(e, new Position2D { Value = float2.zero});
  • Destroy the entity
Entity e = SpriteSheetManager.DestroyEntity(e, "emoji");

How to use (BULK INSTANTIATE):

  • 1- Create the Archetype:
EntityArchetype archetype = eManager.CreateArchetype(
    typeof(Position2D),
    typeof(Rotation2D),
    typeof(Scale),
    //required params
    typeof(SpriteIndex),
    typeof(SpriteSheetAnimation),
    typeof(SpriteSheetMaterial),
    typeof(SpriteSheetColor),
    typeof(SpriteMatrix),
    typeof(BufferHook)
);
  • 2- Bulk instantiate entities
NativeArray<Entity> entities = new NativeArray<Entity>(spriteCount, Allocator.Temp);
eManager.CreateEntity(archetype, entities);
  • 2- Record and bake this spritesheet(only once)
SpriteSheetManager.RecordSpriteSheet(sprites, "emoji");
  • 3- Populate components
for(int i = 0; i < entities.Length; i++) {
  Entity e = entities[i];
  eManager.SetComponentData(e, new SpriteIndex { Value = 0});
  eManager.SetComponentData(e, new Scale { Value = 10 });
  eManager.SetComponentData(e, new Position2D { Value = RANDOM_VECTOR });
  eManager.SetComponentData(e, new SpriteSheetAnimation { maxSprites = MAX_SPRITES, play = true, repetition = SpriteSheetAnimation.RepetitionType.Loop, samples = 10 });
  SpriteSheetColor col = new SpriteSheetColor { color = A_COLOR };
  eManager.SetComponentData(e, col);
  eManager.SetComponentData(e, new BufferHook { bufferID = i, bufferEnityID = DynamicBufferManager.GetEntityBufferID(material) });
  eManager.SetSharedComponentData(e, material);
}

Support

SpriteSheetRenderer is an open-source project that I am developing in my free time. If you like it you can support me by donating.

Buy Me A Coffee: https://www.buymeacoffee.com/LRTk8rn

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].