Setting up unreal with hengine for baking complex shaders?

   6673   13   3
User Avatar
Member
10 posts
Joined: July 2013
Offline
How exactly do we set up a houdini material for baking into unreal through the engine?

I currently have read the docs here…..

http://www.sidefx.com/docs/unreal/_materials.html [www.sidefx.com]

…but only the default paramter colours get set on the unreal material when ogl_diff is set as a tag on the parameter. Even passing in a constant to the parameter doesn't work. I guess it is literally a ‘parameter’ and not an input?

I've even tried using the principle shader with a noise as an input to the base color but still it behaves the same.

What I would like is to have the houdini material baked down to what is going into the parameter node. That way I can use noise etc and have it automatically become a texture asset. I'm just not sure of the exact steps to make that happen. I am in h16 633 and ue4 4.16.

Cheers
Dan
Weta Digital
FX TD
User Avatar
Member
453 posts
Joined: Feb. 2013
Offline
I think that's currently not properly supported. You could bake materials via something like COPs to textures and plug those into an Unreal Material. You could also make an Unreal Material and assign it to your geo. So that it will get automatically assigned to the geo on bake in UE4.

Edited by DASD - June 28, 2017 05:54:25
User Avatar
Member
10 posts
Joined: July 2013
Offline
Okay thanks

I was confused by this line in the docs…..

“Textures will be generated by copying the associated data from possible channels which are connected through parameter names or tags.”
/
So then what is the process for setting up houdini msterials to read the textures? Is it with the ogl_tex# tag or does the principle shader texture input do that for you?

Also can textures be automatically baked internally in the hda and then output to unreal?
Weta Digital
FX TD
User Avatar
Member
10 posts
Joined: July 2013
Offline
So I've been doing some more investigation and I realise now that I need to be setting the olg_tex# tag or the basecolor_texture tag. This works for the houdini viewport but still doesn't bring accross the texture to unreal when it cooks. Does the rat file (with a C plane) HAVE to be embedded in the asset? I've tried with and without.

Also with H16, it confuses thins by having the mat context. Trying the principle shader doesn't work and also using the old shop context with a material sahder builder and parm nodes doesn't work either (well it does in houdini, just not ue4.

Can someone please outline the steps necessary to get textures from houdini to unreal?

The next step once I've got that sorted is to see if I can bake inside the asset and write to $HOUDINI_TEMP_DIR to read the texture in.
Weta Digital
FX TD
User Avatar
Member
10 posts
Joined: July 2013
Offline
Actually I JUST GOT IT WORKING WOO!

I think it was setting the parm name to basecolor_texture that did it. I'll have to retrace my steps. Doing in in a material shader build node works. The good news is that $HOUDINI_TEMP_DIR also works.
Weta Digital
FX TD
User Avatar
Member
10 posts
Joined: July 2013
Offline
So here is the magic combination….

the Name of the Parameter has to be basecolor_texture AND you have to add a tag ogl_tex# set to a value of 1. That should be in the docs.
Weta Digital
FX TD
User Avatar
Member
67 posts
Joined: May 2016
Offline
I am interested in your workflow. Could you provide more details please? I don't understand how you are baking texture maps within Houdini Engine as baking requires Mantra, which isn't part of Houdini Engine (or is it?).

Cheers,
Andy
User Avatar
Member
10 posts
Joined: July 2013
Offline
I didnt know that you couldn't use mantra which is a shame as I wanted to invite the bake texture node from unreal. If that doesn't
Work I'll have to investigate another normal baking process.

However for creating maps, using cops works fine for creating textures. You can even use full vex in cops which I'd the same as shops as its all just vex.you reference the cop node with the op: syntax as a texture.

Then it's just a natter of setting up a shader with the right parm tags. One issue I am having us the normals are coming out a bit messed up and the bake red isn't respecting the composting settings resolution.
Weta Digital
FX TD
User Avatar
Member
67 posts
Joined: May 2016
Offline
OK thanks. I don't have much experience setting-up shader parm tags. Baking a colour-id map from within an HDA would be dead useful as then you could bake a Colour-ID map and use it to mask within a Substance or something and have crazy powerful workflow. As it stands the texturing is letting down the side.
Edited by trojanfoe - June 21, 2017 02:25:52
User Avatar
Member
118 posts
Joined: Feb. 2016
Offline
perfect timing and thanks for sharing your result,
I was just about to get myself into the same topic…


dokipen
I didnt know that you couldn't use mantra which is a shame as I wanted to invite the bake texture node from unreal. If that doesn't
Work I'll have to investigate another normal baking process.

maps baking in UE4 via Houdini plugin (especially normal map from highpoly) would be a really useful feature to have!
User Avatar
Member
118 posts
Joined: Feb. 2016
Offline
ok, spent some time yesterday without success…
I'm clearly missing something here about the workflow.

Any chance we could see some super basic digital asset to learn this workflow?

cheers
Edited by Andr1 - June 22, 2017 07:33:21
User Avatar
Member
10 posts
Joined: July 2013
Offline
Sure, although it's a little bit buggy at the moment. I've created some issues on the github repo page. I'm off to bed right now but I will post something tomorrow


There are a couple of othet iasues. The tangents that gets generated by houdini are a bit messed up I think. I have to switch recalc tangent in the plugin options to always but recalculate normals off if I want the smooth normals from houdini. In fact it would be nice if houdini calculated mikktspace tangent on its end(there is a sop for it on github I tried).

The other limitation is that I wold like a way to sample geometry at tributes in COP's but I can't seem to do that.
Weta Digital
FX TD
User Avatar
Member
118 posts
Joined: Feb. 2016
Offline
Thanks a lot! super appreciated
User Avatar
Member
7 posts
Joined: March 2016
Offline
So how did you achieve it? I'm able to set diffuse only color.

Principled shader has correct texture parameter name (basecolor_texture), correct tag (ogl_tex1), texture is embedded into asset, shader node in material network inside asset and still in UE4 its setting only diffuse color. (I tried also classicshader and adding new parameters to shaders without success).
  • Quick Links