Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

jingaa

Matariel export to Unity with FBX

  

   Hello mates i have a question... is that only me or does anybody has same promblem too? so , I am trying to export my scene/models to Unity with FBX export but my texture are not coming and i dont wanna deal with giving matariel in Unity for each model. 

I am using Houdini 16.0.504.20 and installed Unity Engine also and using Unity 5.6 and I created digital asset in Houdini on .hda format and aslo tried .otl too and they dont show up on Unity. 

So, i know these are two different questions but primary problem is exporting my models with textures with FBX , does Houdini support that like max? or nah? 

Share this post


Link to post
Share on other sites

I haven't done the straight FBX export outside of RBD stuff in a while, so some one else can chime in on that. It should work though...

As far as the HDA transfer of materials via Houdini Engine to Unity. This is what i have been using for the last few years. In H16 there is a "Houdini Engine" Shelf that has a shortcut to drop the Attribute create node, with a primitive string attribute called: unity_material, and the string example or relative/path/to/.mat/within/your/unity/project/including/the/.mat/extension.

The below is a simple tutorial you can skim through for more details on the subject with unity asset creations. There are example files to so you A and B what may be wrong.

 

1 person likes this

Share this post


Link to post
Share on other sites

 Hey LaidlawFx thank you for your message man. Actually i am using this method since few years also and i just remembered where i do wrong lol So, normally whenever i installed unity engine i was dragging unity engine script into unity from Houdini folder. I forgot the do that and that way Unity were not recognizing my hda or otl files. Now i solved that. But still having texture problem lol 

Share this post


Link to post
Share on other sites

#neverwin lol, I don't have Unity or Unreal on this machine, let's see how long it takes to install... Is the texture just no showing up in the corresponding unity shader? or is the shader not being assigned?

Share this post


Link to post
Share on other sites

OK this is what did...

Modeled in houdini , gave random uv and textured in substance then created gidital asset on hda format and add substance images also. When i import my hda file , texture is not coming. I have to apply matariel manually which i dont want. 

This way i am giving matariels in Max and exporting fbx from there. But this time i cant use my sliders for model. lol

Share this post


Link to post
Share on other sites

Ok so I got unity up and running. For my own amusement this post is for me to keep track of what i am doing, and encase anyone else comes across this.

I tried the straight FBX material method to expose the inherent export bugs/limitations.

I used Maya 2017 as a secondary test program besides Unity 5.6.0f3. For my example scene in Houdini I created a geometry node geo1, placed a testgeometry_rubbertoy1, I set the scale to 100 and TY to 66 (it's small in unity example scene) and began my exports. /obj/geo1/testgeometry_rubbertoy1. I tested with both fbx exporters the one in the File > Export > Filmbox FBX... or through /out/ with a Filmbox FBX rop so /out/filmboxfbx1.  I didn't try the script methods with these test as it's really the same code. I set the output file to $HIP/materialTestHoudini.fbx and selected the Export node to /obj/geo1.

For reference:

http://www.sidefx.com/docs/houdini/ref/windows/import_fbx

http://www.sidefx.com/docs/houdini/ref/windows/export_fbx

http://www.sidefx.com/docs/houdini/nodes/out/filmboxfbx

http://www.sidefx.com/docs/houdini/commands/fbximport

http://www.sidefx.com/docs/houdini/nodes/shop/v_fbx

From Houdini to Maya/Unity:

By default it will export a material link it appears for Maya with a diffuse texture but the material path is still the native HDA reference, plus the spec texture did not come across.

DefaultMaya.png

In Houdini HDA opdef:../..?toylowres.jpg to this in Maya opdef:/Sop/testgeometry_rubbertoy?toylowres.jpg

So I allowed editing on the rubbertoy and saved out the texture to $HIP/toylowres.jpg, and changed the link to that from the above and the color texture comes across.

DefaultMayaHoudiniPath.png

Albeit, while a few textures come across this is certainly not a good material exchange accept for some really basic parameters, the phong shader was selected with houdini specular lighting model, and incandescence was map from subsurface color, this seems to be a bit of material limit. Substance definitely is a better method.

So in unity the material link does come but definitely not materials as you said.

DefaultUnityHoudiniPath.png

So what we did at most studios was write a script that would at least take this materials link and do a look up and replace the material to something pre-built. But that is all ways a pain, and a studio one off.

I tried next to just export this same exact model from Maya to Unity, and it failed too. Which this should work, however... it's lunch time so i'll edit this when I get back.

...OK so I was looking into why the texture issues happens in Maya too with FBX, I found this blender post and it makes sense. 

http://answers.unity3d.com/questions/124817/why-is-my-imported-fbx-file-not-showing-textures.html

Mischa is right, FBX does not export textures and you have to import them into your Unity Scene, but if done right you can reload your FBX and do not have to manually assign them to the materials. They will find the links with the right materials.

I always have my folder setup like this: Assets/MyModels/ModelName/ FBX imported file which creates a materials folder, I add a textures folder, my 3d model also pulled the textures out of a textures folder next to the model. after I dump the textures in the textures folder I reimport the FBX and wolla! all the textures are assigned.

So this will probably work in the end too with Houdini Textures. Need to give it a go, but if I'm thinking right this will be the same with Houdini Engine.

BINGO! Take that FBX! The whole material parameters don't map, but that goes back to common mapping issues, and why substance is the bomb.

FBXMaterialVictory.png

Edited by LaidlawFX
Back from Long Lunch...
1 person likes this

Share this post


Link to post
Share on other sites

Just to add my $0.02, I have recently been trying to get Houdini to replace Substance Designer so it could be used as a complete one-stop-shop, and came the following conclusions:

1) You need to bake the textures and import them into Unity in order to build a Material.  They won't transfer within the .FBX.

2) Houdini won't bake the correct Metal/Smoothness texture as it's encoded in Unity with metal in red and smoothness in alpha.  In order to get that you need to modify the Principle Shader for each Houdini material.  I built a custom shelf tool to do this and it worked pretty well.

3) To add edge-wear effects and other effects you need to modify the material and it's much harder to do than using SD.

So I gave up.  I now just bake a color id map (unlit basecolor) for use with a Substance using primary colours.  SD can bake additional maps and this allows much more "post production" modification even within Unity (depending on how much you expose from your Substance).

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now