4.12 breaks TextureLODGroups LODBias on iOS

We’re using LODBias in the TextureLODGroups for reducing memory usage on lower end iOS devices that only have 1GB of memory. This has been broken in 4.12.

This change in Engine/Source/Runtime/Engine/Private/TextureLODSettings.cpp

	// Calculate LOD bias.
	int32 UsedLODBias	= NumCinematicMipLevels;
	if (!FPlatformProperties::RequiresCookedData())
	{
		// When cooking, LODBias and LODGroupInfo.LODBias are taken into account to strip the top mips.
		// Considering them again here would apply them twice.
		UsedLODBias	+= LODBias + LODGroupInfo.LODBias;
	}

On iOS we have a base device profile with all LODBias values set to 0 (so the cooker shouldn’t be stripping the top mips) and then override it for device profiles of 1GB devices. This change means that the LODBias doesn’t get applied at runtime.

Regards,

Ryan.

Hey -

Based on the comment in the if() statement it appears this block of code was not functioning appropriately before and this change was added to fix that. To help me understand exactly what’s happening, can you provide where/how you are overriding the 1GB device profiles? Additionally, what 1GB device(s) are you testing this on? If possible, could you also provide a sample mesh with a material that has multiple LODs that causes the issue for you to help me test locally?

Hey -

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Cheers

Sorry , we’ve been trying to get our game shipped and I haven’t had time to sort out repro steps. It should be pretty straight forward:

Create a mobile project. Then in the projects config folder add a DefaultDeviceProfiles.ini

Add three device profiles:

[IOS DeviceProfile]
DeviceType=IOS
BaseProfileName=
+TextureLODGroups=(Group=TEXTUREGROUP_World,LODBias=0,NumStreamedMips=-1,MipGenSettings=TMGS_SimpleAverage,MinLODSize=1,MaxLODSize=1024,MinMagFilter="aniso",MipFilter="point")

[iPhone6S DeviceProfile]
DeviceType=IOS
BaseProfileName=IOS

[iPhone6SPlus DeviceProfile]
DeviceType=IOS
BaseProfileName=IOS
+TextureLODGroups=(Group=TEXTUREGROUP_World,LODBias=4,NumStreamedMips=-1,MipGenSettings=TMGS_SimpleAverage,MinLODSize=1,MaxLODSize=1024,MinMagFilter="aniso",MipFilter="point")

I’ve used iPhone6S and 6SPlus here but you can use which ever two iOS devices you have to test on.

Note I’ve set the LODBias for the 6SPlus to 4 which means any texture in the World group should be a blurry mess on that devices.

Add a static mesh to the world with a world group texture on it. The iPhone 6S should look fine and the 6SPlus should be mipped down, but it isn’t.

Regards,

Ryan.

Thank you for the information about your setup. To help provide further information, can you let me know if you get the same result if you create a device profile from within the editor rather than setting it up manually?