Unlit, always bright textures, but without using lights.rad Created 1 year ago2022-04-11 13:33:13 UTC by StinkyNEET StinkyNEET

Created 1 year ago2022-04-11 13:33:13 UTC by StinkyNEET StinkyNEET

Posted 1 year ago2022-04-11 13:33:13 UTC Post #346425
So I'm concepting out a mod and something I want to do is imitate the sector lighting style of old DOOM or Build engine games as opposed to the lightmapped lighting of engines that came after those. While defining my own lighting style and shadows is simple enough with creative texture and geometry, unfortunately I can't simply just not run VRAD when compiling because models need lighting info to be affected by lighting. A work around I thought about was defining most of my textures in a .rad file but with RGB values of 0.1 across the board so that they would be bright and not affected by lightmapping, and then using func_illusionary brushes with light textures for the actual lighting the player doesn't see that is only used to light the models, however that would need ALL of the textures I use to be defined as a light emitting texture and that means literally every texture on every surface would be creating a light entity at compile time.
I'd like to avoid this if possible and I'm wondering if there is a way to make a map texture fullbright/unlit but not actually create a light that serves no purpose at run time.
Posted 1 year ago2022-04-11 18:19:27 UTC Post #346426
A glowing texture is one that does not require another form of light to be lit up. It can create its own lightmap independent of all lighting sources and may even create light itself. This does not mean that the surface will appear pure white, just that the face will ignore any light it would receive. This is a key feature as a "glowing" black stays black and does not get brighter. The face achieves what is called fullbright, where the texture's pixels appear exactly the same color as they were saved.

There are several different ways to create this effect available in the Source engine.

For glowing textures on models or brush faces:

$selfillum parameter, specified in a material's VMT. - Use this for most purposes, not compatible with transparency.
UnlitGeneric shader, specified in a material's VMT - Does not emit light, forces face to ignore all lighting, making it fullbright.
$detail parameter with $detailblendmode value of 5 or 6, specified in a material's VMT - Same as $selfillum, but more rudimentary and compatible with transparency.
Using info_lighting to fool a model into thinking it is brightly illuminated.
Posted 1 year ago2022-04-11 18:23:59 UTC Post #346427
VHLT v34 compiler (vluzacn's Half-Life Tools) has light_surface entity, an alternative to info_texlights and .rad files, it should be able to make a texture fullbright without it actually emitting any light. Texture lights do not create light entities, regardless of what you use, .rad, info_texlights or light_surface, and light entities don't count to entity limit anyway, they only count if they are switchable.

Models can only be lit by world surfaces, they would not be lit by func_illusionary. One trick I discovered recently is if you make a brush with it's top textured with BLACK_HIDDEN texture from zhlt.wad (from VHLT v34), other faces with SKIP texture and turn the brush into func_detail, then the brush will be invisible in game, won't block anything but will have a lightmap and affect models on top of it.
Posted 1 year ago2022-04-12 05:56:13 UTC Post #346429
So basically, just make a separate layer of these hidden func_details for any surface a model needs to be on and be lit by. The player isn't ever supposed to see the actual lightmapped lighting except on models, since any lighting and shadow would be defined through specifically made textures colored for purpose.
There are several different ways to create this effect available in the Source engine.
Yeah I should have specified this was for GoldSrc, I wouldn't have asked this if this was a Source project since this effect is much simpler to achieve in Source because of its material system.
Posted 1 year ago2022-04-13 14:17:39 UTC Post #346433
Its possible to read in the lightmaps and change them (like below pic) maybe read every faces lightmap and set it to the average, this would give a flat shaded look, but I think that you would get weird shading where the faces are spilt.

Example

I wonder what effect setting -chop # Set radiosity patch size for normal textures.
You must be logged in to post a response.