I've been trying to get an FPS camera to work for a while in Godot, and I've never been able to find/figure out a good solution to weapon clipping.
So far, I've seen the following suggested:
1: Use a raycast to animate the weapon into an idle position when against a wall.
2: Render the weapon in a different viewport
3: Scale the weapon down small enough that it sits within the player's collision shape.
So far all of these options have their problems. I really dislike option #1 as a matter of personal taste but it is also limiting to the size and positions of weapons you can have, because they have to fit inside the player's collision shape.
#2 seems to work, but I'm unable to get environment lighting to affect the weapon, or weapon effects to light the environment while they are rendered separately. This also seems like the most "correct" solution, even though it's a bit clunky to use.

Solution #3 seems to be able to get the best of both worlds, but there's definitely an issue with lighting effects on the weapon, as shadows will overtake it immediately, rather than gradually.
Does anyone know of any other solutions for something like this?
I've done some looking around, and found pretty much only these three solutions, but I haven't found many discussions about these drawbacks.