Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Astc normal maps #493

Merged
merged 36 commits into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
cbddc69
Add first implementation of normal map support
wasimabbas-arm Oct 14, 2021
8e9e39f
Fix astc normal mode and add tests
wasimabbas-arm Oct 19, 2021
96364e0
Update docs
abbaswasim Nov 9, 2021
c989580
Update reference images
abbaswasim Nov 15, 2021
bcebc17
Update reference generator script
abbaswasim Nov 15, 2021
e381b43
Add error message when normal mode is used with non-linear textures
abbaswasim Nov 15, 2021
17799dd
Update docs
abbaswasim Nov 15, 2021
2b63d44
Fix astc normal map tests
abbaswasim Nov 26, 2021
1618ca4
Fix some typos
abbaswasim Nov 29, 2021
a90bb69
Add blank line
abbaswasim Nov 30, 2021
22d0dd1
Add Iron_Bars_001_normal and move normal mode swizzle selection to to…
abbaswasim Dec 17, 2021
ca2d9a2
Rename Iron_Bars_001_normal to be more explicit that its not normalized
abbaswasim Dec 21, 2021
dadacb2
Add normalize option
abbaswasim Dec 21, 2021
f054401
Add normalize support
abbaswasim Dec 21, 2021
9636d90
Add normal map .png versions
abbaswasim Dec 21, 2021
4c00a18
Normal map support for different types (uint8, uint16, float32 etc, f…
abbaswasim Dec 23, 2021
1376f77
Change basisu::clamp to cclamp
abbaswasim Dec 29, 2021
d92aa03
Minor documentation changes, remove separateRGToRGBA_A from basis opt…
abbaswasim Feb 4, 2022
0140218
Add normalisation tests
abbaswasim Feb 7, 2022
4ec4dac
Add normal_mode tests for uastc and etc1s
abbaswasim Feb 7, 2022
07b9a46
Corrects documentation
abbaswasim Feb 7, 2022
4c52f30
Corrects documentation
abbaswasim Feb 7, 2022
b43c1df
Remove useless messages from astc-encode
abbaswasim Feb 7, 2022
812bd2b
Change unittests.cpp to image_unittests.cc
abbaswasim Feb 8, 2022
a3f67c4
Add --normalize to normal tests
abbaswasim Feb 8, 2022
edc6b73
Fix writerScParams issues, now correctly encodes encoder params
abbaswasim Feb 8, 2022
dc29f3d
Change golden images after writerScParams bug fix
abbaswasim Feb 8, 2022
7e1384b
Merge branch 'KhronosGroup:master' into astc_normal_maps
wasimabbas-arm Feb 8, 2022
c44f03f
Add space after @b
abbaswasim Feb 8, 2022
a883d71
Fix normalize and normal_mode documentation
abbaswasim Feb 9, 2022
e6d7458
Allow inputSwizzle to be set for normal maps.
abbaswasim Feb 9, 2022
b85772a
Move normal mode swizzle selection to astc_encode and basis_encode
abbaswasim Feb 9, 2022
04f9cb5
Update reference images
abbaswasim Feb 9, 2022
d10c7ce
Fix inputSwizzle and normalSwizzle
abbaswasim Feb 15, 2022
3939a12
Refactor and formating fixes
abbaswasim Feb 15, 2022
2bba286
Limit etc1s test to apple
abbaswasim Feb 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/astc_encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ ktxTexture2_CompressAstcEx(ktxTexture2* This, ktxAstcParams* params) {
astcenc_profile profile{ASTCENC_PRF_LDR_SRGB};

astcenc_swizzle swizzle{ASTCENC_SWZ_R, ASTCENC_SWZ_G, ASTCENC_SWZ_B, ASTCENC_SWZ_A};
const astcenc_swizzle normal_swizzle{ASTCENC_SWZ_R, ASTCENC_SWZ_R, ASTCENC_SWZ_R, ASTCENC_SWZ_G};

uint32_t block_size_x{6};
uint32_t block_size_y{6};
Expand All @@ -609,7 +610,7 @@ ktxTexture2_CompressAstcEx(ktxTexture2* This, ktxAstcParams* params) {
block_size_x, block_size_y, block_size_z);
quality = astcQuality(params->qualityLevel);
profile = astcEncoderAction(*params, BDB);
swizzle = astcSwizzle(*params);
swizzle = params->normalMap ? normal_swizzle : astcSwizzle(*params);
MarkCallow marked this conversation as resolved.
Show resolved Hide resolved

astcenc_config astc_config;
astcenc_context *astc_context;
Expand Down
10 changes: 0 additions & 10 deletions tools/toktx/toktx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1357,11 +1357,6 @@ toktxApp::main(int argc, _TCHAR *argv[])
for (i = 0; i < 4; i++) {
bopts.inputSwizzle[i] = options.inputSwizzle[i];
}
} else if (options.normalMode) {
string normalSwizzle = "rrrg";
for (i = 0; i < 4; i++) {
bopts.inputSwizzle[i] = normalSwizzle[i];
}
} else if (defaultSwizzle.size()) {
for (i = 0; i < 4; i++) {
bopts.inputSwizzle[i] = defaultSwizzle[i];
Expand All @@ -1388,11 +1383,6 @@ toktxApp::main(int argc, _TCHAR *argv[])
for (i = 0; i < options.inputSwizzle.size(); i++) {
astcopts.inputSwizzle[i] = options.inputSwizzle[i];
}
} else if (options.normalMode) {
string normalSwizzle = "rrrg";
for (i = 0; i < 4; i++) {
astcopts.inputSwizzle[i] = normalSwizzle[i];
}
} else if (defaultSwizzle.size()) {
for (i = 0; i < options.inputSwizzle.size(); i++) {
astcopts.inputSwizzle[i] = defaultSwizzle[i];
Expand Down