Hammer Lighting Questions
What I would like is to be able to have a destroyed-aperture themed room with holes in the ceiling, some debris over the holes, perhaps casting bright light and crisp shadows from the props of the debris into the room. With a light_environment set with an angle down toward the ground, a light_spot up above the hole in the roof of the room, a shadow_control set to try and make shadows as dark as possible, and an env_sun, I still can't get the lighting to work properly with all the things I've tried.
I'm curious to hear the "correct" way to light testchambers to have bright light and distinct shadows cast down into a room from things on the ceiling. What works, what do you do when mapping to get the lighting to work correctly to cast distinct beams and shadows?
Thanks in advance!
Be careful though it is expensive to render and only one can be active at a time(the limit can be changed in a mod).Be sure to switch it on when the player enters the room and turn it back off when the player leaves the room.
There's 2 ways you can accomplish what you're trying. Both are expensive, but result in 2 different outcomes.
Way #1:
First, remember that if you want to use the light_environment technique, the origin point of your lighting will be the skybox texture. Also, this lighting generates linearly, which is to say there will be no 'origin' point of the lighting, it just draws straight lines from everywhere the skybox is projecting at the angle that has been determined.
Once you've messed with this and are happy with the 'angle' that the lighting is coming from, start messing with the light colors and shadow colors, until it approximates what you want it to look like. At this point, the lighting will still look like complete shit (which I assume is your problem, and not the lighting not functioning at all), but it's fine, it's just how it works.
The next important step is the lightmap. Select the faces of ONLY the brushes that the light will be projected onto, and change the lightmap down to something like 4 or even 2. The option is in the texture properties (Shift + A). Default is 16, which means the editor compiles one unit of lighting for every 16 units of brush (which causes that globby horrible lighting you're probably seeing). Taking it down to 2 means that you will have 1 unit of lighting every 2 units, which will show much more 'fine' shadows and details per unit.
WARNING: This can dramatically increase your compile times, depending on how good your CPU is, how much detail is being projected, and how many brushes are set to lower lightmaps. The upshot is, this will not affect in-game performance, so that's what you have to weigh vs. the next technique I will discuss:
Way #2:
The env_projectedtexture technique. This light DOES have a point of origin, where all the projections of shadows originate, and will radiate out in a 'cone' shape. This makes it a lot harder to use as a believable "sky" light, but the shadows will be MUCH nicer, and will be 100% dynamic (any and all models and moving objects will cast shadows when in this light)
Things to note:
-Lightmap does NOT affect the detail level of these shadows (they are calculated while in game)
-The downside to this is, it WILL affect in-game performance (this is why there is a limitation on only having 1 per scene)
- shadow_control does nothing to the color and starkness of these shadows, they are controlled by the entity itself (this only matters if you wanted to achieve a very specific look, like a blue-ish shadow falloff, but that's really advanced, and most people won't notice anyway)
- You will probably have to supplement this with static lighting, as the brightness of the env_projectedtexture is pretty low even if you crank it up. This usually means, a very bright light_spot behind it, and a some static lights on the surfaces that the texture is projected to..
When compiling:
Even with your lightmaps set really low, and all your lighting perfectly set-up, it will still look like shit if you're doing 'fast' compiles (the default one). You want to set it up so your models are casting shadows, and you're doing 'long' calculations so they look smoother. This is particularly important for Way #1.
Go to the expert compile options and add these parameters: -final -textureshadows -ldr -StaticPropLighting -StaticPropPolys
Again, obvious warning, but this will take a LOOOONG time if your computer sucks.
Hopefully that helps, if not, post some screenshots of the problem and we can work down from there.
I'm trying to figure out the env_projectedtexture to make a dynamic shadow on some moving panels (just your average func_brushes parented to prop_dynamics).
But. Whatever settings I use on the env_projectedtexture my panels won't cast dynamic shadows...
This guy says you need a some parameter but he won't tell becouse he's mean... 
http://www.youtube.com/watch?v=tTq-hRyx ... re=related
His shadows look awesome though.
Hope somebody here can help me!
Thanks in advance,
MWP
&
MWP wrote:
This guy says you need a some parameter but he won't tell becouse he's mean...
By default, the env_projected_texture has the parameter "Enable shadows" set to "NO", check out that and set it to "yes" 
Oh, and thanks for the reply! <3
Would you mind to let us know what Brightness scale and what Light colour values did you put to the env_proj_tex?
At the bottom of the env_projectedtexture properties, depending on how you have it set up, there should be a variable called Texture Name. Projected textures aren't actual light; they are just a bright texture projected on a surface. This means that if you have an invalid/bad texture being displayed, it may not show up correctly. The texture that seems to work the best would be effects/flashlight002. Try using that.
The other finicky thing to note is how it's turned on. If you have a starting elevator instance in the map, you will notice that it has some fancy shadows. This is a projected texture. Projected textures can only be displayed one at a time because it takes a lot of processing power to display one. When you turn one on, it will automatically turn any other projected textures that are on off. At default, (I think,) projected textures have the 'Enabled' flag on. This turns on that particular projected texture as soon as the map starts. But when the elevator texture turns on, it shuts your other texture down before you can see it. Once you step out of the elevator, create a trigger once that tells the projected texture you want shining to turn on.
Hope this helps! 
Another Bad Pun wrote:
Long story about projected textures
This is also what you see in the PTI maps. If you enter the room the projected texture from the main observation room is off. Then you walk through a trigger and it enables!
Just compile the basic map you see when you open the easy map maker and see this happen!
And a special big and warm thank you for Another Bad Pun. It was the fancy starting elevator instance that kept my projectedtextures from working... (There looking great now)
I'll post the map here when it's done!
Again, thanks too all for thinking with me!
Cheers,
MWP
P.S. really enjoyed playing past power, lpfreaky90
Kaleido wrote:
Hm.. I should probably make a tutorial video on the proper use of lighting in Hammer. I see too many people just content to use instanced lighting or uniform lighting...
I would LOVE to see a video from you.
I promised to post my first SDK map here! I did in another thread, so it's a repost. But, as we say here in the Netherlands: "Promise makes guilt"
http://steamcommunity.com/sharedfiles/f ... d=74347192
Please let me know what you think. And thanks again for all the help!
Nice! I really like the lighting. One thing though:
http://cloud-2.steampowered.com/ugc/559 ... 1DB217053/
You have a light leak under your panels. You can set the radius for 'hard falloff' (that's what that's for) to be smaller so the light won't draw that far through the wall. The dynamic light will fill the rest of the lighting anyway so it won't look bad... the effect was definitely badass when the panels open, but it looks kinda bad when they're closed =\
[EDIT] Fixed the light leaking underneath the panel.