Skybox Compression Problem in Unity

Hi i’m facing a problem related to skybox compression settings. I’m using an 8k skybox in my scene and i’ve also added skybox export settings in my scene but it is still errors and warnings that the skybox is too big and clamping its size to 4096. I’m using the following setup.

  • Unity 2022.3.16f1
  • Needle Version3.51.1
  • Macbook Pro 2017 Model

Hi Abdul Raheem,

It appears you’re encountering issues with the skybox compression settings in Unity. Given your setup (Unity 2022.3.16f1, Needle Engine version 3.51.1), let’s address the problem.

Unity has a maximum texture size limitation, which typically defaults to 4096 for skyboxes unless manually configured. Here are steps to attempt to resolve your issue:

  1. Check Texture Import Settings:

    • Click on your skybox texture in the Project window.
    • In the Inspector, set the Max Size to 8192 or set it to “Override for Platform” for Mac OS, ensuring your settings match accordingly.
    • Ensure the Compression setting is set to “None” or adjust it based on your needs.
  2. Skybox Material Settings:

    • Ensure that your skybox material is correctly set up to use the updated texture.
    • Verify that the Shader used for the skybox material is suitable for high-resolution textures (e.g., Skybox/6 Sided).
  3. Quality Settings:

    • Navigate to Edit > Project Settings > Quality.
    • Make sure your quality level supports higher texture sizes. Check if you’re editing the correct quality settings for the platform you’re building for.
  4. Reimport Skybox:

    • Sometimes, simply reimporting your textures can resolve import issues. Right-click the skybox texture and select “Reimport”.

After performing these steps, check if the warnings persist. If they do, please provide any specific error messages, as they can help in diagnosing further.

If the issue continues, you might consider lowering the texture resolution as a temporary workaround if maintaining the skybox size isn’t crucial for your project.

Feel free to ask further questions or provide additional details!

1 replies left - Get a PRO license for more AI replies.
thread_Vk1hT9KrvfsUNQRdUrqh3P9I
Reply to this message to continue the conversation

Hello,

the skybox is assigned to the Unity environment lighting settings? Can you double check that in Unity are no other logs regarding your skybox?

@marcel I’ve double checked it there are no other skybox error in unity

Could you send a bugreport with your project? Thank you

1 Like

@marcel I’ve sended the bug report please check

Hello,

I’ve taken a look at your project.

Your skybox is currently a 1.4 GB big EXR file which will not load on mobile devices and most likely simply crash so it’s not recommended that you use this file as is.

What we would recommend is the following:

  • Reduce the value in SkyboxExportSettings to e.g. 128
  • Convert the EXR to KTX2 (alternatively JPEG or PNG altough KTX2 would be recommended)
  • Add a new component to your scene with a ImageReference property (see example below) and assign your skybox to it.
  • Export the scene, you will see your skybox is now exported to your web project’s assets folder, e.g. assets/your-skybox.ktx2
  • In index.html modify the needle-engine component to load the new skybox. For example <needle-engine src="assets/scene.glb" background-image="assets/your-skybox.ktx2"></needle-engine>
  • That’s it. Now the skybox will just be copied to the output directory as is.

Example component:

export class BackgroundImage extends Behaviour {
    @serializable(ImageReference)
    skybox?: ImageReference;
}

Note: instead of assigning the texture to <needle-engine background-image> you can now also load the texture in your component yourself and then just assign it to context.scene.background to be displayed.

@marcel thanks now my skybox is not optimizing

That means this above is solving your problem? Which approach did you choose? Make sure to test your application on the target devices since the EXR that you’ve been using in your project should not be used for web applications due to its huge size and memory consumption