[2.2] ASTC Support? Topic is solved
-
- Goblin
- Posts: 296
- Joined: Mon May 09, 2016 8:21 am
- x 35
[2.2] ASTC Support?
Hi!
Is ASTC support implemented in Ogre 2.2? I have some ASTC files, in img->load (data) the codec can successfully recognize it as PF_ASTC_RGBA_4X4_LDR, but later I don't see any code to convert this PixelFormat to PixelFormatGpu, so img->load(data) succeeded but img->getPixelFormat() returns an invalid value (I think it's unitialized?).
Actually I can't see any corresponding PixelFormatGpu enum value for PF_ASTC_RGBA_4X4_LDR. So, ASTC is not supported in Ogre 2.2?
Is ASTC support implemented in Ogre 2.2? I have some ASTC files, in img->load (data) the codec can successfully recognize it as PF_ASTC_RGBA_4X4_LDR, but later I don't see any code to convert this PixelFormat to PixelFormatGpu, so img->load(data) succeeded but img->getPixelFormat() returns an invalid value (I think it's unitialized?).
Actually I can't see any corresponding PixelFormatGpu enum value for PF_ASTC_RGBA_4X4_LDR. So, ASTC is not supported in Ogre 2.2?
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: [2.2] ASTC Support?
-
- Goblin
- Posts: 296
- Joined: Mon May 09, 2016 8:21 am
- x 35
Re: [2.2] ASTC Support?
Thanks! But my code crasheddark_sylinc wrote: ↑Thu Jan 31, 2019 9:09 pm I could not have the chance to test it, but I'd expect that if there are any bugs, they'd be minor.
From the code's comment it looks like ASTC codec doesn't support mipmaps?
Code: Select all
imgData->numMipmaps = 1u; // Always 1 mip level per file
Also, the following code is weird:
Code: Select all
if( zsize > 1 )
imgData->textureType = TextureTypes::Type2D;
else
imgData->textureType = TextureTypes::Type3D;
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: [2.2] ASTC Support?
Yeah that's a silly bug. Fixed.rujialiu wrote: ↑Fri Feb 01, 2019 11:32 am Also, the following code is weird:Code: Select all
if( zsize > 1 ) imgData->textureType = TextureTypes::Type2D; else imgData->textureType = TextureTypes::Type3D;
There's a PR to fix bugs when trying to generate mipmaps when that's impossible. I will expedite that PR.
I looked on the original ASTC encoder and after inspecting the code it is quite clear that the file format only supports 1 mip.
I looked to see if Compressonator had extended the file format to support mipmaps, but they did not. Looking the source code it appears they're only saving the first mip too.
It would appear the only other format who can support ASTC, but in full, is KTX. Our KTX codec (in OgreETCCodec.cpp) hasn't been ported and we could first graft some improvements that were made to 1.x. I don't know how robust that codec is, but I can try porting it.
-
- Goblin
- Posts: 296
- Joined: Mon May 09, 2016 8:21 am
- x 35
Re: [2.2] ASTC Support?
Ok, I see the port, thanks... I'll try ASTC + mipmaps some time later.dark_sylinc wrote: ↑Fri Feb 01, 2019 9:13 pm It would appear the only other format who can support ASTC, but in full, is KTX. Our KTX codec (in OgreETCCodec.cpp) hasn't been ported and we could first graft some improvements that were made to 1.x. I don't know how robust that codec is, but I can try porting it.
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: [2.2] ASTC Support?
I just tested a KTX file generated with PVRTexTool on GL/Linux (I had to update my drivers since support was added 6 months ago) that contained ASTC+mipmaps and it worked on first try.
I have yet to test iOS, however this tells us that the RenderSystem-agnostic parts of ASTC, and the KTX codec are working.
The PR to avoid generating mipmaps on unsupported formats still needs to be merged yet though. If the KTX+ASTC file doesn't have mipmaps, Ogre will try to generate them and fail.
I have yet to test iOS, however this tells us that the RenderSystem-agnostic parts of ASTC, and the KTX codec are working.
The PR to avoid generating mipmaps on unsupported formats still needs to be merged yet though. If the KTX+ASTC file doesn't have mipmaps, Ogre will try to generate them and fail.
-
- Goblin
- Posts: 296
- Joined: Mon May 09, 2016 8:21 am
- x 35
Re: [2.2] ASTC Support?
My teammate just succeeded loading KTX+ASTC+mipmaps on iOS with latest commit (https://bitbucket.org/sinbad/ogre/commi ... 3dfc40305a). Thanks!!!dark_sylinc wrote: ↑Sun Feb 03, 2019 4:50 am I just tested a KTX file generated with PVRTexTool on GL/Linux (I had to update my drivers since support was added 6 months ago) that contained ASTC+mipmaps and it worked on first try.
I have yet to test iOS, however this tells us that the RenderSystem-agnostic parts of ASTC, and the KTX codec are working.
The PR to avoid generating mipmaps on unsupported formats still needs to be merged yet though. If the KTX+ASTC file doesn't have mipmaps, Ogre will try to generate them and fail.
-
- Goblin
- Posts: 296
- Joined: Mon May 09, 2016 8:21 am
- x 35
Re: [2.2] ASTC Support?
oops, just now he said he had to modify Ogre a bit to make it work. Will send you a patch in private ASAP.rujialiu wrote: ↑Mon Feb 04, 2019 11:55 am My teammate just succeeded loading KTX+ASTC+mipmaps on iOS with latest commit (https://bitbucket.org/sinbad/ogre/commi ... 3dfc40305a). Thanks!!!
-
- Goblin
- Posts: 296
- Joined: Mon May 09, 2016 8:21 am
- x 35