shyoo
December 28, 2018, 2:06am
1
Hi I’m testing about CRN(DXT) texture for B3dm.
**I think **
current cesium (1.5x) has no ability to load mipmaps in compressed texture(ex. dxt with mipmaps) yet.
var mipmap =
(!(defined(internalFormat) && PixelFormat.isCompressedFormat(internalFormat))) &&
((sampler.minificationFilter === TextureMinificationFilter.NEAREST_MIPMAP_NEAREST) ||
(sampler.minificationFilter === TextureMinificationFilter.NEAREST_MIPMAP_LINEAR) ||
(sampler.minificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_NEAREST) ||
(sampler.minificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR));
…
// GLTF_SPEC: Support TEXTURE_CUBE_MAP. https://github.com/KhronosGroup/glTF/issues/40
if (mipmap) {
tx.generateMipmap();
}
``
Have any plan to implement it?
thanks cesium team.
Shyoo.
omar
January 2, 2019, 6:57pm
2
We actually just recently implemented this (loading KTX) in order to support HDR images for image-based lighting (IBL). This is the class:
import when from '../ThirdParty/when.js';
import Check from './Check.js';
import CompressedTextureBuffer from './CompressedTextureBuffer.js';
import defined from './defined.js';
import PixelFormat from './PixelFormat.js';
import Resource from './Resource.js';
import RuntimeError from './RuntimeError.js';
import WebGLConstants from './WebGLConstants.js';
/**
* Asynchronously loads and parses the given URL to a KTX file or parses the raw binary data of a KTX file.
* Returns a promise that will resolve to an object containing the image buffer, width, height and format once loaded,
* or reject if the URL failed to load or failed to parse the data. The data is loaded
* using XMLHttpRequest, which means that in order to make requests to another origin,
* the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
* <p>
* The following are part of the KTX format specification but are not supported:
* <ul>
* <li>Big-endian files</li>
* <li>Metadata</li>
This file has been truncated. show original
It should be able to load the mipmaps. Although I’m not sure if it’ll correctly use it when loading in b3dms. Do you have a sample file that you’ve tried?