I have a simple question just because I can’t find any good example in the internet. How to create fog without using particles? How to make for with different density on different locations and in general how to make gaseous objects (like a nebula)? Any pointers? Thanks for reading
Clouds are a good fit for this but good quality cloud(s) rendering isn't usually simple. Searching for cloud rendering should give a few hits good hits. Here is neat shader toy rendering a cloud like tunnel. But take a look at your GPU stats, ray marched clouds can be very expensive. If you search shader toy for clouds you'll find several really good examples. Search shader toy for nebula as well. Sometimes the effects on shader toy can be adapted to rasterization.
Atmospheric shadowing/Volumetric lights/many other names... can be extended by sending a ray through a 3D volume to accumulate fog along that ray, combined with flow fields these techniques can create outstanding effects but it is fairly difficult to implement. (each texel of the 3D volume tends to represent large areas and aliasing becomes an important issue that has to be dealt with)
Next, it is possible to combine multiple effects such as halo's, planar fog, etc., to get an effect for particular scenarios.
If the "nebula" is always off in the distance (cannot be approached) then a simple quad with a partially transparent texture mapped to it can provide a nice effect.
There are dozens of other approach's I listed some of the most current.
Edit: Searching for "volumetric fog" gives a lot of hits. This presentation by Wronski for siggraph 2014 is very good. Wronski has a blog that is generally pretty good to read. Techniques like this work best when all the buffers that are needed to create the effect are used by as many techniques as possible because it amortizes the cost of creating them. Cascade shadow maps in particular go with this technique well.
Here is a link to a fairly straight forward approach to generating volumetric fog. It has shaders included but is light on the math/explanation.