Hi everyone! I'm very new to SpeedTree, but I thought I'd learn it for a personal project I'm working on in UE4. The title speaks for itself. When trying to export to UE4, I can't see any clear way to get the essential packed texture with AO, roughness and metallic information. I only get the color map, normal map, and a subsurface map. I can't find any information about it online either, and all tutorials I've found on it appear to be happy with color map and normal map and don't bother with anything else. Really? I also find it annoying how SpeedTree is using gloss instead of roughness, so I have to invert the map and hope it looks correct in the export.
How am I supposed to export the additional texture maps when exporting?
Replies
First, ensure you have the textures assigned in the material bar:
toolmaterialsassetsbar [SpeedTree Documentation]
Second, check how they are being packed:
expgame [SpeedTree Documentation]
I don't have it installed right now so can only point to docs. IIRC, you need to manually generate the AO by clicking the AO button up on the main toolbar.
It won't be generating a metalness map. I think by default the AO and glossiness get packed together, but I am usually only using color, opacity, and SSS.
Thanks, Alex_J, but I've looked everywhere in those menus, and all I can find that makes sense is which color channel I want to assign a texture to.
I cannot for the life of me find anything that resembles a menu or field where I specify which texture assigned to said channel goes to which material. They appear to just get discarded on export,and this is the UE4 preset. Still only color, normal, and subsurface. I must say this is way less intuitive than Substance Painter, where you can clearly see which channel goes where, but as far as I can see, there's no way to do it in SpeedTree. That really can't be the case.
The color map is also exported differently from what I'm used to. Instead of the usual RGB and opacity in alpha channel, the colors are translucent. I'm not even sure if it's supposed to be like that.
It's too bad I don't have a subscription to it at the moment. I might be renewing it soon in which case I can take a look. But I do remember messing with the way textures were packed before, so I think it is possible at least.
I took a look at the speedtreee textures in my ue4 project and I'm not sure what you mean about the color textures. They are packed to RGB+A with opacity in the alpha. If you drop that in photoshop or similar should be able to confirm that.
You might also try on the speedtree forums. In the past they've been helpful for me, though seems like a lot of unanswered questions there lately.
Speetree is packing its textures in a way that can be read automatically by speedtree materials inside Unreal.
Roughness/glossiness is in the alpha channel of the normal map. AO is baked into vertex color IIRC.
Oh, you're right! I've never seen it done like that. Just a little disappointed I can't use the AO map to create more variation in the material with it, like adding moss or dirt in little cracks, etc. Maybe things like that have to be done in SpeedTree itself. Seems the rest of the maps are indeed in there. Thanks!
You need to go
Then you can select Unreal's UE4.fx and UE4.xml and duplicate that (rename also to fit yours packaging method name). Open it in some code editor (e.g. VS Code or Notepad++).
In XML File:
Here I just changed package method name and added one more texture to setup and updated Shader , which is name of your new preset.
From:
To:
This is just declaration and naming convention of your output file. I picked here something similar to Quixel's packing method. Actual packing is handled by second file - .fx
You need to add this somewhere in your code (.fx file):
Breakdown:
float4 - you're creating RGBA image - 4 channels
1 - sInput.m_fGloss - simple OneMinus operation on Gloss map, to create Roughness value. As is second argument it goes to G channel.
sInput.m_fHeight - I just picked Height for B channel.
1 - it's just alpha channel
You can select whatever float type you want as any of them (as I think, I can be wrong here).
Last step - select your preset while exporting
In my case, preset name is Gotha.
The result is Quixel like packed texture
Sorry for my bad grammar, but I hope someone will use this right way in the future anyway. Here goes the docs: https://docs9.speedtree.com/modeler/doku.php?id=texturepacking - field names, flags etc.