Closed ksabariraj closed 6 years ago
By default only the ASTC texture is flipped beforehand (as it flips the texture internally during compression) in order to restore it to its initial position.
At the moment no mipmapping should be generated during compression though I am working on exposing it through a flag in https://github.com/TimvanScherpenzeel/texture-compressor/issues/3.
In general the texture you pass to the tool should be in a final state (meaning a power of two and flipped in the direction you would like).
When using PVR or ETC you can pass the vertical flip flag directly to the tool using -f "flip y"
.
Meaning that an example command would look like node ./bin/texture-compressor -i ./docs/example/example.png -o ./docs/example/example-pvrtc2BPP.ktx -t pvr -c pvrtc1 -f "flip y"
.
Thanks for your time and update.
Now I am getting "not recognized" error.
Output: Commandline argument "-flip" not recognized
Which format are you trying to compress? You need to pass -f "flip y"
, with the -f
in front. This only works for PVR and ETC.
Oh sorry. I trying for ASTC. After conversion the texture is not loading properly.
FYI, I am using Three.js KTXLoader.
No problem. I'll have a look at KTXLoader and see if I can find the issue.
On what device are you testing?
I've tried to replicate your issue on the Samsung Galaxy S8+ (which supports ASTC) with both example-astc-4x4.ktx
and example-astc-8x8.ktx
. This works fine.
To check if your device has the ASTC extension please check the supportedExtensions
section in webglFeatures
on https://timvanscherpenzeel.github.io/detect-features/ on the actual device.
Android Galaxy J5.
Then it is very likely the ASTC extension is not supported on your device. Only recent high end Android devices support it. ETC1 will likely work with your device (please note that it does not support alpha).
So it is loading correctly but the texture is flipped..
Would you be able to manually flip the texture before passing it through the texture compressor?
I think the entire set up I created for flipping the ASTC texture before passing it through the texture compressor might be redundant but this does require further research on my part. I can remember there was a good reason why I implemented it in the first place. If it is not redundant I'll add a new flag to support vertical flipping.
Sure, I will try to flip the texture. And adding new flag to support vertical flipping will really help.
I have a question: I used Frontside material, if I flipped will it cause any issue?
Thanks again.
Just some notes, mostly for myself:
For some reason the KTXLoader of Three.js seems to be flipping the texture (in the correct orientation). This is an unflipped version of example-astc-8x8.ktx
.
The unflipped file example-astc-8x8-unflipped.ktx.zip
Added flip flag in https://github.com/TimvanScherpenzeel/texture-compressor/pull/8. The flag is disabled by default but can be passed using -y
or -flipy
.
I've also replaced my previous custom loader with the Three.js implementation.
Thank you for your suggestion and highlighting the issue. I'll consider this issue closed. If you have any other issues or suggestions feel free to open up a new issue.
Thanks a lot. Its working great 👍
HI,
Thanks for the tool.
Is any options to enable vertical flip and disable MIPMaps?
Thanks, Sabari.