Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android build always has Texture Compression set to PVRTC #151

Open
DmiShib opened this issue Aug 26, 2024 · 2 comments
Open

Android build always has Texture Compression set to PVRTC #151

DmiShib opened this issue Aug 26, 2024 · 2 comments
Labels
Milestone

Comments

@DmiShib
Copy link

DmiShib commented Aug 26, 2024

This issue started occurring when I upgraded to 'Unity 6 Preview.'

I investigated this matter and can pinpoint the cause:

BuildReport buildReport = BuildPipeline.BuildPlayer(new BuildPlayerOptions  
{  
    locationPathName = Path.Combine(buildPath, binName),  
    options = options,  
    scenes = releaseType.sceneList.GetActiveSceneFileList(),  
    target = architecture.target,  
    subtarget = (int)architecture.subtarget  
});
  1. For Android, the subtarget is an enum MobileTextureSubtarget.
  2. When creating BuildArchitecture for Android, we don’t pass the fifth argument, so the default parameter value is StandaloneBuildSubtarget.Player
  3. StandaloneBuildSubtarget.Player equals 2, meaning subtarget = 2, which corresponds to MobileTextureSubtarget.PVRTC

If you specify something like subtarget = (int)EditorUserBuildSettings.androidBuildSubtarget, it works correctly, but obviously, that’s not the solution. :)

@DmiShib DmiShib changed the title After build on Android, Texture Compression is always set to PVRTC Android build always has Texture Compression set to PVRTC. Aug 26, 2024
@DmiShib DmiShib changed the title Android build always has Texture Compression set to PVRTC. Android build always has Texture Compression set to PVRTC Aug 26, 2024
@DmiShib
Copy link
Author

DmiShib commented Aug 26, 2024

I want to add that, as a result, there are consequences in Google Play Console: a 66% decrease in supported devices because the following is added to the AndroidManifest: GL_IMG_texture_compression_pvrtc

@robinnorth
Copy link
Collaborator

Thanks for the detailed report, @DmiShib! The build subtarget property for BuildArchitecture was a very recent addition to enable adding support for the Dedicated Server platform, so this is an unintended side-effect of that change. This functionality is still in development, so it hasn't yet been fully tested to catch issues like this – for now, try using the latest released version of SuperUnityBuild, v7.0.0, to avoid this problem.

@robinnorth robinnorth added this to the v8.0.0 milestone Aug 27, 2024
@robinnorth robinnorth added the bug label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants