Copy link to clipboard
Copied
Hello there,
I'm attempting to create a simple texture packer using a substance graph, though when duplicating the output, the duplicate is not updated with the current texture output. Is this by design? Is there any way I can make this work?
Thank you,
Marcus
Copy link to clipboard
Copied
Hi @Marcus32607238foy6 , this would be the expected behavior since duplicates of textures created by Unreal are not referenced by the Substance. Only the original textures are updated when the graph parameters are adjusted. If your worfklow allows it, a workaround for this is to duplicate the final material instance, since multiple instances can references the same dynamic output texture being generated by the Substance.
Copy link to clipboard
Copied
Thank you! It's a bit of a weird workaround for it, but forcing a duplication of the graph instance for each packed texture is the way I'm doing it and it works!
Copy link to clipboard
Copied
So actually revisiting this, it doesn't seem to function as I'd hoped, but this might be down to how I save the outputs. The textures themselves are wiping on restart / not writing to disk and I'm not quite sure how to do it through blueprint.
As a preface, in blueprint:
I am duplicating a substance graph instance, setting texture paths / substance parameters, rendering that graph, and then finally I delete the instance while keeping the output texture.
This is my attempted setup to save these outputs to disk but doesn't work, I can't seem to find documentation for how to do so, any further help would be great!
Copy link to clipboard
Copied
Hi @Marcus32607238foy6 , outputs made in play in editor mode will usually not generate cached data, which is why you may be seeing the materials wipe or reset. If your workflow allows, I would actually recommend using your blueprint in an editor utility widget. Since those run in the editor mode, it should save your outputs.
If you're trying to generate these at runtime, you may to look into a custom c++ script to save these to disk or keep in memory somehow. We're looking into adding this as a runtime feature request, but it may take some time to include this in the plugin.
Copy link to clipboard
Copied
Update, we looked into this a bit further and might have a blueprint setup that will work for this.
As mentioned previously, you will need an editor utility widget for this to work as that keeps it cached in memory.
This blueprint should produce outputs that will be saved. You can also add deleting the instance afterwards to keep things clean if you would like, but this is the foundation of the process. Let us know if this works for you.
Copy link to clipboard
Copied
Aha! Now we seem to be working, I had been using an editor utility widget but I must have just needed to get my head around the order of process. Everything seems to be working as intended now, thank you so much!
If anyone stumbles upon this then this is a basic graph for texture packing in Unreal, all of the existing versions using render targets and whatnot give low quality results, this is the only method I've found that will give you good quality outputs. For some reason I was struggling to change output size the normal way so ended up linking that to a parameter instead. The original Substance graph is incredibly simple and you can most likely recreate it from what's shown here. Hope this helps people!