MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Fog in Unity on Hololens?

Open reillydonovan opened this issue 8 years ago • 3 comments

Does anybody know a way to get fog to render in Unity for the hololens? I've tried the native fog in Unity and a 3rd party plugin for mobile with no luck. Any suggestions are very appreciated, thanks!

reillydonovan avatar Dec 17 '17 21:12 reillydonovan

Not sure what the Fog is exactly, but I use the DustStorm prefab from Unity StandardAssets package. You can see an example here: https://www.youtube.com/watch?v=ePJWUP6aI1Y

The key is to adjust the Shape and other settings.in the Particle System inspector. Default size is 100 x 0 x 100 which in HL is far too large to be seen. Shrink that down to room size 5x1x5 or something or smaller, also adjust the particle speed so the particles don't fly away, you can reduce the Max Particle size in the Renderer, etc.

genereddick avatar Dec 18 '17 16:12 genereddick

Alternatively, assuming scale is the issue, you can drop the Fog inside an empty gameobject and scale that down as needed.

Or you can use something along the lines suggested by Unity here: https://blogs.unity3d.com/2017/11/16/dealing-with-scale-in-ar/

This has the advantage of not having to tweak all the settings that are already tuned to each other at the larger scale.

Actually, not sure the particle systems will completely adhere to the scale to the parent object, so may still require reducing various scale settings.

genereddick avatar Dec 18 '17 16:12 genereddick

An alternative is to implement custom fog directly in your shaders using uniform shader variables. This is only viable if you're working with a limited number of shaders, but it's tough to beat for performance and simplicity.

Railboy avatar Dec 18 '17 17:12 Railboy