Add ETC support to mipgen / imageio / suzanne.
This shrinks file size as follows, although it seems to darken the rendered result. ``` 1398209 Oct 2 16:22 ao.ktx 699172 Oct 2 16:20 ao_etc.ktx 1398209 Oct 2 16:22 metallic.ktx 699172 Oct 2 16:19 metallic_etc.ktx 1398209 Oct 2 16:22 roughness.ktx 699172 Oct 2 16:20 roughness_etc.ktx ```
This commit is contained in:
@@ -66,14 +66,6 @@ static Texture* setTextureParameter(Engine& engine, filaweb::Asset& asset, strin
|
||||
asset->texture.reset();
|
||||
};
|
||||
|
||||
Texture::Format format;
|
||||
switch (info.glTypeSize) {
|
||||
case 1: format = Texture::Format::R; break;
|
||||
case 2: format = Texture::Format::RG; break;
|
||||
case 3: format = Texture::Format::RGB; break;
|
||||
case 4: format = Texture::Format::RGBA; break;
|
||||
}
|
||||
|
||||
uint8_t* data;
|
||||
uint32_t nbytes;
|
||||
asset.texture->getBlob({}, &data, &nbytes);
|
||||
@@ -97,6 +89,14 @@ static Texture* setTextureParameter(Engine& engine, filaweb::Asset& asset, strin
|
||||
return texture;
|
||||
}
|
||||
|
||||
Texture::Format format;
|
||||
switch (info.glTypeSize) {
|
||||
case 1: format = Texture::Format::R; break;
|
||||
case 2: format = Texture::Format::RG; break;
|
||||
case 3: format = Texture::Format::RGB; break;
|
||||
case 4: format = Texture::Format::RGBA; break;
|
||||
}
|
||||
|
||||
Texture::PixelBufferDescriptor pb(data, nbytes, format, Texture::Type::UBYTE, destructor,
|
||||
&asset);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user