Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Async loaded Addressable Terrain is glossy / shiny with urp

Discussion in 'Addressables' started by BurkhardK, Nov 7, 2021.

  1. BurkhardK

    BurkhardK

    Joined:
    Jun 2, 2019
    Posts:
    7
    Hi,

    when I load an terrain async as an addressable the terrain texture is glossy / shiny in Build.
    In Play mode everything is fine. If I instantiate the terrain directly (not loaded async as addressable), everything is fine.

    I am using URP.

    Here is my test code to produce my test builds:

    Code (CSharp):
    1. public class MapTest : MonoBehaviour
    2. {
    3.     public AssetReference _assetRef;
    4.  
    5.     public GameObject _gameObject;
    6.    
    7.     private IEnumerator LoadAsync()
    8.     {
    9.      
    10.         AsyncOperationHandle<GameObject> goHandle = Addressables.LoadAssetAsync<GameObject>(_assetRef);
    11.  
    12.         yield return goHandle;
    13.  
    14.         if (goHandle.Status == AsyncOperationStatus.Succeeded)
    15.         {
    16.             GameObject obj = Instantiate(goHandle.Result, this.transform);
    17.  
    18.         }
    19.  
    20.     }
    21.    
    22.  
    23.     private void Start()
    24.     {
    25.         //Instantiate(_gameObject);
    26.         StartCoroutine(LoadAsync());
    27.     }
    28. }
    Result in build as Addressable:
    upload_2021-11-7_11-8-1.png

    Result as GameObject:
    upload_2021-11-7_11-9-17.png


    Any idea what the issue may be?
     
  2. AvinashB9

    AvinashB9

    Joined:
    Feb 10, 2021
    Posts:
    14
    @DTown-Games: If you're using baked light scene, make sure you execute the below line after it is downloaded and loaded the scene.

    SceneManager.SetActiveScene(Scene scene);
     
  3. BurkhardK

    BurkhardK

    Joined:
    Jun 2, 2019
    Posts:
    7
    Thanks for your reply AvinashB9, I tried it but unfortunately it did not work.
     
  4. AvinashB9

    AvinashB9

    Joined:
    Feb 10, 2021
    Posts:
    14
    @DTown-Games : What did you assign for asset reference? Is it a terrain, or prefab? I guess its the scene
     
  5. BurkhardK

    BurkhardK

    Joined:
    Jun 2, 2019
    Posts:
    7
    I think I figured it out. I originally had graphics with alpha source in my terrain layers and only set them to "none" afterwards. Apparently the subsequent change was not fully applied. I have now created a new terrain layer and it works. Unfortunately, I now have to completely repaint my terrain.

    Thanks for your help.
     

    Attached Files: