Moving objects and lightmaps / dynamic lights

Avatar
cF^
11 Posts
Posted Nov 07, 2011
Hi guys,
New to the board so go easy on me! I'm in the process of creating my first portal 1 level and have hit a problem I can't seem to work out how to solve. I have created a moving platform that hides a bottomless pit (which casts light). My problem is twofold.
Firstly the lightmap created by the orange texture on the bottom of the pit is cast on the surrounding walls when the platform is hiding the pit. I know its baking the lightmap while the pit is not covered as the pit platform starts hidden but I'm not sure how to go about fixing this (putting the platform on top when baking would only cause the opposite problem of no light cast when the pit is open).
Secondly, as the moving platform is out of the environment when light is baked, the surfaces are unlit when they enter the world. I've added a couple of screenies so you might understand my problem better.
Cheers,
Door Open
Door Closed
Advertisement
Registered users don’t see ads! Register now!
Avatar
Brainstone
401 Posts
Posted Nov 07, 2011
Replied 15 hours later
In Hammer, all the lightmaps are created in the compiling process (before you play the map), not during the game itself. That means, if your door starts open, the orange light will be calculated to be everywhere.
If the door starts closed, the lights will never shine through the door, even when it opens. The solution to this problem is to add a dynamic light at the bottom of the pit. Dynamic lights are entities called light_dynanamic and are calculated during playing the map. Therefor they cost a lot more power for your PC. Only one dynamic light can be active at a time. The orange textures which you have at the bottom of the pit emit light, but can never be dynamic. You will have to delete them.
Also, your door must be a entity, which is able to cast shadows.

Hope that helped and you understood. :smile:

Avatar
ChickenMobile
2,460 Posts
Posted Nov 08, 2011
Replied 7 hours later
You said it man! Dynamic lights are the way to go for this one.
Avatar
cF^
11 Posts
Posted Nov 08, 2011
Replied 1 hour later
I've gotten rid of the orange light texture on the floor of the pit to get rid of the shadows being cast. My next problem is making the brushes cast shadows. Currently they are just func_brush. Is there another brush I can change them to or how do I go about creating an entity that will do the same job?

Cheers for all the help! :smile:

Avatar
Moth
225 Posts
Posted Nov 08, 2011
Replied 2 hours later

Shadows are determined by positioning of lights and objects blocking those lights, in combination with lightmap texture sizes and less commonly, light-emitting textures.

You can't just magically create shadows. Try placing a light_spot behind a beam, and lower the lightmap size on an opposite wall. EXPERIMENT! learn the different kinds of light and how they work.

The Valve wiki is your friend:

http://developer.valvesoftware.com/wiki/Lighting

Most people here, myself included, started out like you with very little knowledge. Don't be disheartened or daunted. We're here to help, provided your questions aren't too stupid :-p

Avatar
Vordwann
767 Posts
Posted Nov 08, 2011
Replied 1 hour later
VALVE YOU NEED TO MAKE ALL LIGHTING IN SOURCE DYNAMIC! PLEASE!
Avatar
Spam Nugget
492 Posts
Posted Nov 08, 2011
Replied 50 minutes later
...but only if they can find a way to do so without causing SERIOUS LAG.
Avatar
Moth
225 Posts
Posted Nov 08, 2011
Replied 38 minutes later
If you're looking for completely dynamic lighting, look at idTech 4 (DOOM3 engine)

Source has its roots in the original Quake, and uses BSP, which doesn't fully support real-time dynamic lighting, or per-pixel lighting which is what idTech uses.

I used to map for idTech and whilst it has some nice features, like thre complete lack of a compile stage (because it's all realtime) - it's not as versatile, modular or flexible as Source.

Advanced lighting techniques in Source are easy once you learn the tricks.

A bad workman always blames his tools...

Avatar
cF^
11 Posts
Posted Nov 08, 2011
Replied 4 hours later
Hi guys,
Thanks for all the positive input. I do have an understanding of how lightmaps work and understand the compile process to an extent. My reply was simply to understand which objects cast dynamic shadows as it appears that my bsp brushes are not i.e when my door is closed the dynamic light can be seen in the room and casts light on the walls, though I wish for a shadow to be cast by the closed doors(currently func_brushes).
It seems like a really nice community here, thanks for all the help :smile:
Avatar
Vordwann
767 Posts
Posted Nov 08, 2011
Replied 5 hours later
Moth lol I have no problem with the source tools, I love them. I just think it would be better if they had dynamic lighting. Source IS becoming outdated. No matter what anyone thinks.
Avatar
Brainstone
401 Posts
Posted Nov 09, 2011
Replied 15 hours later
Double click on the func_brush and set "shadows" to yes
Avatar
cF^
11 Posts
Posted Nov 09, 2011
Replied 4 hours later
Cheers but that doesn't seem to work for dynamic shadows, just lightmap shadows. I'm trying to block the dynamic shadows of the light which is inside the pit with these 2 brushes, it seems it can't be done?! :sad:
Avatar
Brainstone
401 Posts
Posted Nov 09, 2011
Replied 4 hours later
Well it surely can be done by using a env_projectedtexture instead of a light_dynamic. Those are also dynamic lights. You have to set "cast shadows" to yes. Projectedtextures are entities perfect for any porpose with shadows. Almost every Portal 2 mapper uses them alot. However, they don't cast light everywhere, but only in a certain angle, called "FOV". I don't know how wide this angle can maximal be. You can increase its size to 360 and set the colour to orange.
Avatar
Moth
225 Posts
Posted Nov 10, 2011
Replied 9 hours later

I'm assuming that you already know about the tool textures?:

http://developer.valvesoftware.com/wiki/Tool_textures

There's one called 'Blocklight' img

It's normally used for casting artificial shadows (it blocks light) but it may be useful in this case, though without examining your VMF, this is just a guess:

try placing some thin brushes textured on all sides with blocklight, on the floor surrounding your pit, where the unwanted shadows are. The blocklight brush will either remove all the shadows, or create a larger solid black one :-p

Also try raising the lightmap size on the brush that is the floor, to 24 or 32 to smooth the shadow effects out

Advertisement
Registered users don’t see ads! Register now!
Avatar
cF^
11 Posts
Posted Nov 10, 2011
Replied 4 hours later
Cheers for the advice, I'll have a look at blocklight and projectedtexture tonight and see what I can do with them =)