Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9204361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:41:42+00:00 2026-06-17T23:41:42+00:00

I recently updated my loading code for textures and also added some new features

  • 0

I recently updated my loading code for textures and also added some new features like mipmap loading ( the last application has been only 2D so i didn’t need them ). But the loaded PVRTC textures stay black when using mipmaps, without mipmaps everything works like expected and also mipmaps are working when using textures like RGBA8888 textures.

Loading of the compressed data:

for (int i = 0; i < source.MipmapCount; i++)
{
    data = source.GetData(i);
    GLTextures.CompressedTexImage2D(TextureType.TEXTURE_2D, i, Format.CompressedFormat.Value, Width >> i, Height >> i, data.Length, data);
    Debug.WriteGLError("Texture2D->CompressedTexImage2D", "MipmapLevel={0}", i);
}

Setup of the filtering:

if (source.MipmapCount == 0)
{
    switch (filterQuality)
    {
        case FilterQuality.Nearest:
            GLTextures.TexParameteri(TextureType.TEXTURE_2D, TexParameter.TEXTURE_MIN_FILTER, (Int32)TextureMinFilterParams.NEAREST);
            GLTextures.TexParameteri(TextureType.TEXTURE_2D, TexParameter.TEXTURE_MAG_FILTER, (Int32)TextureMagFilterParams.NEAREST);
            break;
        case FilterQuality.Linear:
            GLTextures.TexParameteri(TextureType.TEXTURE_2D, TexParameter.TEXTURE_MIN_FILTER, (Int32)TextureMinFilterParams.LINEAR);
            GLTextures.TexParameteri(TextureType.TEXTURE_2D, TexParameter.TEXTURE_MAG_FILTER, (Int32)TextureMagFilterParams.LINEAR);
            break;
    }
    Debug.WriteGLError("Texture2D->TexParameteri without mipmaps");
}
else
{
    switch (filterQuality)
    {
        case FilterQuality.Nearest:
            GLTextures.TexParameteri(TextureType.TEXTURE_2D, TexParameter.TEXTURE_MIN_FILTER, (Int32)TextureMinFilterParams.NEAREST_MIPMAP_LINEAR);
            GLTextures.TexParameteri(TextureType.TEXTURE_2D, TexParameter.TEXTURE_MAG_FILTER, (Int32)TextureMagFilterParams.NEAREST);
            break;
        case FilterQuality.Linear:
            GLTextures.TexParameteri(TextureType.TEXTURE_2D, TexParameter.TEXTURE_MIN_FILTER, (Int32)TextureMinFilterParams.LINEAR_MIPMAP_LINEAR);
            GLTextures.TexParameteri(TextureType.TEXTURE_2D, TexParameter.TEXTURE_MAG_FILTER, (Int32)TextureMagFilterParams.LINEAR);
            break;
    }

    Debug.WriteGLError("Texture2D->TexParameteri with mipmaps");

    if (anisotropicQuality > 1f && GL.IsExtensionSupported(Extension.GL_EXT_texture_filter_anisotropic))
    {
        // GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 
        GLTextures.TexParameter(TextureType.TEXTURE_2D, 0x84FF, Mathf.Clamp(anisotropicQuality, 1f, GL.GetFloat(GetFloatName.TEXTURE_MAX_ANISOTROPY)));
        Debug.WriteGLError("Texture2D->Anisotropy");
    }
}

Loading of the texture
The loading is done with a modified reference-loader for PVR files. I checked the length of the bytes of each mipmap and the last few arrays have the size of 32 bytes ( minimum size of PVRTC ). What could cause the issue?

Edit

The method "GLTextures.CompressedTexImage2D".

public static void CompressedTexImage2D(TextureType target, Int32 level, CompressedFormats internalFormat, Int32 width, Int32 height, Int32 imageSize, Byte[] pixels)
{
    /* Used for mobile apps for debugging purposes */
    Debug.CheckMethodLoaded(glCompressedTexImage2D);
    Profiler.IncreaseCallCount("glCompressedTexImage2D");
    glCompressedTexImage2D(target, level, internalFormat, width, height, 0, imageSize, pixels);
}

Image formats definition:

PVRTC2RGB = new ImageFormat("PVRTC2RGB", CompressedFormats.COMPRESSED_RGB_PVRTC_2BPPV1_IMG, 16, 8, bitsPerPixel: 2, requiredExtension:Extension.GL_IMG_texture_compression_pvrtc);
PVRTC2RGBA = new ImageFormat("PVRTC2RGBA", CompressedFormats.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, 16, 8, bitsPerPixel: 2, requiredExtension: Extension.GL_IMG_texture_compression_pvrtc);
PVRTC4RGB = new ImageFormat("PVRTC4RGB", CompressedFormats.COMPRESSED_RGB_PVRTC_4BPPV1_IMG, 8, 8, bitsPerPixel: 4, requiredExtension: Extension.GL_IMG_texture_compression_pvrtc);
PVRTC4RGBA = new ImageFormat("PVRTC4RGBA", CompressedFormats.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, 8, 8, bitsPerPixel: 4, requiredExtension: Extension.GL_IMG_texture_compression_pvrtc);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:41:43+00:00Added an answer on June 17, 2026 at 11:41 pm

    edit: correction.

    I believe your texture min/mag filters must be:

    • GL_LINEAR_MIPMAP_NEAREST for the min filter
    • GL_LINEAR for the mag filter

    when using mipmaps with PVRTC. See the header file at: http://ne3d.googlecode.com/svn-history/r3/trunk/Lib/SRC/Tools/OGLES/PVRTTextureAPI.h

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently updated to the new version of XCode and the session start code
I recently updated to Xcode 4.2. I also updated my new iPad 2 and
I recently updated an application from VS2003 to VS2008 and I knew I would
I recently updated R, and code I had written using the limma package before
We recently updated our WPF application to perform its data synchronisation (using sync framework)
I recently updated my Mac to Mountain Lion and also Xcode 4.5 . I
I recently updated my app with a new version in app store.My users experienced
I recently updated to a new version of the GNAT compiler.. I am trying
I recently updated the SwingX library in an application from version 1.0 to 1.6.2
I ported some parts of the code from OL 3.3 to OL 5.0 recently.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.