Search Unity

Importing voxels from MagicaVoxel into Unity

Discussion in 'General Graphics' started by RawSpartano, Jun 4, 2015.

  1. RawSpartano

    RawSpartano

    Joined:
    Jan 29, 2015
    Posts:
    5
    hello, i am tryng to import the vox files i make into Unity, i am currently doing Magica => VoxelShop => Unity.
    i have disabled the anti aliasing but still the models look bad, i can see the lines on the faces of the cube. there is any way to improve this? or i just have to use Maya and export to Fbx? Thank You, Bye Bye.


    I manage to solve partiali the problem. With Magica i can export it as an .obj , so now i have a model made of many cubes instead of one single mesh that .dae creates. but still the edges are not smoth at all. do you think i should add image effects to it so i can obtain an smoth image?


    Cattura1.JPG




    Cattura.JPG
     
    Last edited: Jun 5, 2015
  2. Giometric

    Giometric

    Joined:
    Dec 20, 2011
    Posts:
    170
    If the model is colored by a texture, check the texture's filtering settings. Make sure it's set to Point filtering.
     
    jesses.co.tt likes this.
  3. Cherno

    Cherno

    Joined:
    Apr 7, 2013
    Posts:
    515
    I export to *obj from MagickaVoxel, then import the *obj file into 3d Studio Max (Blender etc. should be able to do this as well), place and rotate the pivot correctly, and then export it as *fbx. In Unity, the model will have it's texture imported with it, which will be the palette texture file MagickaVoxel uses.
     
  4. RawSpartano

    RawSpartano

    Joined:
    Jan 29, 2015
    Posts:
    5
    i have tryed Blender, i export it as an .DAE , i include the UV TEXTURE, MATERIAL TEXTURE, but it still looks ugly. i cant understand what do i have to do to make it look like in magica voxel. it is a problem of material? what settings you're materials have? why do i see the edges so sharp?
     
  5. Cherno

    Cherno

    Joined:
    Apr 7, 2013
    Posts:
    515
    Check where each face's uv mapping is in Blender. If the UV mapping creates a rectangle that encompasses one whole pixel in the palette texture, then there might be color bleeding. In that case, you have to make the uv rectangles smaller so they sit in the center of each palette texture pixel and are tiny.

    This is probably a very bad explaination but I don't see a way to make it more clear. In any case, check the UV mapping inside Blender.

    Also, what do you mean by "Why do I see the edges so sharp?" the only problem I can see is that there appear to be bright lines along the outward edges, but that might aas well be caused by lighting inside Unity. If you actually mean the ambient occlusion that MagicaVoxel uses, then you have to add this image effect to the camera in Unity yourself. There is a script for that in the Standqard Assets package.
     
  6. RawSpartano

    RawSpartano

    Joined:
    Jan 29, 2015
    Posts:
    5
    i am totaly new to Blender. could you make a foto tutorial? i will upload the file, so if you have some time, i would trully apreciate it.

    I dont know what is the name of the image effect, but yes, the lines on the edges are not continuos, they seem many line and not an straight edge line.
    Thak you. Bye.
     

    Attached Files:

    • Bird.rar
      File size:
      15.2 KB
      Views:
      511
  7. Cherno

    Cherno

    Joined:
    Apr 7, 2013
    Posts:
    515
    Sorry, I can't make a foto tutorial. I don't use Blender.

    I recommend reading/watching a Blender UV mapping tutorial.

    Before you do that, however, first disable all lights in your scene and set the ambient lighting to max. I suspect that a directional light shining directly towards the front of an imported model causes the hard falloff lines.
     
  8. RawSpartano

    RawSpartano

    Joined:
    Jan 29, 2015
    Posts:
    5
    i tryed to create a normal cube, and it seems the edges they are not drawn in a straight line. i disabled all ambient lighting.
    Maybe it's because i have an old computer that it makes it look that way.
    Cattura.JPG
     
  9. Cherno

    Cherno

    Joined:
    Apr 7, 2013
    Posts:
    515
    I can't see what's wrong with this cube. The lines all look pretty straight to me.
     
  10. twhoward99

    twhoward99

    Joined:
    Dec 31, 2015
    Posts:
    1
    Disclaimer, total newbie, but I did an export -> obj; pulled all 3 files into Unity; dragged the obj and texture file onto the graph view. Looks 1-1 as it did in MagicaVoxel.
     
    RealDooMMarine and jesses.co.tt like this.
  11. M_oenen

    M_oenen

    Joined:
    Oct 21, 2015
    Posts:
    5
  12. CalebLee123

    CalebLee123

    Joined:
    Aug 2, 2017
    Posts:
    3
    When I export the vox file into an .obj and then put it into blender, It's completely gray. is this normal?
     
  13. CalebLee123

    CalebLee123

    Joined:
    Aug 2, 2017
    Posts:
    3
    Never Mind
     
  14. tomas_jasper

    tomas_jasper

    Joined:
    Nov 21, 2017
    Posts:
    1
    I know this wasn't the original question, but just to answer Caleb Lee's question on the gray model.

    This video shows exactly how you put the color into your model when you import it into Unity.


    When you import the 3 files exported by MagicaVoxel into Unity, there's an extra Materials folder that comes with it. Open this folder, and click on the material (the sphere) inside it. In the Inspector panel, see that there's an Albedo setting. Go back to the PNG that you imported with the model and drag it into the Albedo setting. Voila, your model has color.
     
  15. Project-357

    Project-357

    Joined:
    Jun 1, 2021
    Posts:
    1
    Thank you very much tomas_jasper.