FBX displays material in viewport but not in render

Errors? Crashes? Unexpected behavior? Please report here. Attach .HIP files whenever possible to help with debugging.
Post Reply
MathiasJ
Posts: 6
Joined: Tue Jun 02, 2020 6:21 am

FBX displays material in viewport but not in render

Post by MathiasJ »

Just started using this great tool and it has made my instancing so much easier. Thanks!
Ran into an issue when instancing FBX files with UV textures though (e.g. Megascans plants, rocks etc.) which I've tried to fix for a few hours now with no luck.
The material displays in the viewport after instancing, but then in the final render it just displays a basic material with no diffuse, roughness, normals, alpha etc.

Are FBX files not supported by MOPs or am I doing something wrong?

User avatar
toadstorm
Site Admin
Posts: 34
Joined: Sun Sep 22, 2019 1:28 pm

Re: FBX displays material in viewport but not in render

Post by toadstorm »

I haven't worked much with Megascans assets so I'd just need to know a few more details about how you're handling the instancing.

How are you importing the FBX data? Are you importing the file to /obj first and then merging it into SOPs, or are you doing it some other way? Where is the material assignment being done... do the FBX object containers have materials assigned, or do you have a shop_materialpath attribute on the primitives?

MathiasJ
Posts: 6
Joined: Tue Jun 02, 2020 6:21 am

Re: FBX displays material in viewport but not in render

Post by MathiasJ »

Heya. Thanks for the reply.
Tried attaching a simple HIP file to show you but it was too big to upload.
I import the FBX into a Geometry node, then setup Principled Shaders pointing to texture maps and use the shop_materialpath to apply materials to primitives using the Material node and wire it into the MOPS_Instancer node.

I've previously tried doing the object merge as well. Also tried using the MOPS_Convert node before the Instancer but dunno if that's even what's it used for. Also tried a regular Pack node before.

Before finding MOPs I used the regular H18 instancing method using the Copy to Points node with 'variants' where I had the same issue so not sure if I am doing it wrong, or if it's an FBX limitation in Houdini, but that would just seem like way too big an issue for studios etc.
Attachments
FBX_instance_viewport.jpg
FBX_instance_viewport.jpg (335.65 KiB) Viewed 495 times
FBX_instance_render.jpg
FBX_instance_render.jpg (343.8 KiB) Viewed 495 times
Last edited by MathiasJ on Tue Jun 02, 2020 8:20 am, edited 1 time in total.

User avatar
toadstorm
Site Admin
Posts: 34
Joined: Sun Sep 22, 2019 1:28 pm

Re: FBX displays material in viewport but not in render

Post by toadstorm »

Try this... on your Mantra ROP there should be an option called "Declare Materials". Set that to declare all materials in your IFD. It's possible Mantra just can't figure out what materials should be included in the IFD because of the way they're applied. Let me know if that changes anything.

MathiasJ
Posts: 6
Joined: Tue Jun 02, 2020 6:21 am

Re: FBX displays material in viewport but not in render

Post by MathiasJ »

Attached an image to make sure I got the right option?
I tried setting it to 'Save All Materials and Shaders.' Didn't work sadly.
Attachments
declare materials.PNG
declare materials.PNG (29.25 KiB) Viewed 494 times

MathiasJ
Posts: 6
Joined: Tue Jun 02, 2020 6:21 am

Re: FBX displays material in viewport but not in render

Post by MathiasJ »

I got it working! You were right about Declare Materials. Houdini just didn't cook it, so I had to disable/enable the node and the textures are there now :) You have no idea how relieved and happy that made me hah. Thanks!
Last edited by MathiasJ on Tue Jun 02, 2020 8:37 am, edited 1 time in total.

User avatar
toadstorm
Site Admin
Posts: 34
Joined: Sun Sep 22, 2019 1:28 pm

Re: FBX displays material in viewport but not in render

Post by toadstorm »

Ah, perfect! Yeah this is a bit of a flaw in the packed primitive workflow... if it isn't obvious to Mantra where your material definitions are, it'll just skip them unless you embed everything. You can also dodge this problem a little more efficiently by using stylesheets to assign materials, but you'll have to learn that whole system.

MathiasJ
Posts: 6
Joined: Tue Jun 02, 2020 6:21 am

Re: FBX displays material in viewport but not in render

Post by MathiasJ »

Right, that makes sense.
What do you think I should search for, for that stylesheet technique?
I've used them before to apply a default shader to all objects for lighting scenes but not like this.

User avatar
toadstorm
Site Admin
Posts: 34
Joined: Sun Sep 22, 2019 1:28 pm

Re: FBX displays material in viewport but not in render

Post by toadstorm »

If you want the deep dive: https://vimeo.com/262883554/description

MathiasJ
Posts: 6
Joined: Tue Jun 02, 2020 6:21 am

Re: FBX displays material in viewport but not in render

Post by MathiasJ »

Cheers :) I'll be sure to recommend MOPs to others.

Post Reply