Search Unity

Material not showing on some objects

Discussion in 'General Graphics' started by Denisowator, May 21, 2017.

  1. Denisowator

    Denisowator

    Joined:
    Apr 22, 2014
    Posts:
    918
    So I just downloaded a seamless texture, slapped it on the "Albedo" of a new material, and applied it to a character model, but the whole thing is just a flat color, and doesn't actually show the texture.

    This doesn't happen with the Unity models (cube, sphere, cylinder, etc.), and the texture looks fine. It also works on some small parts of the character (head), but not on the bigger ones (torso).
     
    Chiefmastoras1 likes this.
  2. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    Some objects require multiple materials. You can check the Materials section of the Mesh Renderer. Some materials may be missing.
     
  3. Denisowator

    Denisowator

    Joined:
    Apr 22, 2014
    Posts:
    918
    What other material do I need, aside from the texture one?
     
    Last edited: May 22, 2017
  4. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Don't forget dudes.
    A texture and a material, are two different things. ;)

    A material, is what gives an object and a texture, a certain look or appearance.
    eg. A material, can make a wood texture, look like real wood, or, make it look
    like a shiny plastic looking wood object.

    A texture, is a like an outer skin, that makes an object, look like something
    from the real world, or other.
    eg. A wood texture applied to a cube object, makes it look, like a block cube of wood.

    But, put a flower texture on that cube object, and it might look like a toy block.
    Or something unusual or alien looking.:eek:

    And as I mentioned before, the material, plays a big part, in how that cube object
    with a wood texture applied, will appear to look.
    And can even make the wood texture, look real, fake, glassy, plastic looking
    or toyish.:D
     
    Last edited: May 22, 2017
    Chiefmastoras1 and Denisowator like this.
  5. Denisowator

    Denisowator

    Joined:
    Apr 22, 2014
    Posts:
    918
    Guess I should've called it "Texture not showing on some objects" in that case.
     
    BrandyStarbrite likes this.
  6. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    That sound like a uv map issue. If the model does not have a propper uv map unity can not display the texture the way you like.
     
    HotRhodium likes this.
  7. Denisowator

    Denisowator

    Joined:
    Apr 22, 2014
    Posts:
    918
    Would it be better to create a UV map (in something like Blender) and export it as a whole file, or just take the UV map on it's own, and somehow apply it to the model inside Unity?

    And if it's the second one, how do I apply/assign a UV map onto a model in Unity?
     
  8. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    The uv map is part of the mesh and can not be brought in seperatly.
    It defines on what vertice what point of the texture is mapped.
    And yes you would need to do that in the 3D modeling application of your choice.
    Normally if you buy a Model is has already a working uv map for the character textures.
     
  9. Denisowator

    Denisowator

    Joined:
    Apr 22, 2014
    Posts:
    918
    Thanks for that. Just needed clarification since I haven't worked with UVs much. :)
     
  10. Chiefmastoras1

    Chiefmastoras1

    Joined:
    Jan 14, 2019
    Posts:
    12
    So if I have a model that does not have a UVmap, I cannot just add/create one. Is there a way around this? I work in a research project of psychoacoustics in VR environment. The colleague that created the rooms is not working in our department anymore, so I do not have access to the original models (nor I am familiar with SketchUp or other similar software). Thanks in advance.
     
  11. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,635
    It's possible with scripting. I think you have to set read/write enabled in the import settings for the mesh. then you can access individual vertices, including the u,v values.
    https://docs.unity3d.com/ScriptReference/Mesh.html

    As to what you actually set the U,V values to, there are different ways to compute these, such as tri-planar projection. If you're going to do that though, you might as well just find a shader that automatically does this already and save you the trouble of scripting.

    I haven't tried this one yet, but it looks good:
    https://github.com/keijiro/StandardTriplanar

    The advantage to using the shader is that you don't even need uv coordinates anymore. The only problem with this is you don't really have any control over how the texture is applied to your geometry. If you need that sort of control than you'd really need to create the uv coordinates in some 3D modelling software, such as Blender,
     
    xofreshxo and rikkkurd like this.
  12. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    No need to use a 3D modeling program if you just want to modify UVs.

    Just use ProBuilder...it’s an asset that is now part of Unity. You can easily modify the UVs and save them.


    By the way, providing images of your issue helps to get your issue across much easier.

    One more note: are you sure the model doesn’t require two or more materials? The materials slot is an array, so it can hold more than one.
     
    Doranna likes this.
  13. FreshTofu

    FreshTofu

    Joined:
    Dec 7, 2017
    Posts:
    1
    Yes, you can. Just go into Blender (I say blender because I don't use any other 3d modeling software) import whatever model you do have that needs the UV, smart unpack the project, create a new material with a uv image. Texture paint it, pack all into .blend file and then export the model back into Blender and import the UV texture (which is likely a .png) once in Unity.
     
  14. bhanu68tyagi

    bhanu68tyagi

    Joined:
    Jun 3, 2020
    Posts:
    4
    I just downloaded a 3D asset of walls but all objects are pink in fact when I make a new material /legacy shaders/deffuse and add my texture then material is also pink.....pls help....
     
  15. rikkkurd

    rikkkurd

    Joined:
    Apr 10, 2019
    Posts:
    1
    This shader you mentioned works perfectly! it solved my problem!
     
  16. xofreshxo

    xofreshxo

    Joined:
    Apr 12, 2017
    Posts:
    79
    Just used this on IFC files exported from Revit, it was pretty much the last thing that needed to be solved for a simple import from Revit to Unity for architecture models as I'm not currently getting UV maps from the IFC models. Thanks a bunch, as you mentioned there isn't a whole lot of control but at least with most architecture materials they are just tiled.
     
  17. blessed_miracle

    blessed_miracle

    Joined:
    Apr 12, 2022
    Posts:
    2
    Guys! Thank you so much for pointing me to Triplanar Shader. It made my day! =))