I solved problem with colors.
But Now I’m trying to calculate sun position in screen space.

To add vector ‘to sun direction’ with different lengths to camera position is not working.
When I do not move camera, but just rotate it, the sun is moving in the sky.

You can see that on screenshots: the ‘camera pos’ is the same, ‘camera dir’ is different:

Choose the sun position (i.e. direction) in world space and give it a W component equal to zero. Then apply the usual transformations: model-view matrix, projection matrix, division by W, viewport transformation. Note that NDC Z will be greater than 1 (unless the far plane is at infinity), so you can’t just feed it to OpenGL as a normal object as it will get clipped out by the far plane.

If you want to render the sun using OpenGL, you can’t just treat it like a normal part of the scene. If you pick a point that’s closer than infinity, then it’s going to move if the camera position moves. If you pick a point at infinity it’s going to be clipped out by the far plane (unless your far distance is at infinity, and maybe even then). The usual solution is to have a separate model-view matrix for rendering the skybox (which needn’t be a literal box); this has the same rotation as the real model-view matrix but no translation, so the origin is always at the view position. You still need to pick an appropriate depth so that the sun is behind everything but the skybox.

I’d assume that it’s the foliage that’s causing this.

One option is to apply some form of “despeckle” filter to the silhouette. Simply down-sampling it may work. Another is to use a filtered texture when rendering the trees into the silhouette (assuming that the silhouette is rendered as a separate pass, not generated from the main render pass).