I made this models with blender and ı plan sell them as game asset.
I baked some of PBR textures (Diffuse,Roughnes,Normal,Metalic,AO) I exported them as a .fbx file to be able to sell them as a unity file format too and transferred them to unity. Since I don’t have much knowledge about unity, I need your help here. What do you recommend me, which way should I follow?
You have to know a couple of things. For starters, you can’t import Blender materials directly into Unity. You can use all the textures you have baked, but there are some things you need to do to make them work correctly.
When you import an .fbx file, the materials will be embedded in the file and can’t be edited. Click on the file, go to the “Materials” tab of the Import settings and click “Extract Materials” to save them in the project folder. These will use the standard shader of the Render Pipeline you are using (there are three of them: Built-In, Universal (URP), and High Definition Render Pipeline (HDRP), and all have different shaders that are not compatible with other Pipelines, but more on that later). For the Built-In Pipeline, that shader is just called “Standard”, and “Lit” in the other Pipelines. Depending on your folder structure, this may already have some textures assigned, but others will have to be assigned manually.
- Diffuse: Is called “Albedo” in Built-In and “Base Map” in URP/HDRP. Is pretty straight-forward to use, unless there is no “Metallic” map, in which case you’ll want to put Roughness (or Smoothness, see below) in the alpha channel of the Albedo/Base Map (in Built-In and URP).
- Roughness: Unity uses Smoothness, which is just Roughness inverted. in Built-In and URP, it can either be in the Albedo/Base Map alpha channel, or the Metallic alpha channel. HDRP has a “Mask Map” that combines Metallic, Ambient Occlusion, Detail Mask, and Smoothness in its RGBA channels.
- Metallic: If there is a Metallic Map, put Smoothness in its alpha channel in Built-In and URP, in HDRP, put Metallic in the red channel of the Mask Map.
- Normal: Needs to be set as a Normal Map in the texture’s Import Settings (Texture Type). Unity uses OpenGL (Y+) Normal Maps, same as Blender, so you should be able to use it without issues.
- AO: Is a separate Map in Built-In and URP, and goes in the Green Channel of the Mask Map in HDRP.
I know this is all quite complicated, but it’s just the current state of things. Built-In is the oldest Render Pipeline and will no longer be supported from some point in the future. For Unity 6, the Universal RP is considered the “default” Render Pipeline, I believe. URP and HDRP are going to be merged into one at some point in the future. Until then, you either have to make your assets compatible with all three, or at least URP and HDRP. There is a “Wizard” to convert materials from one pipeline to another, but that can’t do everything, and won’t combine textures into a Mask Map for HDRP, at least not at far as I know. There are Unity Assets for combining textures, like this free one for example: Texture Channel Packer Pro | Utilities Tools | Unity Asset Store
I hope this was helpful to you. If you want to sell assets, you should become familiar with the various Render Pipelines and their shaders:
Unity - Manual: Materials and shaders
Unity - Manual: Render pipelines
High Definition Render Pipeline overview | High Definition RP | 17.0.3
First of all, thank you very much for taking the time to share your valuable information with me.
As you said, these are very confusing right now. I think it would be better if I ask the two main things I don’t understand:
-
I understood that the smoothness map is the opposite of the roughness map in Blender. How can I convert the roughness map to a smoothness map and in which channel should I place this smoothness map?
-
As you said, I cannot edit the material of the mesh I imported. Is it because I dragged and dropped the .fbx file?
-
I would also like to get your thoughts on the project files. Would it be better if all the materials were under the same object or should I open a separate material folder and move them there?
-
Yes, you don’t have much information about my project right now. Can you tell me what is missing in my project from these two photos I have shared so far?
Thank you for your support.
Use an image editor to invert the color of the texture. A free and pretty simple one is Paint.NET. Also the free asset Texture Channel Mixer can do it (It has a preset for it) - This is a different asset from the one in my previous post, that I just discovered.
As I wrote above: Click on the file, go to the “Materials” tab of the Import settings and click “Extract Materials” to save them in the project folder.
In my experience, it’s better if all the materials are in a separate folder, and most store assets I know do it like that.
You seem to have correctly assigned the textures, but I can’t tell if they all work correctly. The Metallic map looks mostly white, which would mean that most of the object is metallic, I don’t know if that’s your intention. I suppose you haven’t put the smoothness map in the alpha channel of the metallic map, yet, but the Smoothness value is basically a multiplier, and if no smoothness map is provided, it is treated like a completely white one, multiplied by the value. If you provide a smoothness map, you probably should set the value to 1. The “Source” dropdown allows you to choose if the Metallic or Albedo alpha channel should be used.
You are also using the Built-In Render Pipeline. As only one Render Pipeline can be used in a project, you’ll have to create additional projects for the Universal and High Definition Render Pipelines.
Thanks for your support
I inverted the roughness map with the programs which you share with me here, but where is the alpha channel. Do I need to do this via an image maniplation program?
And in a video I watched a person says "select autodesk interactive shader " to use rougness.Should ı do this?
Also, which one should I use when creating such an asset?
thanks
Ah yes, that can be a bit tricky, I suppose, and I don’t think it’s possible in Paint .NET without external plugins. However, it can be done with the Texture Channel Mixer Asset from my previous post:
- If you have a Metallic Map and a Roughness Map, and you want to use it as Smoothness, add both as references
- Connect The RGB channels of the Metallic Map with the RGB sockets
- Connect the red channel of the Roughness map to the alpha socket (the white one on the right) - NOT the alpha channel of the Roughness map, because it doesn’t have one, and the RGB channels are identical because it is grayscale.
- Now add a “1 - x” modifier to the alpha channel to invert it for smoothness
You can use that in the Built-In Render Pipeline, but not in the other ones. Also, it may use more memory because roughness is a separate texture compared to a single channel in one of the textures.
As I said, the Built-In Render Pipeline is the oldest one and will be deprecated in a future Unity version, possibly Unity 7. Universal 3D and High Definition 3D are the newer ones and you should probably support these two, if not all three of them, but that may also somewhat depend on the assets themselves. If they are intended for mobile games, for example, the Universal Render Pipeline is the most important to support. If they are high quality assets for PC and console games, HDRP should also be supported.
hank you very much for the valuable information you gave me and the time you spent.
I wish you a good day.