You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Later version of unity now provide a method of associating secondary textures with a sprite atlas. This can be used for normal maps, emissive maps, or even arbitrarily named texture bindings in a Shader Graph. More info can be found here.
I'm interested in adding support for these to MetaSprite, but I have a few questions regarding how to best do so.
I think adding a @secondary("binding name") meta directive would be a good approach. Each of these layers could written as a separate texture asset and then associated with the main atlas as a secondary texture with the provided binding name.
A few questions though:
Would it be best to provide two directives @secondary("Name") and @secondary-target("Name", "binding name") similar to sub images so that multiple layers could be combined into one secondary atlas? Was that the motivation behind using two in the case of sub images (I don't use this feature)?
I imagine it would be necessary to support secondary textures on sub images as well. What would be a good syntax for this?
MetaSprite will need to write secondary textures as separate assets. I see that sub-images already require this functionality and that I should be able to reuse part of that atlas serialization code. Is this correct? The sprite packing in the secondary texture needs to be exactly the same as the primary atlas. Is that possible?
Finally, thanks for the great importer!
The text was updated successfully, but these errors were encountered:
Hi, sorry for the delayed replay. I forgot to check GitHub past few months 😿
If we define main image / sub image created using @sub and @subTarget as image, then each image can have multiple secondary textures. It seems that the appropriate syntax can be:
in which image name denotes sub image target, secondary texture name denotes the following 'Name' setting:
I don't see the need for two meta directives.
There should be a special value for image name to denote the main image. Maybe something like "_main"?
Above answers question 1 and 2. For question 3: Yes atlas generator code is reused now in creating main and sub images. To support this functionality, atlas info for one image will be reused for subsequent generation of secondary texture, which is another problem to tackle.
I wonder if you have investigated further on the feature and do you still need it? I may find some time to implement it myself, or give you necessary assistance if you want to do it yourself.
Later version of unity now provide a method of associating secondary textures with a sprite atlas. This can be used for normal maps, emissive maps, or even arbitrarily named texture bindings in a Shader Graph. More info can be found here.
I'm interested in adding support for these to MetaSprite, but I have a few questions regarding how to best do so.
I think adding a @secondary("binding name") meta directive would be a good approach. Each of these layers could written as a separate texture asset and then associated with the main atlas as a secondary texture with the provided binding name.
A few questions though:
Finally, thanks for the great importer!
The text was updated successfully, but these errors were encountered: