How do I make a particle effect show through fog?

I have a game where the fog turns up to a very high density and I want some particle effects to be unaffected by this fog.

Pretty new to Unity.

Thanks in advance!

Ok try this instead(Disable your new camera and set your Main Cam back how it was before). Find your particle materials, click on the material in the particle renderer component to do this. Now change the shader on each of these particle materials(for each material in each particle renderer) to “Mobile/Particles/Additive Culled” (This shader is part of the std Mobile Assets, import if you have not already done so). Now with a bit of luck you will see your particles again.

Here is a pic of the Sparkle particle effect showing through the fog(Density set to 1(max)) with this shader applied to the Sparkle Materials :

Just an idea, but you could have another camera render the special particle effects seperately. Here’s how you would do so:

  1. Make a new camera. You should probably parent it to the main camera.
  2. Make a new Layer. This layer is called “VisibleParticles”. Set all of the particle effects you want to show through smoke’s layer to VisibleParticles
  3. Go to the main camera and turn off VisibleParticles in the culling mask
  4. Go to the new camera and set every other layer off except VisibleParticles in the culling mask.
  5. Set the new camera’s Clear Flags to Depth Only.

I just want to add something on Mrsoad’s comment which helped me get the same effect which is useful if you don’t have the Mobile st asset:

Create a C# script and add this to it:

using UnityEngine;
[RequireComponent( typeof( Camera ) )] public class CameraFogSetting : MonoBehaviour { [SerializeField] bool enableFog = true;

  1. bool previousFogState;
  2. void OnPreRender()
  3. {
  4.  previousFogState = RenderSettings.fog;
    
  5.  RenderSettings.fog = enableFog;
    
  6. }
  7. void OnPostRender()
  8. {
  9.  RenderSettings.fog = previousFogState;            
    
  10. }

}

Then drag and drop this scrip on both your cameras. You can mark fog on for one camera and leave the other unmarked and viola, you can see lights and things through fog(you still have to add another layer and assign objects/lights/particles to said layer like Mrsoad said though) Hope this helps someone! :smiley: