Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Soft Particles dont work VR

Discussion in 'Editor & General Support' started by vrWiz, Jun 27, 2017.

  1. vrWiz

    vrWiz

    Joined:
    Nov 5, 2014
    Posts:
    13
    Hi, I have a game where I use multiple cameras (car and the mirrors) and its in VR.
    For some reason the soft particle option doesn't work. How can i control the rendering mode for all the cameras in scene in order to make the soft particle work


    Thanks,

    Eliran.
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,240
    vrWiz likes this.
  3. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    416
    I'm having the same issue. When I use Soft particles in Single pass stereo the particles dissapear. Issue happens with both regular particle shaders or the new Particle Standard shader. And I am using shadows in my scenes. But, I am using Unity 2017.1.0f3... I'll try to update if I have the time, just in case it's a quirk with the version. Or is it that the shaders are just not compatible with Single pass?

    Anyway, any advice will be greatly appreciated.

    Also, I'm away from my computer, If I can I'll post some screenshots if needed.

    Edit: nevermind, the standard particle shader had errors, so I reimported it and the shaders started to work again. strange...
     
    Last edited: Sep 27, 2017
  4. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,240
    Hi,

    I've just tried this and, with a very basic setup, it seems to work correctly for me.

    Please ensure you are rendering a depth texture (using Deferred, or Camera set to render a depth pass. The latter is enabled via script or if there are shadows. Unfortunately the Soft Particles setting doesn't automatically enable it).

    If you're still having problems after that, please submit a bug report with a minimal repro project.

    Link for enabling the depth pass via script: https://docs.unity3d.com/Manual/SL-CameraDepthTexture.html
     
  5. moodiey

    moodiey

    Joined:
    Jan 4, 2017
    Posts:
    16
    Hi, im building a VR project and am having trouble getting my soft particles to render despite pouring over this information.

    My camera is rendering in Deferred, and I've confirmed that my camera isnt actually rendering a depth texture despite enabling shadows on lights in the scene. Ive confirmed this via:

    Code (CSharp):
    1. cam = GetComponent<Camera>();
    2. Debug.Log(cam.depthTextureMode);
    which returns "None"

    Is this a limitation with Unity free? this thread seems to confirm this: http://answers.unity3d.com/questions/559652/soft-particles-depth-texture-unity-free.html

    using Unity 2017

    Am I doing something wrong here? how to i actually enable a depth texture pass? Thanks
     
  6. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,240
    We don't restrict these features in Free anymore. (See comparisons on https://store.unity.com/)
     
    moodiey and karl_jones like this.
  7. moodiey

    moodiey

    Joined:
    Jan 4, 2017
    Posts:
    16
    Will be upgrading to Pro very soon but great to know thanks. Any recommendations on how to get my soft particles to work in my case then?

    - Developing for Vive / SteamVR

    - have shadows enabled on at least one light in my scene.

    - Particle system emitting billboards with Sprites as the material texture .... shader = Particles (additive/soft)

    - soft particles turned on in quality settings

    - Script on camera to check if its rendering depth texures returns "None"

    Code (CSharp):
    1. Debug.Log(cam.depthTextureMode);
    Documentation says "DepthTextureMode.Depth" will "builds a screen-sized depth texture"... how to implement this?

    im using single pass rendering... any bearing?

    Would really appreciate some help if you got it to work. Thanks
     
  8. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    Yes it works, but took me a few mins to work it out mind, check the following:

    Render settings, check that Soft Particles is checked (enabled):
    Edit->Project Settings->Quality

    Check that the material is Particles/Additive (soft).

    Then add this script to the cam:
    *Note this script is also executed in the editor!

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. [ExecuteInEditMode]
    6. public class camDepth : MonoBehaviour {
    7.  
    8.     void Start () {
    9.         Camera cam = GetComponent<Camera>();
    10.         cam.depthTextureMode = DepthTextureMode.Depth;
    11.     }
    12.  
    13. }
    14.  
    If you use this then keep in mind the restrictions of scripts in editor mode:
    https://docs.unity3d.com/ScriptReference/ExecuteInEditMode.html
     
    rmclachlanTCR likes this.