func_wall
, func_breakable
, func_train
, etc. Even though those brush entities are affected by lighting, the model lighting will ignore these surfaces and instead look for the next available light info on a world geometry face.func_wall
.
To fix this, you either have to revert the brushes back to world geometry or turn them into func_detail
. Func_detail
technically is not a brush entity, so the model will have no issues taking light info from these surfaces.
Model lighting in outside areas has some special rules. Here is an outside area lit by a light_environment
. As you can see, the light in the bright area and in the shadows affect our model in different ways, as expected.
Things become strange once we add more light sources. The blue point light is completely ignored by the model.
What's going on? All surfaces that are affected by the light_environment
will override any other light info. This is because of a global light value that's being stored in the game. This global light value has the same light colour and intensity as your light_environment
. Whenever you move around on a surface that has a lightmap related to the light_environment
, it'll use this global value to light the model. info_sunlight
. With this you can set a custom global light value. You could set this and adjust the model lighting. However, there is a better and easier way.light_environment
, you can use a light_spot
. Make sure you set 'Is Sky' to 'Yes'.
The light_spot
lights your outside area just like the light_environment
does but it doesn't tie those faces to the global light value. Therefore it'll use the actual light info below the model again.
Another issue with outside areas is the SKY texture. This texture does not hold any lightmap info. If any model is above it, it'll not receive any light at all.
There is a workaround for this issue. You can create a BLACK_HIDDEN brush. Make a new brush with SKIP on all sides and BLACK_HIDDEN on the top surface. These are tool textures found in zhlt.wad. Place this brush above your SKY texture and turn it into func_detail
. Make sure it is non-solid: Passable = Yes (zhlt_noclip 1
).
BLACK_HIDDEN is an invisible brush that will retain lightmap info and enables you to have proper light on models again.
These BLACK_HIDDEN brushes are also great in places where model lighting is unrealistic, such as grates. These are func_wall
, so models will not get their light info from the func_wall
surface but from the light below in the pit (where it is much darker). By putting a BLACK_HIDDEN brush on top of this grate, you can fix this issue.
You could also place these BLACK_HIDDEN brushes in long elevator shafts to keep updating the player model lighting. Or put them across a chasm or broken bridge where players have to jump across. If used with SKIP and zhlt_noclip 1, this brush cannot affect players and monsters so you can place as many as you like.zhlt_copylight
value. Go into the properties of the model you want to adjust, disable SmartEdit and add the keyvalue zhlt_copylight
and a targetname (for example: light_info
). Then create an info_target
entity, name it light_info
and place it somewhere where you'd like to copy the lightmap info from. The model will then copy a small patch of that lightmap under its origin point. This can be very useful for static models such a Xen Tree's.
I hope this tutorial helped you understand model lighting and lightmaps better. May you now create properly lit maps and models!effects
keyvalue with a value of 16
to any monster if you want to invert the lighting direction.You must log in to post a comment. You can login or register a new account.
black_hidden
is allegedly drawn in Sven Co-op, according to this wiki's Tool textures page. I haven't personally verified this; it's probably either an issue with SCHLT or that Sven assumes lightmapped surfaces are drawn.In SC the black_hidden texture is not drawn. It's also hidden.
sv_skyvector_*
andsv_skycolor_*
are the culprits of models forcibly taking the sky's color, because from looking at texlight data itself there's nothing to discern sky light from normal light. The engine probably trace a vector set in sv_skyvector_* from the origin (feet) and if it hits the sky texture, overrides the model's lighting with the sv_skycolor_*.sv_skycolor_*
is read from the brightness value oflight_environment
at map load, andsv_skyvector_*
from the entity's angle also at map load.[2024-09-12] I think I solved the black_hidden debacle. It's hidden as world brush BUT visible when made part of a brush entity. the folks who saw the texture probably didn't realize that it won't work on entities.
[2024-09-15] A primer about origin would be good. Models whose origin are inside the walls won't get lighting and be rendered black, and a way to shift it with QC and HLAM. Additionally, a way to have wall-mounted models take lighting from the walls instead of the floor when you shine a flashlight around, for example. I touched on the latter in my tutorial about model health/hev chargers.