Jump to content

Texture lost/become transparent when I using hot update loading assets


Nutshell

Recommended Posts

Hi,

Currently, I encountered a problem about loading assets during runtime. 

I'm currently working on a mobile project, so I used gaia pro 2023 to create a scene, and that scene is about 500MB  in size(which is too large for an apk). Therefore,  our project is using hot update to reduce initial apk size. 

The issues is that when we download assets from hot update, and entered the scene. the texture will become transparent( or I should say ground texture lost, look like character is standing on mid air). I could still enter the scene, no crash or anything. 

Have you guys heard this problem before with hot update? because everything else were fine using hot update.

Link to comment
Share on other sites

This could be so many things its hard to say. 
I would start off by suggesting to look at the shaders that are included in the build and make sure that the terrain shaders are included. 

 

Link to comment
Share on other sites

yep, found out something was wrong with the shader. And we still trying to figure out how to solve.

Link to comment
Share on other sites

There should be a list that you can force it to be included. 

unless its a problem within the shader itself 

Link to comment
Share on other sites

image.png.e42a326aa39981138e43aced004bfde6.png

this is how it looks right now, only terrian texture lost. everything else was alright. we are pretty sure that we included everything

Link to comment
Share on other sites

image.png.713d452ee19ab77f0fee0eaa2f958a33.png

and in other secene,  any possible reason for the terrian reflects light so much. What possible place should we check to reduce the reflection?

Link to comment
Share on other sites

Hi @Nutshell, I am not that familiar with the "hot update" mechanism, but if you are loading in the terrains during runtime after the build was created, chances are that Unity did not include the terrain shader (or the right variant for it) into the build - this is often a problem when terrain scenes are being loaded in dynamically, e.g. through adressables or other means.

What you can do in this case is one of the following:

 

  • Include the terrain shader in the list of "Always included shaders" in the project graphics settings. This has the downside that the first compilation after that will take some time as unity will compile all possible variants for that shader.
  • You can save the "currently known" shader variants into a shader variant collection file and link it in the project's graphics settings in the "preloaded shaders" list. Make sure that your terrain was rendered in the editor, then use the "Save To asset" button and save the shader variant file in the list of "Preloaded Shaders".
  • Add a dummy terrain in an empty scene and add it to the list of scenes in your build settings
  • Create a material that uses the terrain shader, and make sure it is used in the build by e.g. referencing it in a script or scriptable object somewhere that gets pulled in the build. You could also put the material in a folder called "Resources" and it should be pulled in the build as as well ("Resources" is one of the "magic" folder names in Unity)

Regarding the terrain being too shiny - one possible source for that would be the smoothness on the Terrain Layer, but it could also be post processing settings or other settings of your lighting setup.

 

Link to comment
Share on other sites

4 hours ago, Peter said:

Hi @Nutshell, I am not that familiar with the "hot update" mechanism, but if you are loading in the terrains during runtime after the build was created, chances are that Unity did not include the terrain shader (or the right variant for it) into the build - this is often a problem when terrain scenes are being loaded in dynamically, e.g. through adressables or other means.

What you can do in this case is one of the following:

 

  • Include the terrain shader in the list of "Always included shaders" in the project graphics settings. This has the downside that the first compilation after that will take some time as unity will compile all possible variants for that shader.
  • You can save the "currently known" shader variants into a shader variant collection file and link it in the project's graphics settings in the "preloaded shaders" list. Make sure that your terrain was rendered in the editor, then use the "Save To asset" button and save the shader variant file in the list of "Preloaded Shaders".
  • Add a dummy terrain in an empty scene and add it to the list of scenes in your build settings
  • Create a material that uses the terrain shader, and make sure it is used in the build by e.g. referencing it in a script or scriptable object somewhere that gets pulled in the build. You could also put the material in a folder called "Resources" and it should be pulled in the build as as well ("Resources" is one of the "magic" folder names in Unity)

Regarding the terrain being too shiny - one possible source for that would be the smoothness on the Terrain Layer, but it could also be post processing settings or other settings of your lighting setup.

 

Thank you, very appreciated. We will check 🙂

  • Like 1
Link to comment
Share on other sites

On 8/8/2024 at 12:36 PM, Bryan said:

Please let us know if we can further assist you! 

thank you for asking. And for now, we just included all assets within inital apk. We've decided to put this issue aside for now.  

Link to comment
Share on other sites

Thank you for letting me know! 
I will leave this open just in case we need to re-go through it together. 

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...