{"id":13676322,"url":"https://github.com/fabriziospadaro/SpriteSheetRenderer","last_synced_at":"2025-04-29T06:31:44.392Z","repository":{"id":42425231,"uuid":"192357787","full_name":"fabriziospadaro/SpriteSheetRenderer","owner":"fabriziospadaro","description":"Spritesheet renderer is a powerful Unity ECS API to render massive numbers of sprites using the new dots stack, taking full advantage of Jobs, DynamicBuffers and ComputeBuffer","archived":false,"fork":false,"pushed_at":"2023-01-08T19:02:30.000Z","size":1885,"stargazers_count":383,"open_issues_count":4,"forks_count":47,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-11-11T18:41:02.435Z","etag":null,"topics":["ecs","entity-component-system","unity","unity-dots","unity2d"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/in/fabrizio-spadaro/","language":"ShaderLab","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabriziospadaro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-17T14:00:18.000Z","updated_at":"2024-11-04T03:20:16.000Z","dependencies_parsed_at":"2023-02-08T07:16:01.448Z","dependency_job_id":null,"html_url":"https://github.com/fabriziospadaro/SpriteSheetRenderer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabriziospadaro%2FSpriteSheetRenderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabriziospadaro%2FSpriteSheetRenderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabriziospadaro%2FSpriteSheetRenderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabriziospadaro%2FSpriteSheetRenderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabriziospadaro","download_url":"https://codeload.github.com/fabriziospadaro/SpriteSheetRenderer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251450656,"owners_count":21591407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecs","entity-component-system","unity","unity-dots","unity2d"],"created_at":"2024-08-02T13:00:22.799Z","updated_at":"2025-04-29T06:31:39.380Z","avatar_url":"https://github.com/fabriziospadaro.png","language":"ShaderLab","funding_links":["https://www.buymeacoffee.com/LRTk8rn"],"categories":["Game-Design-Tool","Open Source Repositories","ShaderLab","ECS","Open Source Packages"],"sub_categories":["DOTS"],"readme":"## Support\nSpriteSheetRenderer is an open-source project that I am developing in my free time. If you like it you can support me by donations.\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/LRTk8rn\n)\n\n# SpriteSheetRenderer (updated to unity 2020.3 and entitas V0.17.0)\nA powerful Unity ECS api to render massive numbers of animated sprites using the new dots stack, taking full advantages of Jobs, DynamicBuffers and ComputeBuffer:\n##### 1 million animated sprites were rendered at 60fps(none of them was hurt during the process) on a Mid-2015 MacBook Pro.\n![N|Solid](https://forum.unity.com/proxy.php?image=https%3A%2F%2Fi.imgur.com%2FzRSWhy0.png\u0026hash=754bc4b4187e2d72ce0eb2c578b996dc)\n## C# 4 required\n\n### How to use (SINGLE INSTANTIATE):\n* 1- Create the Archetype:\n\n```sh\nEntityArchetype archetype = eManager.CreateArchetype(\n    typeof(Position2D),\n    typeof(Rotation2D),\n    typeof(Scale),\n    //required params\n    typeof(SpriteIndex),\n    typeof(SpriteSheetAnimation),\n    typeof(SpriteSheetMaterial),\n    typeof(SpriteSheetColor),\n    typeof(SpriteMatrix),\n    typeof(BufferHook)\n);\n```\n\n* 2- Record and bake this spritesheet(only once)\n\n```sh\nSpriteSheetManager.RecordSpriteSheet(sprites, \"emoji\");\n```\n* 3- Populate components\n\n```sh\nList\u003cIComponentData\u003e components = new List\u003cIComponentData\u003e {\n    new Position2D { Value = float2.zero },\n    new Scale { Value = 15 },\n    new SpriteIndex { Value = UnityEngine.Random.Range(0, maxSprites) },\n    new SpriteSheetAnimation { maxSprites = maxSprites, play = true, repetition = SpriteSheetAnimation.RepetitionType.Loop, samples = 10 },\n    new SpriteSheetColor { color = new float4(color.r, color.g, color.b, color.a) }\n};\n```\n\n* 4- Instantiate the entity\n\n```sh \nEntity e = SpriteSheetManager.Instantiate(archetype, components, \"emoji\");\n```\n \n* Update the entity\n\n```sh \nEntity e = SpriteSheetManager.UpdateEntity(e, new Position2D { Value = float2.zero});\n``` \n\n* Destroy the entity\n\n```sh \nEntity e = SpriteSheetManager.DestroyEntity(e, \"emoji\");\n``` \n\n### How to use (BULK INSTANTIATE):\n\n* 1- Create the Archetype:\n\n```sh\nEntityArchetype archetype = eManager.CreateArchetype(\n    typeof(Position2D),\n    typeof(Rotation2D),\n    typeof(Scale),\n    //required params\n    typeof(SpriteIndex),\n    typeof(SpriteSheetAnimation),\n    typeof(SpriteSheetMaterial),\n    typeof(SpriteSheetColor),\n    typeof(SpriteMatrix),\n    typeof(BufferHook)\n);\n```\n\n* 2- Bulk instantiate entities\n\n```sh\nNativeArray\u003cEntity\u003e entities = new NativeArray\u003cEntity\u003e(spriteCount, Allocator.Temp);\neManager.CreateEntity(archetype, entities);\n```\n\n* 2- Record and bake this spritesheet(only once)\n\n```sh\nSpriteSheetManager.RecordSpriteSheet(sprites, \"emoji\");\n```\n\n* 3- Populate components\n\n```sh\nfor(int i = 0; i \u003c entities.Length; i++) {\n  Entity e = entities[i];\n  eManager.SetComponentData(e, new SpriteIndex { Value = 0});\n  eManager.SetComponentData(e, new Scale { Value = 10 });\n  eManager.SetComponentData(e, new Position2D { Value = RANDOM_VECTOR });\n  eManager.SetComponentData(e, new SpriteSheetAnimation { maxSprites = MAX_SPRITES, play = true, repetition = SpriteSheetAnimation.RepetitionType.Loop, samples = 10 });\n  SpriteSheetColor col = new SpriteSheetColor { color = A_COLOR };\n  eManager.SetComponentData(e, col);\n  eManager.SetComponentData(e, new BufferHook { bufferID = i, bufferEnityID = DynamicBufferManager.GetEntityBufferID(material) });\n  eManager.SetSharedComponentData(e, material);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabriziospadaro%2FSpriteSheetRenderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabriziospadaro%2FSpriteSheetRenderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabriziospadaro%2FSpriteSheetRenderer/lists"}