Jump to content

Force filter trilinear and dxt compression


photo

Recommended Posts

it will be a good idea to add a possibility to force mipmap, in the unigine code if the image don't have mipmap the filter flags is removed :

 

// check texture flags

if(image.getNumMipmaps() == 1 && (flags & (Texture::FILTER_BILINEAR | Texture::FILTER_TRILINEAR))) {

flags = (flags & ~Texture::FILTER_MASK) | Texture::FILTER_LINEAR;

 

}

 

To have the possibility when loading material to force the mimap generation will be great.

 

 

Same things with the dxt format, will be interesting to add dxt format like that :

 

 

int Material::get_texture_format(const char *src) const {

if(!strcmp(src,"srgb")) return Texture::FORMAT_SRGB;

if(!strcmp(src,"signed")) return Texture::FORMAT_SIGNED;

// ADD

// if(!strcmp(src,"dxt")) return Texture::FORMAT_COMPRESSED_DXT;

return -1;

 

}

 

and force the dxt compression when the material is loaded.

 

Thanks

Link to comment

Unigine editor automatically creates mipmaps for textures when the source texture is placed in the folder with "uncompressed" name. Color and normal textures requires different gamma value for mipmaps generation. Moreover it's not possible to create mipmaps for compressed images (decompression/generation/compression is required). The compression time of single 1024x1024 RGB8 image into DXT1 format is 5-10 seconds...

Link to comment

Ok frustum, i will try the uncompressed name for mipmap. About the dxt compression i use an fast dxt SSE compressor it's very good about the performance (but i'm not sur if it is multi platform :) ).

Link to comment
×
×
  • Create New...