Code Monkey home page Code Monkey logo

gradle-mali-plugin's Introduction

gradle-mali-plugin

Build Status

Gradle plugin for the Mali Texture Compression Tool

How to use

First, download and install the Mali Texture Compression Tool from the official website.

Note the path to the /bin directory once installed.

Next, add the following buildscript configuration to the top of your build.gradle

buildscript {
    repositories {
        mavenLocal()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath group: 'org.mini2Dx', name: 'mali', version: '1.0.0'
    }
}

Then add the plugin configuration to your project and set the folders/paths as appropriate.

project(":projectName") {
   apply plugin: "org.mini2Dx.mali"
   
   ........

   mali {
      inputPaths = ["../preprocess/backgrounds"]
      outputPaths = ["../assets/backgrounds"]
      maliBinFolderPath = "/path/to/mali/bin/directory/"
      
      etc {
         enabled = true
         ktx = true
         mipmaps = true
      }
   }
}

The plugin will add the following tasks to your project.

Task Description
compressTextures Compresses textures using Mali per the configuration

Advanced Configuration

The following example shows all options in use.

project(":projectName") {
   apply plugin: "org.mini2Dx.mali"
   
   ........

   mali {
      inputPaths = ["../preprocess/backgrounds"]
      outputPaths = ["../assets/backgrounds"]
      
      //Specify paths for different platforms for cross-platform builds
      maliWindowsBinFolderPath = "C:\\path\\to\\windows\\mali\\bin\\directory"
      maliMacBinFolderPath = "/path/to/mac/mali/bin/directory/"
      maliLinuxBinFolderPath = "/path/to/linux/mali/bin/directory/"
      
      etc {
         //Enable/disable ETC compression
         enabled = false
         //Set to false for slower more thorough optimal quality search
         fastCompression = true
         //Set to false to use non-perceptual (highest PSNR)
         perceptual = true
         //Set to true to use ETC2 compression.
         //ETC1 is most compatible, ETC2 has highest quality.
         etc2 = false
         //The compressed format.
         //Can be- R, R_signed, RG, RG_signed, RGB, RGBA1, RGBA8 or RGBA.
         //Defaults to RGB.
         format = "RGB"
         //Set to true to enable mipmaps
         mipmaps = false
         //Set to true to ouput KTX format instead of PKM
         ktx = false
         //Set to true for verbose output
         verbose = false
         //Set to true to output progress
         progress = false
      }
      astc {
         //Enable/disable ASTC compression
         enabled = false
         //Set the speed/quality tradeoff.
         //Can be veryfast, fast, medium, thorough or exhaustive.
         //Defaults to medium.
         compressionSpeed = "medium"
         //Sets the bits per texel
         bitsPerTexel = "8.0"
         //Set to true to treat textures as RGBA
         alphablend = false
         //Set to true to treat textures as HDR
         hdr = false
      }
   }
}

gradle-mali-plugin's People

Contributors

tomcashman avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.