设置设备配置文件

设置设备特定配置的最佳方法是在项目内部创建一个自定义的 Config/DefaultDeviceProfiles.ini。 您可以在设备配置文件中设置许多属性,比如纹理库大小;建议采用这种方式在不同的移动设备上或 PC/Mac 上的扩展性设置存储段中处理扩展性。

[iPhone5 DeviceProfile]
DeviceType=IOS
BaseProfileName=IOS
MeshLODSettings=
TextureLODSettings=
+CVars=r.RenderTargetSwitchWorkaround=1

[iPhone5S DeviceProfile]
DeviceType=IOS
BaseProfileName=IOS
MeshLODSettings=
TextureLODSettings=
+CVars=r.MobileContentScaleFactor=2
+CVars=r.BloomQuality=1
+CVars=r.DepthOfFieldQuality=1
+CVars=r.LightShaftQuality=1

有关设置配置文件的更多信息,请参阅主要的 配置文件 文档。

iOS

设备配置文件可用于设置 iOS 设备的游戏分辨率。r.MobileContentScaleFactor 属性与设备的 '标称 iOS 分辨率' 有关。 例如,Retina 屏幕版 iPad 的实际分辨率为 2048x1536,但标称分辨率为 1024x768,因此采用 2.0 才能获得原始分辨率。 如果想要提高分辨率,但又不希望因为以原始分辨率运行而达到最佳性能,还可以使用分数值(如 1.5)。

[iPad3 DeviceProfile]
+CVars=r.MobileContentScaleFactor=1

[iPad4 DeviceProfile]
+CVars=r.MobileContentScaleFactor=2

[iPadAir DeviceProfile]
+CVars=r.MobileContentScaleFactor=2

iOS 设备配置文件可在 Engine\Config 中的 BaseDeviceProfiles 中找到。这些类别通过插件系统进行设置, 而默认插件为 iOSDeviceProfileSelector。iOS 设备类别就是设备的名称。

安卓

安卓具有分层次的设备配置文件类别 (see BaseDeviceProfiles.ini in Engine\Config for examples)。这些类别通过插件系统进行设置, 而默认插件为 AndroidDeviceProfileSelector