Hi! Let's learn how to do shadows PROPERLY. (I'm betting a few of you are already aware of this, but I've seen a number of shots with terrible shadows - I'm here to help them!)
Let's get started!
First, unless you actually want them, disable source's default shadows with r_shadowcolor 255 255 255.
Now - let's roll with two very important values: mat_depthbias_shadowmap 0.00001 (default 0.005) and mat_slopescaledepthbias_shadowmap 2 (default 16)
These two values control the margin for error when casting shadows - to put it simply, lowering these values reduces the distance it takes for a shadow to begin to cast from something.
Set depthbias_shadowmap 0.00001 a little lower higher if you can pull it off without any noticeable artifacting loss, as super low numbers do cause small artifacting! (but nothing that a good editor couldn't take out.)
r_projectedtexture_filter is an especially useful cvar, as it controls the filter / blur level on the shadows. A high value will cause the shadow to be very blurry, whilst low values will make it sharper - and more pixelated, if you use a value too low.
The edges of shadows are and always will be grainy at high filter sizes, there is no way to fix this! Thank nvidia for bitching at Valve years ago, so nobody can get smooth shadow edges.
Finally, the most, MOST important cvar OF THEM ALL!
If you've noticed, the shadows in the previous 4 pictures are far sharper than what you would come to expect of your lamps. This is the cvar responsible for controlling how detailed the shadows are. The default value for this is 1024, meaning the shadowmap would be rendered as a 1024x1024 texture. On very good computers, you can reach up to 8192, though with significant frame loss - nice for final pictures, but not practical for playing everyday gmod with. Always change this value at the main menu, changing it ingame could cause problems. Good shadowmap resolutions that most should be able to cope with are 2048 and 4096, and remember to modify r_projectedtexture_filter accordingly. (0.2 for 4096 and 0.5 for 2048 if you want the shadows to be as sharp as possible without appearing pixelated)
Everything after this point is considered NULL and VOID with the changes to the Lamp STool coming Garry's Mod 13. These are now all things you can do with lamps.
Now, most people are comfortable working with lamps - and they are the most reliable choice if you want to modify your lamps coloring. However, there are also situations where the flashlight would come in handy, as it has many advantages which a lamp doesn't.
FIRST OF ALL, to lock the flashlight into a single position, use r_flashlightlockposition 1.
You can change the nearz and farz of your flashlight, meaning how near to you the light begins, and how far away before it ends. Use this to place your scene inside of the nearz and farz, as it will optimize shadowmapping MASSIVELY.
r_flashlightnear (default 4)
r_flashlightfar (default 750)
While you're setting this up, you can get the handy little box showing you where the nearz and farz are with this cvar!
If you want your flashlight to stay consistantly bright, no matter what distance you're at (this is especially useful for situations where you want a nice looking sunlight) then simply change r_flashlightconstant to a high value, like 100. (default 0)
One of the big advantages flashlights have over lamps, is you can modify their FoV. This changes how wide or narrow the flashlight casts. For example, you may want a light source very near to the scene, but you want it to light up as much as possible - set the FoV high. If you're looking for narrow, distant spotlights or sunlights, then use a narrow FoV.
r_flashlightfov (default 45)
These pictures have adjusted nearz and farz settings as well!
Of course, the one advantage that lamps will have over flashlights is their ability to be colored and moved around a little more easily.. but that's about it.
Hopefully this will help any of you screenshotters with getting nice looking shadows!