Git Product home page Git Product logo

Comments (3)

alecazam avatar alecazam commented on May 2, 2024

Apart from not applying any srgb conversions to float on imported data before building mips, the constants written out to the KTX files are also not correct. So sRGB(A) data isn't written out with non-SRGB constants. Ugh.

enum class InternalFormat
		{
			ETC2_SRGBA8 = 0x9279
                 }

switch (m_pfile->GetImageFormat())
		{
		case Image::Format::RGB8:
            m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_RGB8;
            m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_RGB8;
            break;
            
		case Image::Format::SRGB8:
			m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_SRGB8;
			m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_RGB8;
			break;

		case Image::Format::RGBA8:
            m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_RGBA8;
            m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_RGBA8;
            break;

		case Image::Format::SRGBA8:
			m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_SRGBA8;
			m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_RGBA8;
			break;

		case Image::Format::RGB8A1:
            m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_RGB8A1;
            m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_RGB8A1;
            break;
                
		case Image::Format::SRGB8A1:
			m_data.m_u32GlInternalFormat = (unsigned int)InternalFormat::ETC2_SRGB8_PUNCHTHROUGH_ALPHA1;
			m_data.m_u32GlBaseInternalFormat = (unsigned int)BaseInternalFormat::ETC2_RGB8A1;
			break;

from etc2comp.

alecazam avatar alecazam commented on May 2, 2024

Here's a collection of all the fixes that have never landed from various PRs into this tool to fix it. Google, can we get an update to the tool so that people aren't generating bad ETC2 files?

Note that PVRTexToolGUI doesn't display gamma correctly as of 8/16/20. Mali Texture Tools (bitrotting since 2017) cannot open any ETC2 files with sRGB(A) set, but you can view the R/RG11 and non-sRGB format textures. macOS Preview cannot display content and Finder can't display dimensions or thumnails for ETC2 or PVRTC content, so trying to visually verify the output was an unfortunate challenge.

patchToFixETCTool.diff.zip

from etc2comp.

richgel999 avatar richgel999 commented on May 2, 2024

I'm assuming this project was abandoned once Android got ASTC support.

Yes, it appears dead.

from etc2comp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.