Hide particles in the built-in fog

Hey,

I would like to hide certain particles from the built-in fog. I found this:

// Load our node material
let nodeMaterial = await BABYLON.NodeMaterial.ParseFromSnippetAsync("HMP5KD#5", scene);
  
// Apply it to the particle system
nodeMaterial.createEffectForParticles(particleSystem);

but I have no idea where the NodeMaterial snippet is coming from. Is there a built-in way to achieve the same thing?

EDIT: @Evgeni_Popov Hi! It looks like the playground was created by you :slight_smile: Could you help?

Thanks!

This PR will add support for fog to particle systems:

When the PR is merged, you need to do yourParticleSystem.applyFog = true to enable it (and enable fog at the scene level, of course!).

You’re a rockstar pop <3 - any chance it could also be done for Lines? As far as I can see lines created with CreateLines also ignore fog.

Sure:

This PG will work once this PR is merged:

3 Likes

Awesome, can’t wait to test it!!!