Download

Input on idea for interactive snow on trees (Like in RDR2)

Hi,

I’m pretty green with UE as I focussed first on asset creation. But slowly I’m getting to the point where I can take what I made into engine and do something with it.

My goal is to have spruce trees with interactive snow slabs/clumps on the fronds. To get a point to start from, I bought the DynoFoliage asset from the marketplace, which replaces instanced foliage into BP with rigged skeletal mesh components, when the player is near, and reverts this when the player moves away.

My idea how to enhance this system now, is to have individual static meshes for each slab. As soon a frond moves, it’s collision overlaps with the slab collision, the slab gets destroyed, and a partice system spawned. This way I could make them shootable and being-walk-in-able. (Like in RDR2)

I’d then have a “RiggedTree_BP” which would have all the single slabs and the tree as components. So far so good. But I suppose I can’t then just replace this rigged tree with an instance. I’d have to provide as many instance options as there are possible ways for the slabs to get removed in order to be able switch to an instance that resembles the state of the dynamic BP tree. But that would end in so many possible instances that wouldn’t likely get used in a meaningful manner as instances anyway, that it’d be easiert to just replace the skeletal mesh in the BP with a static mesh, and only then replacing that with a fresh instance when a max count of static tree meshes or a certain distance have been reached.

So the flow of events would be: Player gets close>Instance is replaced by BP with skeletal mesh>BP reacts on collision interaction with player by moving fronds and detroying snow slabs>Player moves away>BP stays but replaces skeletal with static mesh>max. count or distance is reached>BP get switched back to initial instance

I hope someone can help me correcting my logic or verify it so I know where to start. So far this is just how I would imagine to do things, but I have no clue if I’m right or not.

You could get the Pixel Normals in your Material Shader with the PixelNormalWS node. By determining how Upright the normals are you can calculate a factor for how much snow is blended in so it will accumulate on flat surfaces first. This can be done by calculating the dotproduct of Normal and Up-Vector (0,0,1). You can then use the result to Lerp in a snow Material, maybe multiply the Upright-Factor with a noise texture to break it up.

There’s a shader in the UE Marketplace that may provide a good basis for you. I can’t remember the name, but I will update post when i find a link.

A shader won’t cut it it the idea is to mimic RDR2.

I’ll fix your logic in a jiffy.

Create a clump static instance.

Paint the clump onto the frond with the foliage tool.

Make a clump BP that defines the interaction.
And set up the replacement to leave it blank after interaction (which is an option).

Yes, you’ll have more drawcalls, but the system will be fully dynamic with very little work.

Note, maybe disable wind on the trees since normally with snow on them the fronds can’t move.

Well that sounds great, but can I instance static meshes with instances on it (and how)? In the end I want to use the procedual foliage tools and prepare the trees only once. Also it’s important that only the trees in proximity are dynamic. And yes, wind could be disabled, but I guess since it’s the vertex shader the wind movement has no effect on the collision boxes if I’m not mistaken. So in theory the wind could be also applied to the clumps without destroying them.

You can place foliage instances on anything. You just need to select the correct option (the check boxes when placing).

Can you save a mesh with instances of the foliage on it and re-use it?
No, but you could try painting a blueprint that contains only the instanced instances. This should not negatively impact performance (disable tick on the BP) since we have been able to use blueprints in the foliage tool.

Regarding the wind, the snow gathered on a branch makes it pretty much a 200 to 300 lbs thing. You would need a LOT of wind to move that. But yes, you could run the same code for the clump as well as the branches - thus having them move in unison. Just a smidge unrealistic. Depends on how much wind you add I guess, there will always be “some” motion.

I’m not sure if I’m understanding this correctly. Could you elaborate a bit on the blueprint part? As I understand you, your approach would be to create the source BP using the foliage tool in engine, so instead of having 20 different clumps, you’d have 20 instances of the same one.

This source BP containing the clump instances and the tree mesh can then be instanced as “FoliageBP” and this instance then gets used by the foliage tool/volume.
Another instance “MeshBP” gets individually instanced as soon the player is close and stays for certain conditions like max distance, time, number of instances etc.

Can use the foliage tool directly in the blueprint environment? How? I just seem to be able to place instanced manually in the BP. Though this is still fine for me. But is it possible to have per instance collision?

Btw thanks you other two, but I really search for a destructible mesh solution. I’m aware of PDO shaders, but that can’t give me the effect I’m looking for on trees.