The mobile shaders will cause issues if you use fog in your scene.
@RyanB - That’s a bug with the fixed function to vert/frag shader auto conversion added in Unity 5.0. Alpha blend particles should work fine, but mobile additive particles blend to the fog color and not black like they should. I use hand written conversions of the particle shaders to avoid this, and because the auto conversion makes shaders that are a couple of math ops heavier than hand written for some reason. Some people go full hand written GLSL to try to shave off a little more, but the modern hlsl to glsl is pretty good and I don’t really see any savings to be had.
@veer - Do you have soft particles enabled in your project’s quality settings? And does disabling it “fix” the problem? I’m still not entirely sure I understand your particle systems’ setup such that you’re getting stuff drawing on top to begin with, and soft particles can be an issue for small scale objects … but the results shouldn’t be different between the scene view and the game view, they should be equally broken or working in both.
Thanks. I never bothered digging into the problem because I use custom shaders for almost everything.
I use Shaderforge for prototyping and do all optimizations manually, basically re-writing all of the shaders to get rid of everything that isn’t absolutely necessary and what’s left doing as much as possible at the vertex level. I’ve found that I have to do it myself to ensure that our game has maximum batching, efficient use of forward rendering, fix weird rendering bugs, etc.
@bgolus Disabling soft particles in project quality settings does " fix the problem ". Could you please explain to me what does this mean?
My setup is pretty much:
Make the particle system properties.
Drag the texture onto the particle.
Continue tweaking said particle system’s properties.
Here’s a GIF. Notice how it auto creates the material above the texture asset file. I don’t create shaders at all. I just drag and drop the texture onto my particle system and it auto creates it for me. Then I continue to tweak the particle system. And its fine in editor but broken in game view (Unless I disable soft particles in quality settings).
Is this a wrong way to go about doing this? I’m still a beginner.
I don’t think I’ve intentionally ever made a particle material in Unity that way, but I suspect it’s making one using the default particle shader and settings, and then yes soft particles are going to bite you here.
Unity’s soft particle implementation is pretty standard within the shader, but the range it allows for, the value it sets by default, and the way it is presented to the user is terrible. It’s a slider value called Soft Particle Factor with a range from 0.01 to 3.0 defaulting to 1.0. That “factor” is actually the reciprocal ( 1 / value ) of the distance between the particle and a solid surface beyond it needed before it is fully drawn. Since the default is 1.0 it takes a 1 world distance unit gap between it and an opaque object before fully fading in the particle. Cranking it to the max of “3.0” still requires a 0.33 unit gap. With an effect like this on a sword that, if modeled to Unity’s standard 1 unit = 1 meter world scale, is probably only a small fraction of a meter thick with the particles even closer than that with soft particles on and the default particle shaders you’ll only ever get at best the particle at ~10% visibility while still “on top” of your weapons.
Using the basic shader forge shader or a mobile particle shader will both disable the soft particle stuff since neither have that code (though it could be added to the shader forge shader, it’s just that it’s not there by default). I generally use my own particle shaders and use a more sane range for the soft particle value so I can allow for much shorter fade distances like 0.01 meters (a Soft Particle Factor of 100 using the same setup as Unity’s soft particles) which would likely look pretty nice for the effect you’re doing.
Thanks for the detailed explanation and alternate way to do this Ben. Will be sure to look into shader forge shaders. Sorry for the late response. Hurricane Matthew had me down but I’m finally back now.