Open roy-t opened 2 years ago
After comparing the values in my basis_compressor_params
with those generated by the command line tool I figured it out.
By default m_quality_level
is set to -1
. In the command line tool there is an extra check to make sure the quality level is set to a reasonable value.
if (m_comp_params.m_quality_level != -1)
{
m_comp_params.m_max_endpoint_clusters = 0;
m_comp_params.m_max_selector_clusters = 0;
}
else if ((!m_comp_params.m_max_endpoint_clusters) || (!m_comp_params.m_max_selector_clusters))
{
m_comp_params.m_max_endpoint_clusters = 0;
m_comp_params.m_max_selector_clusters = 0;
m_comp_params.m_quality_level = 128;
}
This check should probably be moved to basisu_comp.cpp
to make sure m_quality_level
always has a reasonable value. I think it should be placed in basisu_comp.ccp:1045 (the start of the bool basis_compressor::process_frontend()
method).
I'll try to create a MR to fix this.
This also explains why it only happens in ETC1S
mode as the -q
or m_quality_level
setting only applies to ETC1S
.
Sorry for the confusion - the encoder was first written as part of the command line tool, then over time it got separated out. I will integrate your PR either tonight or tomorrow.
I'm trying to integrate basisu as a static library. To do so I've created the class that is listed below. The strange thing is that everything seems to work when I use
uastc
encoding. But when I useetc1s
encoding the compresser fails withcECFailedFrontEnd
.The source file is a 1024x1024 TGA file with alpha channel. When I build basis as a command line tool, and try to encode it, I encouter no problems.
I guess this means I'm doing something wrong, but I can't figure it out. The basis set-up in my code looks exactly the same as in the README.
I'm using the latest version in this repository at this time (commit
1f4b564ae0b8ec1e67f21f058e53112d0405a25a
),