Search Unity

Text shows as blocks when I export the asset

Discussion in 'UGUI & TextMesh Pro' started by xiaolan706, Apr 9, 2020.

  1. xiaolan706

    xiaolan706

    Joined:
    Jan 5, 2020
    Posts:
    7
    Hi,

    Recently, I am trying to add some text to a 3D model. The 3d Model is an obj type file I downloaded.

    My approach is I created a text on the asset by using TextMesh Pro. Then change the location to non zero. It shows normal. However, when I exported them as a .obj file, the text displayed as white blocks.

    Does anyone know how to fix this issue? I am using Unity 2019.2.17f1.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    How are you exporting those as .obj files?

    The white blocks is typically related to the SDF Scale being 0 which is related to the scale of the lossy scale of the text object which has to be uniform. So make sure the scale of the text object is (1, 1, 1).

    This SDF Scale is passed via the geometry of the text object in UV2 Y. This is where the SDF Shaders expect to pick it up.

    This could also be related to the material since this scale is handled by the SDF Shaders.
     
  3. xiaolan706

    xiaolan706

    Joined:
    Jan 5, 2020
    Posts:
    7
    Thanks for your fast reply, Stephan!

    I downloaded a plug called "Scene OBJ exporter" in the Asset Store, then just click File -> Export -> Wavefront OBJ to export them.

    I don't think my issue is related to the scale, but not sure about the materials. So, I attached the capture of the text inspector for your reference.
     

    Attached Files:

  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    When you say the text shows up at white blocks, that is inside Unity afterwards or in some other tool that allows you to import those objects?
     
  5. xiaolan706

    xiaolan706

    Joined:
    Jan 5, 2020
    Posts:
    7
    In Unity, the text is normal. But after I export it, it shows as white blocks. I attached two captures for your comparison.
    Capture1.PNG Capture2.PNG
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Once these exported objects are reconstituted in Unity, do they use the same material or some combined material?

    What material is the text in this re-imported object using?

    Can you post images of the inspector of those objects after they are re-imported?
     
  7. xiaolan706

    xiaolan706

    Joined:
    Jan 5, 2020
    Posts:
    7
    Since the raspberry pi and the arrow are what I expect when I downloaded, so I did not change them. I just imported those two by dragging into the scene and changed the location.

    Capture.PNG Capture1.PNG
     
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What material do these two object use?

    I am assuming this is using the Mesh Renderer, what material does it show is assigned to those objects?
     
  9. xiaolan706

    xiaolan706

    Joined:
    Jan 5, 2020
    Posts:
    7
    Capture.PNG Capture1.PNG
    Is this the picture you want to know? Sorry, I am a beginner, not familiar with Unity. Please let me know if they are what you expect.
     
  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Yes. I suspect the issue is related to this export object not using the correct Material and shader. I would suggest reaching out to the author of this asset tool to bring up this issue.

    Please refer the author to this thread so that we can find a solution for you.
     
  11. xiaolan706

    xiaolan706

    Joined:
    Jan 5, 2020
    Posts:
    7
    Thanks for your reply!

    Since the exported 3D model shows normal, only the text I added rendered as blocks, I tried a new scene only contains the text. It still shows as blocks. So, I think the issue is not related to the assets I downloaded.
    Capture.PNG Capture1.PNG
     
  12. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The issue is related to the Asset not using the correct material / shader or even possibly not pointing to the correct Atlas Texture.

    For instance, the Themes being shown appear to be different material type presets. For text to render correctly, it would need to be referencing the correct atlas texture and the correct TMP SDF shader.