Will it be possible to sample textures inside Niagara modules?


I spent some time with Niagara in 4.20p1 today, and didn’t notice any functionality for sampling textures. Is there any plans for such features?

Example use cases: spawning particles on certain areas of a mesh defined by a texture; using a texture to determine initial properties of a particle; using flow maps to match particle movement with surface material.

I’m surprised it’s not there too… It could be implemented as a data interface i suppose, same as static mesh is .

It’s no surprise it’s not there by default, that’s a really advanced behaviour you’re looking for. The advantage of Niagara though is that once someone has written that module the community can share it.

Sampling a texture should be pretty easy in HLSL, but it probably won’t be very efficient on the CPU side.

Does someone have an idea how Epic managed to do that without texture sampling?

There is a Static/Skeletal Mesh data interface. There is also a getTricolor function using tri id and barycentric coordinates…

So you could do texture sampling using a quad plane static mesh with your texture on it, but it’s a serious workaround to having a texture data interface.

An early version is now available in the Dev-Niagara stream

Would you happen to know how to use the skeletal mesh data interface, or a volume texture sampler, in HLSL?