How to make a gradual transition between two shaders, depending on the normal of the surface against the angle of the view.
The use case is I want to make bubbles of a white, somewhat opaque, liquid. When passing through the center (from the camera) it will pass through minimal liquid so it is most transparent there. When a ray passes near the rim it will pass through maximum liquid and be most opaque there.
I will just mix a transparent and opaque material. If the normal faces the camera, select the transparent material. If the normal is perpendicular to the camera, select the opaque material.
I have tried fresnel but it is meant for items refracting light.
I have tried the normal node but can't get it to work. I think that if I just use this correctly, this is the right way.
I have tried taking the normal of the object, normalize it and dot-product with the camera normal (normalized). It gives the result below. It is in the right ballpark, but not correct. Nevermind that it is black.
If I reverse the shaders I will get something like a puff of smoke, gradually becoming transparent at the edges.