12.5 C
New York
Sunday, October 26, 2025

textures – Can PNG format be used for alpha channel-packing for URP shader in Unity engine?


Be aware: I intend to make use of solely the Inspector window to make use of all textures, not Shader Graph or Nodes or any customized scripts. Additionally I’d use some technical phrases incorrectly by mistake, as I am not a lot skilled in it, however I would attempt my finest to clarify points.


I’ve realized that URP does not have a devoted possibility in Inspector to enter a Smoothness map (like base, top, regular maps and so on.).

However there’s a resolution for it – utilizing channel-packing. That is the one info I discovered in Unity docs however sadly it isn’t sufficient the right way to do it:

Within the Lit and Advanced Lit shaders within the Common Render Pipeline (URP), you should utilize a single RGBA texture for the metallic, smoothness, and occlusion properties. This method is known as channel packing or texture packing.

Assign the feel to the Metallic and Occlusion properties of the fabric. Unity robotically makes use of the proper channels from the feel.

So principally you want smoothness greyscale picture for alpha channel of RGBA texture.

Now, there’s not a lot clear details about the right way to correctly create it and what format to export in. Possibly it is simpler to do in Photoshop however I solely use Affinity Photograph and GIMP.

I watched many tutorials, and most of them appear to export the channel-packed texture as PNG picture. However on numerous forumns, I discovered that PNG format has situation when “storing” greyscale texture in alpha channel, once you do it with some photograph enhancing apps like Affinity Photograph or GIMP. It messes up with RGB channels the place there may be pure black in alpha channel. Additionally, clearly, the ultimate PNG appears to some areas of transparency due to alpha.

This reply additionally appear to counsel PNG is not going to work when utilizing Photoshop. Additionally, there are two solutions associated to GIMP too, however they did not appear to unravel situation once I exported them in PNG. One among them (compose-decompose associated) had similar downside of shedding RGB particulars wherever there was full black in alpha channel. Once more, it exported a picture with some transparecy. The opposite reply I could not actually use for my wants. It was not clear to me. They do not specify any particular export format. They possible intend to make use of solely PNG.

Which leads me to ask: Is this sort of channel-packing with transparency would work as meant in URP shader for metallic, smoothness and occlusion?

I additional discovered on a Reddit submit that you just do not truly use PNG format for this sort of channel packing. You utilize TGA format as that “correctly” shops alpha channel.

Seeing this combined info, it made me solely confused. I am unsure the right way to proceed.

I could not actually discover any good supply the place alpha channel packing and picture codecs are mentioned for GIMP and Affinity Photograph. Affinity appears worst for this function.

Given all that, is it truly attainable to export it appropriately and use it in PNG format (particularly in GIMP)? Or I have to use one other format like TGA?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles