PVRTexTool A8 format

This topic contains 5 replies, has 4 voices, and was last updated by  egoh 5 years ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #30874

    egoh
    Member

    Hi,

    I’m trying to get the command line PVRTexTool to generate alpha data using the following command:

    PVRTexTool  -fA8 -yflip 0 -i test.png

    This complains that A8 is an invalid format though it seems to be listed in the documentation. -f8 works, but returns intensity instead of alpha. Am I missing something?

    This is on Windows. The main purpose is to have alpha data to work with in conjunction with RGB from ETC1. If there is a better way to do this, do let me know.

    Thanks,
    Eugene

    #35842

    Hi egoh,

    Somewhere wires have been crossed and I’m not sure whether this is a documentation problem or if the code base has changed, so I’ll investigate and try to get it updated for the next release.

    In the meantime you can use “-fdx10_a8_unorm” to the same effect.

    Is there some reason you can’t use PVRTC in this case? As this supports alpha it would provide a more compact + better performing solution.

    Thanks,

    Tobias

    #35843

    egoh
    Member

    Thanks!. Yes, I am using PVRTC for our iOS builds and some Android builds, but ETC1 is the only format supported on some Android models unfortunately.

    Cheers,
    Eugene

    #35844

    Simon
    Moderator

    Eugene,
    For the ETC1-only devices, if you want to reduce the memory footprint a bit, you can use ETC to get the alpha texture down to 4bpp. The trick is to create a new texture and to duplicate the A8 data into each of the R, G & B channels, and then compress with ETC1. When you read the texture, use the shader to just copy, say, the G channel into Alpha.
     (Note: don’t just copy the A8 into, say, the R channel as ETC does a better job compressing images that have pixel blocks that only vary in ‘luma’)

    Simon

    #35845

    RebDev
    Member
    Tobias wrote:
    In the meantime you can use “-fdx10_a8_unorm” to the same effect.

    It seems that dx10_a8_unorm is also incorrect – it generates exactly the same output as dx10_r8_unorm.

    #35846

    egoh
    Member

    I managed this in the end with “-fOVG_A_8”

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.