UE4 [4-26] Niagara Landscape Sample

I have been using Distance fields to keep Niagara particles above ground but it is a hit and miss. I am now trying to use landscape but the module won’t let me enter a source. How do I enter a landscape into the module?

I don’t know about that particular aspect of Niagara, but what about using collision?

Thanks for the reply, I tried using collision but it works worse if you can believe it. I wonder if I can use the texture of the landscape as a heightmap using Niagara’s texture module.

As long as the landscape texture is in a texture asset, sure you can. You can use the ‘sample texture’ module.

I’ll need a bit more info though…

what info would you need? I am trying to use the texture sample but there is no function to get height like it shows for landscape, I am trying to convert the color into a float if thats possible.

You can make a copy of the ‘sample texture’ module and hack it a bit to return the red channel from the texture ( it’s easy ). It does already return the color, and I suspect you’re supposed to be able to crack the red channel out of that, but I don’t find the parameter settings very intuitive in Niagara, so I did this to it:

which gives me back the red channel:

which is what your landscape is using to do the height map.

Then you know to only spawn the particles if the red channel is white. You have to get the UVs right, of course, so what you’re seeing in the Niagara system matches with the landscape.

Okay this looks amazing, was on a similar route but had no idea about the redchannel! gonna try this out, again BIG THX!

Like I say, I think you should be able to split it out from the SampledColor, but I just don’t get that Niagara parameter system. Same with the UV. In my example, I used a bit of HLSL to set the UV. Again, I think you can probably do this with the parameter system…

I am not familiar at all with HLSL but ill copy what you wrote. How did you add the
“parameter writes”?

Watch out with the HLSL, you can’t see the whole thing there, and it refers to user parameters you don’t have.

Basically, your particle system needs to figure out where it is on the landscape, with respect to the texture, and convert that into UV/0-1 ranges.

To be able to see what a module writes to click here:

image

Im trying to do more research on the HLSL but this is what I got so far, it doesnt work with the height map but it works with collision(kinda).

That height map texture looks like it doesn’t have any information.

They’re very easy to spot. Information:

image

No information:

image

Even though it’s called height, you can see there’s nothing there.

So, first step is to use a heightmap with something in it :slight_smile:

And how are you applying the heightmap to your land? Is it one big mountain range type thing, or are we talking about lumpy stones scattered around?

I did a simple one by hand but ill try a preset heightmap and see if that works

There’s still no contrast.

For this to work cleanly, you need a well-defined difference between black and white.

Like I say, does this apply to your whole landscape? So this is a sort of mountain range thing?

Landscape data interface does not work in 4.26

does it work in any other version?