/ Forums
New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

Oculus Medium Export Object To Unity

AionRAionR Posts: 5
Virtual Boy (or Girl)
Hi I just start with Medium and it is AMAZING!!! - It would be my dream came true if only this would look same as it is inside Oculus Medium after exporting it to unity, but it loses its all properties ( color, metal and emissive materials 

Some of you know best practise to export object from Oculus Medium to Unity? - is there any easy way to make it look the same as inside Oculus Medium? 

I used MeshLab and Blender but the results are miserable... I still need to learn a lot...

ps. Is there any chance that in future Oculus Medium will save all this properties for us and we will be able to use it with Unity?

Comments

  • P3nT4gR4mP3nT4gR4m Posts: 899 Poster of the Week
    Check out This Thread Dunno about unity but, right now, I'm able to get a model into blender, with the vertex colours intact, per surface and then bake them onto a lowpoly remesh. From there it's business as usual with exporting to UE4.

    Wouldn't hold your breath for a one-stop export for Medium. Too much human work still required to take a hipoly sculpt and convert it to a game asset.
  • KevinLongtimeKevinLongtime Posts: 282
    Nexus 6
    edited December 2016
    EDIT: sorry, didnt realise you wanted materials too.

    You can use this method but for performance reasons I'd advise to later on learn the re-topologizing process.

    Taken from a different thread: https://forums.oculus.com/community/discussion/45833/export-texture-map-your-painting-with-the-obj-export-feature#latest



    I've found a way of using the vertex color information inside the non-standard medium obj file to create the mtl and png texture map. 

    I'm using MeshLab 64bit (free and open source) for this.

    The basic structure is, copy your obj file somewhere (so as to not accidentally replace your medium obj):

    1. Open MeshLab
    2. File -> Import Mesh (your copied obj)
    3. Filters -> Texture -> Parametrization: Trivial Per-Triangle
    4. Increase texture dimension in Parametrization: Trivial Per-Triangle from 1024 to 2048 (will vary) and hit apply.
    5. Filters -> Texture -> Transfer Vertex Attributes to Texture (between 2 meshes)
    6. Change texture width and texture height in Transfer Vertex Attributes to Texture from 1024 to 2048, and tick Assign Texture and hit apply.
    7. File -> Export Mesh As and resave as an obj file

    Now you should have an obj, an mtl and a png file that together will form your texture.
  • KevinLongtimeKevinLongtime Posts: 282
    Nexus 6
    Here's a video too : 
  • AionRAionR Posts: 5
    Virtual Boy (or Girl)
    edited December 2016

    Thank you for your help I will show you now difference between Oculus Medium, MeshLab and how my simple Oculus Medium Object looks after import it to Unity:


    1. Oculus Medium:


    [img]http://i.imgur.com/bnM8A36.png[/img]


    2. MeshLab (before any change):


    http://imgur.com/a/WJFiB


    3. MeshLab (with  changes)

          1. Open MeshLab

          2. File -> Import Mesh (your copied obj)

          3. Filters -> Texture -> Parametrization: Trivial Per-Triangle

          4. Increase texture dimension in Parametrization: Trivial Per-Triangle from 1024 to 2048 (will vary) and hit               apply.

          5. Filters -> Texture -> Transfer Vertex Attributes to Texture (between 2 meshes)

          6. Change texture width and texture height in Transfer Vertex Attributes to Texture from 1024 to 2048, and               tick Assign Texture and hit apply.

          7. File -> Export Mesh As and resave as an obj file):


    http://imgur.com/a/Q2Zwo


    4. Unity:


    http://imgur.com/a/hThHq


    And as you can see it looks bad and there is 32 mesh parts


    I would like to receive same image or very close as it is in MeshLab (before applied changes) and I would like to reduce mesh parts to minimum (if possible just 1)


    Can you  help me here?

    Regards
  • AionRAionR Posts: 5
    Virtual Boy (or Girl)
    edited December 2016

    Thank you for your help I will show you now difference between Oculus Medium, MeshLab and how my simple Oculus Medium Object looks after import it to Unity:


    1. Oculus Medium:


    http://imgur.com/a/RemvM



    2. MeshLab (before any change):


    http://imgur.com/a/WJFiB


    3. MeshLab (with  changes)

    1. Open MeshLab

    2. File -> Import Mesh (your copied obj)

    3. Filters -> Texture -> Parametrization: Trivial Per-Triangle

    4. Increase texture dimension in Parametrization: Trivial Per-Triangle from 1024 to 2048 (will vary) and hit apply.

    5. Filters -> Texture -> Transfer Vertex Attributes to Texture (between 2 meshes)

    6. Change texture width and texture height in Transfer Vertex Attributes to Texture from 1024 to 2048, and tick Assign Texture and hit apply.

    7. File -> Export Mesh As and resave as an obj file):


    http://imgur.com/a/Q2Zwo


    4. Unity:


    http://imgur.com/a/hThHq


    And as you can see it looks bad and there is 32 mesh parts


    I would like to receive same image or very close as it is in MeshLab (before applied changes) and I would like to reduce mesh parts to minimum (if possible just 1)


    Can you  help me here?

    Regards


    m1.png 265.4K
    m2.png 171.7K
    m3.png 376.2K
    m4.png 598.4K
  • Jannis42Jannis42 Posts: 1
    Virtual Boy (or Girl)
    edited December 2016
    Hi AionR,

    You get that many mesh parts because the Medium model has a very high resolution. In Unity a model can have a maximum of 65534 polygons. Since your model has way more it is splitted into submeshes (see warning message at the bottom of your screenshot). To get fewer submeshes you need to reduce the polygon count before importing  the model into Unity.
    To do this you can use a 3D modelling software, for example Blender. The decimate modifier (https://www.blender.org/manual/modeling/modifiers/generate/decimate.html) may be helpful for automaticly reducing the polycount but for best results you will also have to do manual optimization.


  • falken76falken76 Posts: 1,554 Poster of the Week
    It would be better to export to OBJ and bring the model into one of the traditional 3d programs like you use, then you check the topology, fix it and do the texturing in the 3d program.  You just need to figure out a work flow because usually there is a process involved that involves more than a simple export.  You need to get the poly count on that mesh as low as possible for performance reasons.  You'll also want to learn up on Topology and Edge Loops if you want to animate it.

    Lots of work is involved in game development....
  • falken76falken76 Posts: 1,554 Poster of the Week

    4. Unity:

    http://imgur.com/a/hThHq


    And as you can see it looks bad and there is 32 mesh parts


    I would like to receive same image or very close as it is in MeshLab (before applied changes) and I would like to reduce mesh parts to minimum (if possible just 1)


    Can you  help me here?

    Regards


    I'm not familiar with Meshlab but the tools are all similar.  In 3dsmax I would combine the parts using Boolean subtraction so there are no intersecting parts where the meshes come together.  Yours looks like it is made up of several rectangle primitaves that are moved into overlapping positions to create model.  You don't want interecting pieces because it's a waste of resources when it comes to rendering because it is calculating parts of the mesh that wouldn't even be seen.  These are practices used from over a decade ago when MHZ was the defining factor of speed on computers as opposed to multi cores.  I'm not sure if it's still as important, but I would imagine it is since it directly would effect performance
  • SamuelABSamuelAB Posts: 23
    Lawnmower Man (or Woman)
    The pure colors are transformed into disgusting splotchy colors. I found that just opening the file in Meshlab and save it again assigns proper vertex colors that can then be baked in 3ds Max. Maybe there is a way to not bake them, but they show up in 3ds Max only after being opened and re-saved in Meshlabs.
  • AionRAionR Posts: 5
    Virtual Boy (or Girl)
    Thank you guys for your help I will play with it more to get better results
Sign In or Register to comment.