I want a 2d image of the sun at the sun position at the sky.
My solution is to attach a picture at the guiNode and tranform the world position to screen position.
But the problem is, that the sun is visible through the whole world because its on the guiNode.
I tried Bucket.Sky but thereby the sun disappears
You can modify the Fog Filter to exclude the sky by making a minor alteration to the frag shader.
if (z == 1.0) discard;
This is assuming that the depth is referenced by a variable named z… could be depth… or something similar. Anyways… use a local copy of the filter and the above line before the frag color is set and it will do what you are looking for.
EDIT: This is something that should already be part of the Filter (or at least I thought it was added way back when…) If it was… there should be a boolean uniform that can be set via the filter.