How to get the texture XY size in a Niagara particle system for "Spawn Particles in Grid"?

I am trying to fill in the X and Z Count of the “Spawn Particles in Grid”. How can I set the X and Y count of a texture or render target to these two values? The texture size might change during runtime. Can I set it from outside with a Blueprint component maybe?

Or where is the source code of the module “Find Pixel Count”?

image

It does almost the right thing, it just multiplies the two values…

Alternatively, I’ve tried texture.GetDimensions() in a custom HLSL node, but that didn’t work out, I wasn’t able to create a texture object input, there was some type mismatch error…

The goal is to spawn one particle per pixel and use the GridUVW values to sample the texture at the pixel center.

The way it was working was with a custom HLSL call and using a TextureSample object:

float2 size;
TS.GetTextureDimensions(0, size);
X = size.x;
Y = size.y;

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.