Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug Multiple issues and question of compiling VR game

Discussion in 'Shaders' started by Ciberdead, May 23, 2024.

  1. Ciberdead

    Ciberdead

    Joined:
    Nov 22, 2021
    Posts:
    27
    Hi,
    I'll try to be as comprehensive as possible, ask any information that needed. Also I am not an expert in VR stuff, Android or Unity, I am a student and I'm starting to leave the learning stage to make serious stuff.

    # Context

    First a bit of context, I've been creating a VR game/POC which include some assets brought as well as using the VR base template of the UnityHub.

    # Project specifications

    - Project directory : 12 GB ( The actual project is way less, i assume its due to Unity's files and unused assets and textures)
    - Unity Version : 2022.3.26f1
    - VR headset target : Meta quest 2
    - Render pipeline : URP

    # Computer specifications

    - CPU : Intel Core i7-10700 2.90GHz
    - Memory : 16 GB 2933Mhz SODIMM
    - GPU : NVIDIA GeForce GTX 1650 TI
    - Disk : CA-8D1024-Q11 NVMe SSSTC 1TB


    # During compilation usage

    As expected from a compilation process the RAM and mostly the CPU are bound.

    upload_2024-5-23_14-44-31.png

    # Issues

    ## Long building process

    For my project that is a bit small, the compilation process goes to 2.5 hours where nothing is possible in the computer, and mostly for the process of compiling variants with URP as shown in the screenshot bellow.

    upload_2024-5-23_14-34-24.png

    ## Maximum sampler

    I've also had an issue with getting a maximum sample exceeded when building the project as shown bellow :
    Shader error in 'Universal Render Pipeline/Lit': maximum ps_5_0 sampler register index (16) exceeded at

    (1)/Library/PackageCache/com.unity.render-pipelines.universal@14.0.11/ShaderLibrary/LightCookie/LightCookieInput.hlsl(12) (on vulkan)


    So i tried to use OpenGL instead of Vulkan (I didn't even knew i used Vulkan) and it remade me into the long process issue above... Acutally the building is still in process and i dont know if it will change a thing.

    I've seen the following thread about sampler issues but the answers were vague and "strange", i'm not sure how to go through the issue : Bug - shader error in 'universal render pipeline/lit': maximum ps_4_0 sampler register index (16) exceeded - Unity Forum

    ## APK building process

    It happened a couple of times when I hadn't the "maximum sampler" issue and i had an issue with Graddle :

    A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction See the Console for details.


    I've seen the following thread : unity a failure occured while executing com.android.build.gradle.internal.tasks Workers$Action Faca - Unity Forum

    And it seems to change the .keystore where I didn't knew I needed to have one... So I created one inside of unity's player setting and the errors disapeared for just one build ( this build had a compilation error - maximum sampler) and then the error came back...

    # Questions

    As said in the beginning I am not an expert and you like some explanations for some things :
    - What is "vp" in the compiling shader variant ?
    - Since its this kind of things that are taking very long to build, how can i reduce the number of vp ?
    - Also because vp is taking a long time is their a way to reduce the time of each vp ?


    - What is a "sampler" ?
    - What is the issue that could lead to have too many samplers ?


    - What is the keystore ? what is its purpose for building a game ?
    - Why do i have the error coming back when I build once ?


    Thanks in advance for any explanation.
     

    Attached Files:

  2. Ciberdead

    Ciberdead

    Joined:
    Nov 22, 2021
    Posts:
    27
    Update :
    I tried removing about 2GB of unused assets and it didn't change a thing, also i removed Vulkan from the API list to get only OpenGL3 and now i have 10k vp. But i still have a hell long compiling time...