#Timeline for 2D?
1 messages · Page 1 of 1 (latest)
nope, it's not on the roadmap
There's a community made package called nsprite if you want a fully dots sprite renderer
Or you just use companion gameobjects
Thanks! What exactly is meant by companion gameobjects? Is there a quick guide on how they are setup? Do I have gameobjects which reference Entities and then a managed script that just copies position every frame from the entities to the gameobjects?
Will this be more or less performant than the NSprites approach?
it's more the other way around
you have an entity with a managed IComponentData which points to the connected gameobject
I imagine NSprite would be more performant
the issue i think is if you want a lighting system
since 2d lights won't affect them (pretty sure though i've never tried)
@upper salmon might be able to help out (NSprite creator)
Thanks so much for all the info! That's very helpful
Does unity actually plan to support 2D at some point. 3D is fully supported in DOTS already, right?
i'm very much a beginner when it comes to the lighting system
maybe, but atm its not on the roadmap
so probably not for a few years
Because it sounds like just using 2D gameobjects (only their drawing should be quite highly optimized already) and then copying once per frame should not be sooo terrible
typical Unity timeframes
haha
Still odd given that most people probably use Unity for 2D
But maybe gameobjects is enough for 2D since drawing performance is not such an issue
But I do understand it right that the default ECSsamples actually convert everything to entities when rendering 3D, there is no hidden companion gameobject trick happening?
Same for physics?
yeah, the samples will be using the entities graphics package
yup the entities physics package
So I could just use 3D physics for spacial queries etc., and hope the gameobjects will be performant enough, which they probably will
there's no 2d version for physics either
Hmm sad that 2D is so much behind, but still great that they are pushing the ECS stuff, its great fun
Thanks for all the help!
Hi @junior copper ! Hi @solid token , thank you for sharing!
- Hybrid approach is something comes in when you want to have unity ECS architecture and gameobject base part of implementation. Though it brings lots of problems which conflict with main idea of using DOTS and the main thing is - less performance. Every hybrid entity (except static ones) will access to gameobject's transform and copy the value. some time ago (maybe it is fixed for now, I don't know) those companion systems was designed horrible, like producing garbage every frame and make not optimised calculations, I've even fixed it a bit, when I was using hybrid approach a lot (entities version 0.17).
- Using NSprites of course gives you pure ECS approach of sprite rendering, and it is already more performant than using regular
SpriteRenderer. But it's not the most important thing in terms of performance. NSprites requires from you using instancing compatible shader, which brings lots of optimisation! Instancing isn't DOTS thing by itself, but you can render incredible instance count with instancing. You can try to render 1000 sprites with instancing (not necessarily using NSprites) and with regularSpriteRendererand see the difference. - Lightning system and other stuff can be implemented with NSprites. Again NSprites wants from you instancing compatible shader, that is all about compatible with any kind of rendering. If you want light for example with using URP / URP 2D you should see how light data comes to shaders and implement it with your own shader. You can face some difficulties because we deal with instancing and things can be made different.
This section is relative to any feature you want to implement. NSprites by itself is a very pure solution which just render instancing reading data from entities.
I'm slowly working on my 2D game and I want to bring light to it. I have Smart2DLightning package and I will adapt it to use with DOTS and NSprites, so in future I can share what can be done with lightning. - Overall I want to say again that NSprites is pure solution without any kind of built-in everything! There are also Age-of-Sprites (sample project using NSprites) and NSprites-Foundation (package which share my way of using NSprites). Using NSprites from scratch you will need to implement register system / instancing compatible shader / prepare material assets / implement any features you want like sorting / culling / animation / etc. Sounds difficult, but if you want to render thousands of sprites difficulties worth it
