MontyTRC89 / Tomb-Editor

Tomb Editor
57 stars 16 forks source link

Dynamic lighting is omitted if the room has no textures #799

Open GeckoKid-JW opened 5 months ago

GeckoKid-JW commented 5 months ago

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 🤔

Raildex commented 5 months ago

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 commented 1 month ago

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.