To transfer shader materials onto a texture to be used in Roblox, you have to bake the textures.
I’ll assume you know the basics of UV mapping and navigating around Blender, so here you go:
Quick note: some of the settings and options might look different on your version of blender, I’m using E-Cycles RTX 3.0 client, but your blender should have all the same options available.
So, first, make sure you are using CYCLES render engine. EEVEE and Workbench don’t support texture baking.
When you have finished your mesh, unwrap its UVs and make sure the UVs don’t overlap at all.
It takes more time to manually unwrap UVs on complex objects, but it’s worth the effort. Make sure your UVs fill as much free space on the image as possible to save detail.
You can find a lot of tutorials on UV unwrapping and how to do it well, so if you are interested, look it up. For now, I’m just going to be using a cube with a simple UV map and a material from Ducky 3D’s Real-time Material blender addon.
Now, go to the shader editor, add an empty image texture node, and create a new image in the resolution you want the texture to be in. Remember that Roblox compresses all (larger) images to 1024x1024px if I remember correctly, so baking to a larger resolution is useless if you are only going to use it in Roblox.
Don’t connect this image texture to any other nodes, just keep it as is.
Now, go to the render tab, find the bake drop down, chose what contributors you want to affect the baked texture (usually just diffuse) but decide what influencers you want, eg, a light source. This will just bake the light shining on the object directly onto the texture, so it will have a clear bright spot on it.
These are the bake settings I chose:
The output margin is set to 16 pixels because sometimes when you apply textures to objects in Roblox, the texture fades a bit as you get further away, and sometimes you can see some color on the edges of the UV islands.
This just prevents that from happening by extending the color at the edge of the island a few pixels outside of the UV island boundary.
When you are all set and all the settings are as you want them to be, select the object in the viewport and select the image texture node in the shader editor (select both at once), and hit bake.
Now you wait for it to bake!
Depending on the complexity of your material, it can be either really fast or really slow, but it’ll get there eventually.
For me, the result looks like this.
So now I would just select the mesh, duplicate it, remove the material on the duplicated mesh, make a new material with the base color being the texture we just baked, and see the results.
https://gyazo.com/8f43057affa78afc1813332ec48fcb01
If it looks well and good, then select the mesh, go to file > export > export as FBX
In the export settings, check “Selected objects” and change “Scale” to 0.01 to keep the scale of the object as it is in Blender. If you don’t need to change any other settings for what you are doing, don’t. After this, you can export it!
The texture will be packed together with the mesh.
Now in Roblox Studio go to view, open Asset Manager, and press the bulk import button to import the files.
Find the exported FBX file of your mesh, select and import it.
Uncheck all the boxes in the popup unless you know you need them enabled.
Now, you can right-click the mesh in the Asset Manager and import it as is or import with location. Usually with location. If you selected multiple parts when exporting, they all will be imported as separate objects which is really helpful.
You can select all the objects and insert them with location and they will be positioned correctly relative to each other.
And that’s it! It automatically uploaded the texture and applied it to the MeshPart. You should be good to go!
You might want to anchor the MeshPart as well, as by default it is unanchored.
I hope this helped. Good luck.