Scout-kun is a lie... right?

Unreal Level file content - reverse engineering

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: ividyon, Semfry, zYnthetic

jammer64
Skaarj Scout Skaarj Scout
Posts: 22
Joined: 05 Jan 2010, 02:38

Subject: Unreal Level file content - reverse engineering

Post Posted: 20 Jul 2020, 17:46

Has anyone tried to disassemble unr file to check where are actors, where's lightmap stuff etc.? I wonder if, for example, lightmaps could be replaced with externally calculated ones, having nice baked global illumination, smooth edges and stuff :)

yrex
Skaarj Warrior Skaarj Warrior
Posts: 82
Joined: 07 Oct 2015, 11:19

Subject: Re: Unreal Level file content - reverse engineering

Post Posted: 20 Jul 2020, 20:14

Has anyone tried to disassemble unr file to check where are actors, where's lightmap stuff etc.?

Yes.

I wonder if, for example, lightmaps could be replaced with externally calculated ones, having nice baked global illumination, smooth edges

No. Lightmaps aren't stored as ordinary textures, but as one-bit "hits/doesn't hit" data per each light. This also allows dynamic non-moving lights to have shadows. At best, you could fuzz the borders and hope they look good after Unreal smooths them.
e-mail: ampoyrex at wp dot pl

jammer64
Skaarj Scout Skaarj Scout
Posts: 22
Joined: 05 Jan 2010, 02:38

Subject: Re: Unreal Level file content - reverse engineering

Post Posted: Today, 14:43

That's actually very interesting! So how are lightmaps generated? Engine bakes them in runtime before level shows up, just using masking data from file?

I've just peeked into map file in hex viewer. I guess I see which data portion is lightmap but it seems to display different values than $00/$FF from time to time. Isn't the mask 8bit grayscale by any chance? Unless one byte is just a combination of up to 8 lights on/off per texel.

yrex
Skaarj Warrior Skaarj Warrior
Posts: 82
Joined: 07 Oct 2015, 11:19

Subject: Re: Unreal Level file content - reverse engineering

Post Posted: Today, 18:20

You can observe when lightmaps are generated by doing something like "set light lightbrightness/hue/saturation <number>" and walking around until you see the changes. I think this happens after PreBeginPlay. You can also do "flush" to update all lightmaps. UsePrecache may also affect this somehow.

No, one byte stores 8 texels, although these masks are blurred on runtime, creating grayscale images.
e-mail: ampoyrex at wp dot pl


Who is online

Users browsing this forum: No registered users and 1 guest

Copyright © 2001-2020 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited