The android dev guide has a helper class to load the compression format. You can use etcpack to do compression. Note that you will not get an alpha channel with ETC1 - you can do some fancy fragment shading tricks to get around that by having the alpha channel as a separate texture. Just wanted to point out etc1 isn't supported by all android devices, contrary to what gergonzalez said.
Caution: The ETC1 format is supported by most Android devices, but it not guaranteed to be available. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 9 years, 9 months ago. Active 4 years, 6 months ago. Viewed 48k times. Could some point me in the right direction or offer some examples as I cannot find anything.
Improve this question. Peter O. ETC and DXT formats have quite a lot in common, which allowed us to modify the original Crunch algorithm in such a way, so that it can now be used for compression of both formats.
Below you can see the examples of the textures compressed with Crunch using default quality settings. You can download the Let us know what you think on the Unity Beta Forum and please send us a bug report if you run into any issues.
Unity Blog. Updated Crunch texture compression library. November 15, in Technology 4 min. Topics covered Graphics Core performance. Open the AssetPackInfoController.
The AssetPackInfoController class keeps track of the state of its assigned asset pack. The UpdateDownloading function is currently empty. We will add code to manage an active download based on the AssetDeliveryStatus of an active Play Asset Delivery request.
Add the following code to UpdateDownloading :. UpdateDownloading handles several different conditions reported by the AssetDeliveryStatus of an active delivery request:. We have completed adding the necessary code to implement asset pack support. Our next step is to test our modified example on a local build. Play Asset Delivery supports local testing on a device without having to upload a build to Google Play.
There are a few important differences and limitations to be aware of when testing locally:. Unity includes app bundles as an option in the Android platform build settings. However, Unity is not aware of asset packs and will not include them in an app bundle when using the standard build commands. The Play Asset Delivery plugin installs additional menu items to build app bundles with asset packs.
These commands are available in the Google menu of the Unity menu bar. Note that the asset pack list in the UI is now populated. The On Demand pack has not been downloaded yet, and the images it contains are missing from the image list.
Tapping the Download size in MB button will retrieve the images and add them to the image list you may need to scroll down in the UI to see them.
In order to upload a build of the example project to Google Play, we will need to change its package name to a unique identifier, and create a keystore to generate a signed release build. Every Android app has a unique application ID that looks like a Java package name, such as com. If you already have a game released or uploaded to the Play Console, you already chose a package name for it. The example project currently has an application id of com. To be able to upload it on your account, you need to choose a new, unique application id.
Open the Player Settings from the Build Settings window. Android requires that all apps are digitally signed with a certificate before they are installed on a device or updated. We'll create a "Keystore" for the game in this codelab. If you're publishing an update to an existing game, reuse the same Keystore as you did for releasing previous versions of the app.
You can create a Keystore with Android Studio or generate one on the command line. Using the command line, navigate to a folder where you want to store the key, then run keytool:.
Answer the questions about your identity and confirm by entering "yes" when asked if the details are correct. You'll need to enter a password and an alias password. Now that you have a keystore, navigate to Player Settings from the Build Settings window.
In the Android tab, open the Publishing Settings section. Check Custom Keystore , and then select your keystore file. Enter the password that was used for the keystore, the alias name and the alias password.
These are the ones you chose when creating the keystore using Android Studio or the keytool command line tool. Note that the keytool command uses the same password for the keystore and alias, which is acceptable for this codelab but discouraged for production apps. Internal app sharing can be used to easily install builds uploaded to Google Play. To test the example app using internal app sharing, do the following:.
The plugin's user interface to configure asset packs is easy to use, but has limitations. It only allows for asset packs to be configured from AssetBundles found in specified folders.
It creates an asset pack for each AssetBundle it finds, naming each asset pack for the AssetBundle it contains. For games that have data architecture requirements that do not fit within this model, it is possible to generate asset packs programmatically through editor scripts. These asset packs can contain any number of AssetBundles, discrete files, or both. In its initial state, the example loaded a discrete asset file from StreamingAssets in addition to the AssetBundles.
When we switched to the plugin asset pack generation, that discrete asset was no longer being included in the runtime data.
We will change our asset pack generation process to create a new asset pack that contains the missing discrete asset, in addition to generating the AssetBundle asset packs. First, we will remove the existing asset pack configuration.
Click the two Remove buttons to remove the folders from the current configuration and then close the Asset Delivery window. Next, open the BuildRuntimeAssets. Begin by adding the following lines at the bottom of the list of using statements:. Next, add the following code inside the BuildRuntimeAssets class:. AssetPackConfig is used to define the contents of asset packs and to save the new asset pack configuration.
The plugin build commands from the Google menu in the Unity menu bar use this saved configuration to generate the asset packs when building an Android App Bundle. BuildBundle function to programmatically build an Android App Bundle. We will now add some code to use this functionality to access our new asset pack containing the discrete image file. Next, we need to implement the LoadDiscreteAssetPack function referenced by our new code.
GetAssetLocation function to retrieve location and size information about the asset we want to load. Now that we are generating the discretepack asset pack file, we need to add it to our list of asset packs in the example UI.
Add the following line to the bottom of the Start function:. We need to make a modification to UpdateDownloading to handle completing a download of our new asset pack. Find the if gameAssetPack. IsSingleAssetBundlePack statement and add the following else block to it:.
When the updated example launches, the discrete asset pack will be displayed in the UI list:. The Play Asset Delivery plugin includes functions to ask for this consent and report the results. While the code we added handles this scenario, the current on-demand asset pack is well under the size limit. To validate this behavior, we need to increase the size of the on-demand asset pack and submit a new build to Google Play.
In the Unity Project explorer, select the Padding folder in the main Assets folder. Make a group selection of all the numbered Padding images in the folder. Texture Compression A method of storing data that reduces the amount of storage space it requires. See in Glossary. For advice on using these formats, see the Texture Compression section below. Selecting Internal hides the Export Project checkbox. Supports direct Build and Run and exporting the Project to a directory.
This is the default Build System for Unity. Export the Project as a Gradle project that you can import into Android Studio. Selecting this option also lets you configure the Warn about App Bundle Size option in the Player settings Settings that let you set various player-specific options for the final game built by Unity. A drop-down list of attached devices on which you can test your build.
A development build includes debug symbols and enables the Profiler A window that helps you to optimize your game. It shows how much time is spent in the various areas of your game. For example, it can report the percentage of time spent rendering , animating, or in your game logic. Selecting Development Build allows you to select the Autoconnect Profiler, Script Debugging, and Scripts A piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like.
More info See in Glossary Only Build options. Allows the Profiler to automatically connect to the build. Selectable when the Development Build option is selected. For more information on the Profiler, see Profiler Overview.
0コメント