Iām liking the look of the true alpha masking and runtime alteration of that smart sprite. Wasnāt sure if smart sprite would ever be valauble in a procedural context, but this certainly would move it in that direction. I hope at least some of these features make their way into 5.2.
I have a question on masking in alpha mode. How is it implemented under the hood: do you use stencil buffer or do you project mask sprite on the maskable sprites (altering their secondary UVs)?
Thanks for the info! Is it correct that as long as masking is done using stencils - it is 1bit masking (a pixel is either masked or not masked, no smooth transitions)?
And another related question: if I understand correctly - while Mesh Filters may instantiate a copy of Mesh (when that property is queried), Sprite Renderers that were assigned a same Sprite always use a single shared Sprite instance. The question is - do you have any plans about exposing functionality of instantiating Sprite meshes and exposing their internals (uv2, uv3, etc.)?
Is it correct that as long as masking is done using stencils - it is 1bit masking (a pixel is either masked or not masked, no smooth transitions)?
Yes.
For the second part of your question, if you are interested in the meshes generated for a sprite, does this help you?
Yes, Iāve made a quick test and looks like it is a valid approach to use those Sprite properties to re-create a mesh of some sprite and render it via MeshRenderer. It is just a bit inconvenient to use SpriteRenderers for the regular sprites and MeshRenderers for sprites being rendered with advanced shaders.
I guess youāre interested in keeping SpriteRenderer simple (and it is good). But maybe you could consider adding (in some future Unity version) some kind of AdvancedSpriteRenderer with more internals exposed, but that can still be dynamically batched with regular SpriteRenderers when possible.
Thatās not a dumb question. Actually, doing that is pretty complicated at the moment. Your best bet is to open one of the samples and look for the objects with the brushes script on them and then try to replicate what they did! I havenāt done it myself yet, soā¦
Checking out the samples would be a fast way to start! This would be the latest version.
There are two things you need to make to create a new brush, the brush painting script and the brush asset. The brush painting script contains the logic to paint and erase tiles, while the brush asset contains customised information for painting specific sprites.
To create the brush painting script, you will need to extend from the GridBrush class, overriding the Paint, Erase and GetPreviewSprite functions. You will also need to have a way to create the brush asset/s itself; in the sample, we added a function CreateBrush to each brush painting script to create the brush asset. Anytime a brush asset is created, the Tilemap Palette will pick it up and make it available for selection.
For normal sprites, all textures with sprites should appear in the drop-down menu in the Tilemap Palette. You can switch between the sprite textures by selecting the texture name in the drop-down menu.
Hi, does the Particle 2D Collision already support OnParticleCollision() calls? If not, is it planned in the future to add this support?
Thanks, much appreciated and Iām really excited to see significant improvements to 2D tools
UPDATE: I ticked the āSend Collision Messagesā Box but it didnāt seem to do anything. Maybe a bug, maybe intended? Can anyone confirm that this does not work?
Hi, Paul! New features are amazing!
I saw new Component āBatched Sprite Rendererā at the demo video.
Is it a native component of engine or a high level component(like c# Script)? Does it work like Sprite Render but with manual control of the mesh from code?
Iām wondering if the tilemap could be used for many more things than the terrain of the gameworld. Say if you make a top-down game, could you use a separate layer above the terrain as fog of war for example. Or in a turn-based tactics game, you could highlight tiles with an overlay to indicate on which tiles one of your units could move to on your turn. Iām wondering if those could be possible uses for this tool. It is possible to edit the tiles at runtime trough scripting, right?
Looks great. Would love to test it. Are there non-pro early releases? Iād make direct use of the tilemap in the title Iām working on. Pro is still too rich for my poor blood. I canāt pay $75 to give you feedback, sorry.
Can you support scaling for the edge 9-slice sprites (maybe future ffd) as to break the monotone frow of the surface, to have wavy irregular surface for example (with free form deformation or local vertical scale).
Also can you choose the sprites when you change them (in multiple edge sprites) or are they random? thanks.