Search Unity

Bug RenderSettings customReflection texture has invalid type, 2D given while only CUBE is supported. Cus

Discussion in 'Editor & General Support' started by koendds, Jul 20, 2022.

  1. koendds

    koendds

    Joined:
    Apr 18, 2022
    Posts:
    20
    Hi

    When i try to build and run my game i get the following:
    Code (CSharp):
    1. RenderSettings customReflection texture has invalid type, 2D given while only CUBE is supported. Custom reflection texture will not be used

    And also:

    Code (CSharp):
    1. UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
    2.   at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <36f62d8e760b48f7af5d32916f997ce1>:0
    3.   at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <36f62d8e760b48f7af5d32916f997ce1>:0
    4. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
    5.  
    I dont understand this error. where are the texture 2D? where can i change this to CUBE? is because of texture rendering?
     
  2. almar-suarez

    almar-suarez

    Joined:
    Jul 15, 2014
    Posts:
    2
    Hello! I am having this issue myself and I cannot really find anywhere in the settings how to change it - I also searched through all the plugins I have installed and there's no script accessing RenderSettings.customReflection.

    I tried setting this by code myself (when the game starts I apply a custom cubemap texture to RenderSettings.customReflection), but I still get the same error. Any idea will be welcome :)
     
    koendds likes this.
  3. koendds

    koendds

    Joined:
    Apr 18, 2022
    Posts:
    20
    Yep. nothing on google as well. unable to build at all now and no idea where to even look or what the error means exactly.
     
  4. ashraf_unity505

    ashraf_unity505

    Joined:
    Nov 30, 2021
    Posts:
    2
    I was able to solve it. For me, an unintentional scene change was causing the issue.

    1. Search in your Assets folder for
    m_CustomReflection: 
    [search in every type of file, not just script.]
    2. Default value (no change in reflections setting) would be like so
    m_CustomReflection: {fileID: 0}

    3. If you have changed the setting however, you will find a specific value like this:
    m_CustomReflection: {fileID: 2800000, guid: fc9b85bd29d524961b9016b0f358064d, type: 3} 

    4. Copy the guid and search this id in your project, one of those assets will be the culprit.

    For me, i didn't need custom reflection on that particular scene, so i just changed it to default value and the error was gone.

    Check out the screenshot
    Screenshot 2022-07-23 at 1.21.14 PM.png
    Search ^

    Screenshot 2022-07-23 at 1.32.23 PM.png
    Culprit image in my case ^
    Hope this helps.
     
    koendds and almar-suarez like this.
  5. koendds

    koendds

    Joined:
    Apr 18, 2022
    Posts:
    20
    i searched my entire solution for m_CustomReflection but cannot find anything.
    Only thing i see thats somewhat related is in the rendersettingsconverter

    can find plenty of
    Code (CSharp):
    1. using System.Reflection;
    but that shouldn't be a problem.

    Looking at your screenshot there looks like you're accessing SPLASH.unity? is that a default c# file? because i cant find that either

     
  6. ashraf_unity505

    ashraf_unity505

    Joined:
    Nov 30, 2021
    Posts:
    2
    I see you are using visual studio, i am using Rider, in rider you can search in all file types, even scene files, searching only solution will not work. solution doesnt contain special files like .unity files. you have to search insider your project directory which has all .meta files, .unity files etc.

    To answer your question, Splash.unity is a unity scene in my project.

    Open any scene file from your windows explorer as a text file..search that file, you will see m_CustomReflection tag. it's a default property that every scene file has.
    Alternatively, i am assuming you are using windows, you can search from command line a specific string like so:

    Screenshot 2022-07-24 at 3.31.36 PM.png

    hope this helps.
     
    Last edited: Jul 24, 2022
  7. koendds

    koendds

    Joined:
    Apr 18, 2022
    Posts:
    20
    that fixed it . thanks so much.

    I have a feeling its caused by reflection probes somehow.
     
    ashraf_unity505 likes this.
  8. almar-suarez

    almar-suarez

    Joined:
    Jul 15, 2014
    Posts:
    2
    ashraf_unity505 likes this.
  9. prossel

    prossel

    Joined:
    May 19, 2015
    Posts:
    3
    Hello,
    Found this thread with the same message and here is my solution:
    • Went to Window > Rendering > Lighting > Environment tab
    • Under Environment Reflexions, I had Skybox, but changing it to Custom revealed the Cubemap field, which in my case was refering the texture found by searching for m_CustomReflection in the scene file.
    • I selected None for this texture and then restored the Skybox value of previous field.
    • Error gone
    upload_2022-10-29_15-40-21.png
     
  10. andrewing2009

    andrewing2009

    Joined:
    Nov 28, 2021
    Posts:
    2
    Thanks Prossel! It really helped :)
     
  11. AndreFoxVR

    AndreFoxVR

    Joined:
    Oct 11, 2019
    Posts:
    1
    No, guys.
    Actually, this problem is caused by the characteristic of the texture that is used in the Skybox material. Just change the type of the HDRI you are using (.exr or .hdr) from 2D to Cube (on the Texture Shape Format in the inspector). Then, update the image in the Skybox/Cubemap material.
     
  12. Kobalt909818

    Kobalt909818

    Joined:
    Sep 20, 2023
    Posts:
    1
    Thanks Prossel! :)
     
  13. Johnny-Fuzz

    Johnny-Fuzz

    Joined:
    Sep 1, 2014
    Posts:
    26
    Just wanted to say thanks - this error happens 100% still in 2022.3.10f1 even after you swap back over to Skybox - Unity is still referencing an invalid Custom Reflection file and it has to be set to none just as referenced in the solution. Thanks again!
     
    OleksandrMartysh likes this.