Search Unity

Trying to make first prefab asset - how to go from Painter to Unity?

Discussion in 'Getting Started' started by johnyelland1234, Nov 26, 2018.

  1. johnyelland1234

    johnyelland1234

    Joined:
    Oct 20, 2017
    Posts:
    8
    Hello, I'm new to the forum, but not new to Unity. Still I am a noob really. I want to eventually make my own game, and some mostly free assets for the the game and store.

    I've just got a new laptop and bought Substance Painter on Steam. I created a hi-res model in blender and exported it as a .obj and .fbx. I UV unwrapped them before this.

    I imported the FBX file into painter and painted it. Just a simple 205ltr drum:



    Now, I followed the Unity video tutorial and exported from Painter with Unity 5 presets, got the following files:



    Now the question is, how do I now compile these files into a prefab so that the drum/asset can be added to Unity as an asset and then dragged and dropped into its scene?

    I've done a search on this forum, and Youtube. It'd be awesome if there was a program where you just add the files and click 'go'.

    If I try to add the .obj to my scene, it's the right size, but theres no tetures on it. If I add the .fbx, it's huge with no textures on it.

    Any help? :)
     
  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Models in games are made up of two different parts:

    The Mesh contains the vertices that make up the structure. It also contains the UV Map indicating how those 3D points map to a 2D plane. This is generally an FBX or OBJ file.

    The Texture indicates how the triangles of a mesh's UV map should be displayed on screen. Usually a PNG or JPG. There are a lot of different types of texture files, and the engine uses them all differently.
    • The Albedo texture is your normal color information.
    • The Metallic/Specular texture represents how reflective a surface is.
    • The Smoothness texture would represent how much distortion/noise is applied to that reflection (I think... not totally clear on this one, to be honest)
    • The Normal map indicates depth and fine detail angles, to simulate complex geometry at a small scale for the purposes of lighting.
    When you bring in your OBJ or FBX, it won't have any textures applied to it (unless the textures are embedded in the OBJ, I think... but I always use FBX). Inspect the object's material and assign the appropriate texture to each slot in the shader.
     
  3. johnyelland1234

    johnyelland1234

    Joined:
    Oct 20, 2017
    Posts:
    8
    Thanks for that.

    Well, the FBX file has the no name texture. I've placed it in my scene and imported all of the above files.

    Unfortunately, I don't see how I can change the No name texture using the files I have. I can't even re-name it which is what most people do when they mess with it.

    If I go to create a new material though, I can do all this and then drag it onto my asset.

    Problem is, is that there are two parts. The drum, and the cap.

    The drum actually looks pretty good, but the cap has the same no name texture. I notice in Painter that there's only one item/texture set.

    I think I may have screwed up.

    I'm gonna make something else and see if it improves.
     
  4. johnyelland1234

    johnyelland1234

    Joined:
    Oct 20, 2017
    Posts:
    8
    so heres the scene with my drum and my new asset, a 5ltr fuel can. Just a quicky.




    First thing is that the size is quite big, is it normal for assets to need to be rescaled when put into a scene? As you can see, the drum is fine (scaled down to .5) and the 5ltr green can is massive (unscaled).

    Also, you can see what I mean with the caps not being textured but everything else is. Essentially, both of these assets consist of two meshes that were saved together as a .fbx and then painted together in substance painter.

    What am I doing wrong?
     
  5. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    This is no way to learn man. There is a thousand and one tutorials that will walk you through these basics step by step. You don't have to stumble in the dark like this.

    Exhaust all of the free learning content first. You'll save a lot of time. Remember, you are a human. Generational knowledge is the reason we train the dogs, and not the other way around.
     
  6. johnyelland1234

    johnyelland1234

    Joined:
    Oct 20, 2017
    Posts:
    8
  7. johnyelland1234

    johnyelland1234

    Joined:
    Oct 20, 2017
    Posts:
    8
    Oh actually I did get another udemy course a while back. I'll have a go at that.
     
  8. johnyelland1234

    johnyelland1234

    Joined:
    Oct 20, 2017
    Posts:
    8
    So I've done 3 jerry cans. Same mesh, just different textures:


    They look ok. The size is correct and I've added a collision box around them.

    I created the materials, added the mesh to the scene and applied the material and collision box. Then I dragged the finished asset back to my Project Assets in it's own folder etc.

    I'm planning on making quite a few container type assets. Ammo boxes, shipping containers, drums, boxes etc.

    Only issue with these is that the low poly mesh and the high poly have seemed to melded together in the mapping. Its a low poly mesh, but you can see where the high poly mesh corners were. I'll watch for it next time.

    Any tips on making these types of containers? Should I make open/close animations for them?
     
  9. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    first things first, you need to be able to reliably get exactly what you need into the engine and know what it is. You need certainty, otherwise when things screw up later, what are you going to do?

    So take a tactical pause from the overall "every aspect of making a game course" in order to dive a little deeper into asset creation. Specifically, find some tutorials that cover import/export between your specific software and the engine. One tutorial won't be enough -- do all of them. Everything you can find. Then practice on your own until that magic moment when you understand, and you can test new scenarios, predict the results, and then you know that you know.

    Take your time. YOu are investing in your future self.