Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity doesn't find Blender's Texture?

Discussion in 'Asset Importing & Exporting' started by KyleStank, Apr 18, 2016.

  1. KyleStank

    KyleStank

    Joined:
    Feb 9, 2014
    Posts:
    204
    Hello,

    So I am making a very very simple game. But I have ran into a problem. All of my level is UV mapped and everything, but only one of the textures show up in Unity. When I go to the Textured view in Blender, everything is UV Mapped and the textures show up fine. But in Unity, only one of the textures show up, and the one that doesn't is just a solid color. How do I fix this???
     
  2. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    It is my belief that the textures aren't being assigned automatically to the materials in Unity. This could be because they simply aren't in the place that Unity would expect them to be. Or it could be that Unity can't/won't assign more than one texture automatically. It appears that you indeed have multiple materials in Unity, as 1 has a texture and others to do not, so that isn't the problem. If I'm correct in my assumptions, assuming you have the textures in the asset folder handy, you should be able to directly assign them to the materials yourself, at which point they would work.

    As a long shot, in case you are running into a different issue....make sure that any textures you intend to use are available as images in the asset folder. I mention this because Blender let's you use procedural textures as part of the materials, but unless you bake and export those, you can't use them outside of Blender. They don't get exported as part of the model. I'm not sure if this is the kind of situation you have, but I wanted to mention the possibility.
     
  3. KyleStank

    KyleStank

    Joined:
    Feb 9, 2014
    Posts:
    204
    See, Unity already has assigned the textures in my materials. I would show a screenshot, but it says that the screenshot is too big to upload. But when I go to the material for my wall(which is the working texture), it shows the texture is assigned to the material. But when I go to the floor's material(the texture that isn't working), it also shows up that the texture is assigned. I have no idea what the problem is any more. I remember I ran into this issue before I took a break from Game Development, and I fixed it. But after I took like a month break, I have no idea what to do now ha ha. You have any other suggestions?
     
  4. KyleStank

    KyleStank

    Joined:
    Feb 9, 2014
    Posts:
    204
    Wtf. Now it is the opposite. Now the textures are shown when I reset the UV map. Except, the floor has the wall texture and the walls have the floor textures. WHAT IS HAPPENING??
     
  5. KyleStank

    KyleStank

    Joined:
    Feb 9, 2014
    Posts:
    204
    And now literally NOTHING is showing. Like my mesh is transparent. What the actual f*ck.
     
  6. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    Hmm, I'd have to see the project(and maybe the blend file). Those are some weird bugs. When is the last time you rebooted, reinstalled Unity, etc...? You probably already did it, but it doesn't hurt to ask.
     
  7. Birdao_Gwra

    Birdao_Gwra

    Joined:
    Oct 23, 2012
    Posts:
    29
    Use GLSL mode in blender while texturing. Make sure your texture path in Blender starts with "//".
     
  8. KyleStank

    KyleStank

    Joined:
    Feb 9, 2014
    Posts:
    204
    Here is my Unity Project:
    https://onedrive.live.com/redir?resid=6BD663803898F16!43568&authkey=!AErSmhNnHZlC2kQ&ithint=folder,

    To download the entire folder just right click and press "Download."
    The Blend file is also inside of there. Its under the "Models/Level 1" folder.

    I got the texture path set to "//". But what is GLSL mode?

    EDIT:
    My mesh isn't transparent anymore, but the texture problem is still here. Like some textures show inside of Unity, just not at the right place.
     
  9. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    I think I have things figured out. When you are viewing textures etc... in Blender, then sometimes, in the 3d view(but not in an actual render, which is irrelevant since we are using this for Unity), you can select a texture while you are working the UVs, and it will show it in the 3d viewport, but this doesn't mean that it is actually being used. When I look at the properties tab of your object in Blender, under the materials tab, I see ZERO materials. You need to create 2 materials, one for the wall, and one for the floor. Then you need to select the floor vertices, and assign them to the floor material. And then do the same for the walls onto the wall material. Then, when it gets imported to Unity, it will come included with 2 materials. Those materials may or not have the proper textures. I see the two textures in your assets folder, so you should be able to drag them onto the materials, and then when you have the model in your scene, it should automatically use those materials.

    Another thing, if you wanted to save draw calls, you could combine textures for this whole model into a single texture, and then map your UVs out that way.

    About the GLSL mode, it is referring to the drawing mode of the 3d view. If you have the 3d view in focus, you can hit the 'N' key, and it opens up the tool bar on the right side. In the "Shading" section, select GLSL. I believe the reason this is mentioned is that in your file, you see nothing but black. I also believe that this shader mode avoids the whole bit I was mentioning above, where you could temporarily see the texture applying to your model when it wasn't actually part of it, whereas the default shading mode would allow that.
     
    KyleStank likes this.
  10. Birdao_Gwra

    Birdao_Gwra

    Joined:
    Oct 23, 2012
    Posts:
    29
    kburkhart84 is right. In GLSL mode you can see what textures are actually assigned to the mesh. But in Multitexture mode you can assign any texture to any face. Or you can hit P (Game mode) in the multitexture mode just to see what textures are assigned.
     
  11. KyleStank

    KyleStank

    Joined:
    Feb 9, 2014
    Posts:
    204
    Okay so I did switch to the GLSL Rendering, but all it did was turn everything black and I didn't know what I was doing wrong there lol. But, I did take your advice by creating materials and assigning them for the floor and walls. Now, this didn't automatically assign the textures in Unity for me, but it did let me drag and drop the textures onto my Level and now everything is exactly how I wanted.

    I really appreciate your help. It was such a simple fix lol. I knew it would be in the end but still. I am not a very good modeler/UV Mapper or just artist in general. I'm a programmer lol.

    But I have another question for you. How exactly would I go about creating one texture for the entire level? And how would I have to map the level for that to work? I am a UV mapping noob, and I don't quite understand what you mean by that lol.

    You also, thank you for helping me out. It is really appreciated.
     
  12. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    Now that you know how to correctly create materials, maybe you can assign the textures in Blender, and maybe they would then apply in Unity automatically, maybe not, but it may be worth a try.

    About creating a single texture, you just need to open up the textures in an image editor, and create a new image that you would copy/paste the two textures(or more) onto the single texture. Then, when you are in Blender, you only need one material. And you need to adjust your uvs so that they only cover that part of the texture, not the whole thing.

    I also notice you are using the "Standard" shader in Unity. If you are only going to be using these diffuse textures, I recommend you switch to one of the other shaders. The standard shader expects you to be adjusting for things like the metallic values, roughness, etc... and the diffuse texture you have is not necessarily going to be the same as the albedo would be(though it could be pretty much the same.) Now, if you learn(or already did) about the PBR shaders and implement them, that is great, but unless your materials have the exact same normals, roughness, and metallic values, just using the diffuse texture for albedo won't get the best results. The PBR workflow is more complicated, and the solutions to make it easier tend to cost some money. I use the Substance Suite, which includes Painter, which lets me paint directly on my models using whole PBR materials at once. I can make my own, or I can grab preset ones from somewhere like GameTextures.com. But if you are just starting out, I don't know how much budget you have, and how much you are willing to spend. This can all be done with no spending whatsoever, it just isn't as convenient.
     
    KyleStank likes this.
  13. Cygon4

    Cygon4

    Joined:
    Sep 17, 2012
    Posts:
    382
    If everything is black is GLSL, you need to add a light source. It doesn't come with its own default light source as multi texture does.

    Preferably add a directional light and rotate it a bit so it doesn't shine straight from above.

    If you want to be sure your materials are correct in Unity, set up a material for each texture and also keep the textures assigned to the mesh in the UV/Image editor panel in sync with the materials.
     
    KyleStank likes this.
  14. KyleStank

    KyleStank

    Joined:
    Feb 9, 2014
    Posts:
    204
    Thank you so much lol.

    Thanks for clarifying that man. I really appreciate your help the past few days.