Giter VIP home page Giter VIP logo

unity-ycca-subsampling's Introduction

YCCA Subsampling for Unity

YCCA subsampling is a set of lossy texture compression formats inspired by ChromaPack. You can choose bpp (bits per pixel) from 12, 14 and 24. The main difference from ChromaPack is that they support alpha. Preview

Read before trying this repository!

  • Use ETC2 on mobile platforms where OpenGL ES 3.0 is supported.
  • Use ASTC or DXTC for PCs.
  • Try ETC/PVRTC and (half-resolution) alpha mask.
  • Try this repository only if none of the above satisfies your requirements.

Overview

  • RGB is encoded into YCgCo, which can be decoded effectively.
    • Other color spaces (e.g. YCbCr which is used in ChromaPack) can be supported by slightly modifying the encoder and decoder, but currently they are not supported.
    • Note that effectiveness is not certain, because YCgCo and YCbCr are equivalent in decoding time where matrix multiplication is fast enough.
  • Y channel is stored without compression (Alpha 8).
  • Cg Co and Alpha channels are stored in compressed formats, such as:
    • 4 bpp block compression formats (ETC1, PVRTC or DXT1).
    • RGB24 and RGB565 with scaling-down.

How to use

  1. Click the menu "Window/YCgACo Editor".
  2. Select source image, and then click "Generate Y, CgACo and Material".
  3. Change format and quality, and click "Apply" if you need.

Editor1 Editor2

Dummy PNG + user data + postprocess

YCgACo Editor does not produce PNG file which contains texture data. Instead, it produces 1 pixel dummy PNG files, and meta files which contains the source image GUID and target compression format as AssetImporter.userData. The dummy PNGs are imported as actual encoded textures when they are post-processed by YCgACoPostprocessor.

Examples

  • Assets/YccaSubsamplingTest/Circle/Circle.png 128x128 pixels Examples

TODO

  • Reimporting encoded textures when the source texture is updated.
  • Support YCbCr and other color spaces (e.g. PCA-based color space).
  • Scaling CgACo textures in order to achieve flexible bits per pixel.
  • Writing a decoder as a matrix multiplication and measure performances.

unity-ycca-subsampling's People

Contributors

n-yoda avatar

Watchers

 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.