Tomb-Editor icon indicating copy to clipboard operation
Tomb-Editor copied to clipboard

Dynamic lighting is omitted if the room has no textures

Open GeckoKid-JW opened this issue 10 months ago • 2 comments

This means lara would appear flat in sky rooms which is not desired. image

This happens both in tr4 and TEN it seems.

According to Raildex the light is actually in the level but somehow without vertices in the room lara doesn't get lit either 🤔

GeckoKid-JW avatar Apr 05 '24 11:04 GeckoKid-JW

Lighting works correctly in NGLE/winroomedit compiled levels. Here is a level compiled with winroomedit: catacomb.zip

I could not find any differences in the room flags. Bytewise inspection of the level file is difficult, because it's zlib-compressed

Raildex avatar Apr 05 '24 11:04 Raildex

I investigated TOMB4 code. There is the following condition:

if(!r->nVerts) {
	r->num_lights = 0;
	r->SourceVB = 0;
	return;
}

So when a room has no vertices ,which happens when there is a portal on each side or all textures are filled with invisible texture, the lights are automatically set to 0.

TE should write a single vertex and zero triangles and zero quads.

Raildex avatar Jul 22 '24 07:07 Raildex