EF_INVLIGHT
flag, which inverts the direction of the lighting. The Barnacle will look for its lighting info above the origin point. As you can see from the screenshot below, the barnacle is lit up in green and it'll ignore the blue light below it. effects
KV with a value of 16 (if the effects
KV already exists, add 16 to its current value). This flag can be useful for models such as chandeliers.
Lighting info is grabbed from any surface that holds lightmap data. This includes all solid world geometry, but not brush entities, such as 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.
light_environment
sets using a set of CVARs (sv_skyvec_*
for X,Y,Z of a unit vector). If they can, then they will override their lighting with the calculated sky colour, which light_environment
also sets in another set of CVARs (sv_skycolor_*
for R,G,B). Basically, if entities can see the sky from the skylight's angle, they will be lit exclusively by skylight.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
, with 'Is Sky' to 'Yes'.
The light_spot
lights your outside area just like the light_environment
does but since it's not a light_environment
it won't override model lighting. 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.
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 Trees, or prop models.
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.