Coder Social home page Coder Social logo

gdx-ddsdxt's Introduction

GDX-DDSDXT

pure java code for libgdx to load and bind:

  • compressed DXT1/1A/3/5 textures from DDS format files (.dds)
  • various uncompressed argb/xrgb textures from DDS format files (.dds)
  • textures from .dxtn/.dxtn.gz format files.
  • limited support for DDS/DX10, only DXT1A/3/5
  • support for Java ImageIO (read/write) -- .jpg .jpeg .bmp .gif .png .rle

Quick Usage

Maven Repository

<pluginRepositories>
    <pluginRepository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </pluginRepository>
</pluginRepositories>

Maven Dependency

<dependency>
  <groupId>com.github.terefang</groupId>
  <artifactId>gdx-ddsdxt</artifactId>
  <version>VERSION</version>
</dependency>

Conversion

Convert DDS/DXT1 to DXTN format

DXTNLoader.convertDDSToDXTN(Gdx.files.local("test_dxt1.dds"), false, 
    Gdx.files.local("test_1.dxtn"));

Convert DDS/DXT1A to DXTN format

DXTNLoader.convertDDSToDXTN(Gdx.files.local("test_dxt1a.dds"), true, 
    Gdx.files.local("test_1a.dxtn"));

Convert DDS/DXT3/5 to DXTN format

DXTNLoader.convertDDSToDXTN(Gdx.files.local("test_dxt3.dds"), 
    Gdx.files.local("test_3.dxtn"));
DXTNLoader.convertDDSToDXTN(Gdx.files.local("test_dxt5.dds"), 
    Gdx.files.local("test_5.dxtn"));

Loading

load DDS as Texture

this.texture = new Texture(DDSLoader.fromDDS(Gdx.files.local("test_1.dds")));

load DXTN as Texture

this.texture = new Texture(DXTNLoader.fromDXTN(Gdx.files.local("test_5.dxtn")));

Asset-Manager

DxtnTextureLoader.register(assetManager);

assetMeneger.load("test_5.dxtn", Texture.class);
this.texture = assetMeneger.get("test_5.dxtn");

DxtnTextureLoader will delegate to stock libgdx for unrecognized extensions.

TODO

implement more image formats from foreign engines to facilitate reuse (if that makes sense).

DONTS

  • .tga -- shitty legacy format -- use png/jpg/dds
  • .bmp -- yet another legacy format -- use png/jpg/dds

Problem Areas

  • .dds dxt1 textures are not flagged for alpha -- you have to use the loader-parameter.
  • .dxtn textures -- yet another custom format, but does properly handle dxt1a (use "DXTNLoader.convert" to create).

Historic

gdx-ddsdxt's People

Stargazers

 avatar

Watchers

 avatar

Forkers

ixeanor andre111

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.