Package Fail: CompressedFormat == PF_Unknown || CompressedFormat == CompressedMip[0].PixelFormat

Hi Everyone

I am trying to package a VR game for the quest 2 that I have built to android vulkan. The game packages successfully BEFORE I build the lighting. AFTER I build lighting I get a error during cooking That says:

“LogWindows: Error: Error reentered: Assertion failed: CompressedFormat == PF_Unknown || CompressedFormat == CompressedMip[0].PixelFormat [File:D:/build/++UE5/Sync/Engine/Source/Runtime/Engine/Private/VT/VirtualTextureDataBuilder.cpp] [Line: 673]”

(See full output log atttached).

I am on Unreal engine 5 early access but the error is happening on 4.26 as well.

I can’t find any help on this particular error, any advice appreciated.

Changelog.txt (95.9 KB)

4 Likes

You are not alone in this Unreal Engine 4.27 Preview - #193 by motorsep

I reported the bug, pinged Epic and @VictorLerp on Discord, but haven’t heard anything back. Let’s hope it will be fixed (preferably in 4.27 hotfix or something).

Hey Is there any solution for this now?

Hello,
I am having the same issue with UE v4.27.2
I am trying to package for the ASTC platform (for Oculus Quest 2) using Virtual Textures (but no Runtime Virtual Textures) and the package always fails with:

Assertion failed: CompressedFormat == PF_Unknown || CompressedFormat == CompressedMip[0].PixelFormat [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Engine/Private/VT/VirtualTextureDataBuilder.cpp] [Line: 676]

I am using OpenGL and not Vulkan.
It is kinda annoying since I really need to use VT because of the very large textures I am using (importing UDIM textures).
I don’t really understand why this error occurs since the compression format of my textures seems to be OK (DXT1 for color maps and BC5 for normal maps) and works fine when I am not using Virtual Textures.

Did you solve this problem by any chance ?

EDIT: This failure happens when the “Enable virtual texture support on mobile” option is enabled

2 Likes

Do you have an option for VTs for Lightmaps turned on? That created issue for me.

Another thing is that all your VTs need to have power of two padding on in the Texture Editor. Sadly, there is no way to set this for lightmaps, therefor you need to turn off VT for lightmaps.

First of all, thank you very much for answering so fast!

Sadly I have not enbaled the VTs for lightmaps
But my textures didn’t have the power of two padding on in the texture settings
I have tried to rebuild with the power of two padding turned on (even if all my textures are already in power of two since those are UDIM imported textures and UE4 only interprets UDIM as VTs when they are in power of two resolutions - my textures are 256x256)

I still have the same failure both with ASTC and ETC2

Here are screenshots of my current project and texture settings:

Project settings
VTSettings

Texture settings

I am a bit deseperate
I tried to build with UE4.26 with the same result
I am planning to upgrade a copy of the project to UE5 and see if the issue is still there

Thank you for your help

1 Like

Sorry mate, can’t help you with that. I jumped through many hoops to get it working and I still get occasional crash here and there.

Btw, it’s not worth using VTs on mobile though - too expensive, performance wise.

Alright

Well I am trying to use VTs for a very specific usage and I don’t have many other choices since UDIMs work this way with UE4

I will keep digging and try to fix this

Thank you for your help though

EDIT: Doesn’t work on UE5 either

2 Likes

Since UE4 is pretty much done being supported at this point, I recommend making a blank project in UE5 with whatever settings you need and if it crashes, upload this project to be shared with Epic and submit bug report.

I have submitted the issue to Epic.
As I said the engine doesn’t really crash, it just won’t package with mobile virtual textures support enabled.

I also tried to modify the engine source code (4.27) and I managed to package my apk, but the textures are not present when I launch my apk on my Oculus Quest 2.
However I think that I am close to some kind of workaround.
It seems that UE4 (the VirtualTextureDataBuilder to be more specific) doesn’t like virtual textures and misinterprets the Pixel Format of the textures… (is this meant by Epic or is this an oversight?)

Anyway, if I make any progress I’ll keep posting here

Have a good day

2 Likes

Howdy Abs, thank you for working on this what did you do to modify the source code? As I write this I commented out the line that throws the exception and am waiting for the VS build to complete.

I also have an issue with just testing my code using livelink VR preview - this also causes the engine to crash with no Crash report. I think it’s crashing again because of VTs.

Hello
I also commented the line that throws the exception and I forced the compression format of my VTs, and added some logs to determine what condition triggered the assertion

// Added logs
UE_LOG(LogTemp, Warning, TEXT(“Compression Debug Output”));
UE_LOG(LogTemp, Warning, TEXT(“Unknown Compressed Format?: %s”), CompressedFormat == PF_Unknown);
UE_LOG(LogTemp, Warning, TEXT(“Compressed Mip Pixel Format: %d”), (int)CompressedMip[0].PixelFormat);
UE_LOG(LogTemp, Warning, TEXT(“Compressed Pixel Format: %d”));
UE_LOG(LogTemp, Warning, TEXT(“Compression Debug Output: %d”), (int)CompressedFormat);
// Line Causing Assertion
check(CompressedFormat == PF_Unknown || CompressedFormat == CompressedMip[0].PixelFormat);

CompressedFormat = (EPixelFormat)CompressedMip[0];// Tried to replace with = PF_ETC2_RGBA; but textures are broken

This led me to a successful package but the textures didn’t show up in the packaged apk…
I didn’t take the time to dig deeper into the engine but I will eventually

Good luck!

1 Like

Running into this problem also. Abs22x2, mind sharing where you added the commented line? Debugging this currently on my end but thought I would start where you added that log.

Hello
My bad I didn’t precise where I added those lines.
I directly modified the VirtualTextureDataBuilder.cpp (you can find where this file is located into the engine sources with the assertion message) line 676

I encountered this problem when I painted too much grass with the foliage tool on my RVT enabled landscape. After decreasing the number of grass, the packaging is successful.

I don’t have any foliage in my project :confused:

quest does not like open gl
you should disable open gl and only have vulkan, its optimized for vulkan.

Hello,

I will try this then, thank you for the tip.
Why the Quest doesn’t like OpenGL by the way?

I think this issue only happens with unpadded VT textures and/or when you turn on VTs for Lightmaps on mobile. I haven’t seen this error when NOT using VTs.

IDK
it doesn’t make sense to me
vulkan is the “new” thing
but Carmack is TD for Meta
so I do not know why his ogl baby was cast aside for vulkan
IMHO that’s why quest games look like crap
ogl is cleaner and brighter
but
what do I know