Setting particle color by sampling Virtual Texture assets in Niagara works as expected in the editor, but fails in packaged builds.
Expected result:
Niagara particles should be able to sample from Virtual Texture assets the same way they do from regular textures, with consistent results between Play In Editor and packaged builds.
Actual result:
In packaged builds, Niagara particles that sample Virtual Texture assets appear colorless.
Hey!
The sample texture module currently doesn’t support virtual textures (VT). I’ll open a bug ticket so that it at least displays a warning if you try to sample from an unsupported texture type (there are more texture types like volume textures that are also accepted as inputs and don’t work).
Instead of the sample texture module, you can try to use a scratch pad with a “virtual texture sample” data interface added as input and sample your VT like this:
[Image Removed]
Make sure the VT itself works in the level by using it in a material for example.
Regards,
Michael
Hi Michael. I’m a colleague of OP, who is currently away.
Thanks for your reply. We will try the scratch pad method and see if that works.
Do you have any information as to why the Sample Texture module would work with Virtual Textures in the editor but not in builds? A warning on the module when inputting an invalid texture would be useful, but if it works in editor, yet not in builds, the warning should explicitly mention that, since otherwise it could seem confusing.
Hey Claud!
I don’t know why exactly it can still sample the VT in the editor, but it’s also not really surprising. There is a lot of data around in editor mode that it removed during the cook, things are kept in memory in the editor for faster iteration (like texture mips) that are not in memory at runtime, etc. That’s why it’s always a good idea to have a nightly cook in place for your project to be able easily test and verify that things work in a packaged game on a regular basis.
Yeah, I’ll make sure the warning on the module is as explicit as possible.
Regards,
Michael