Jump to content

Paints does not show in WebGL


Recommended Posts

Hello, I am developing a project for webGL, I am using Unity2021.3.25. I painted my terrain with Pw_Grass_Patch. I can see the grasses on terrain in unity but when I build for webGl, they does not show in the screen. I have been tryung to solve this issue but I could not resolve. I dont know if it is rekated but in console it says 

No localization package was found for FloraTerrainTileEditor!
UnityEngine.Debug:LogError (object)
PWCommon5.Localization.Culture:GetLanguagePackOrDefault (string,string)
PWCommon5.EditorUtils:LoadLocalizationData ()
PWCommon5.EditorUtils:InitLocalization (string)
PWCommon5.EditorUtils:.ctor (PWCommon5.AppConfig,PWCommon5.IPWEditor,string,System.Action,string,PWCommon5.URLParameters)

But I think the problem is more about the shaders. Any help with this issue will be highly appreciated. Thanks!

Link to comment
Share on other sites

I will need to take a look into this. 
Webgl has a ton of limitations. 

Link to comment
Share on other sites

  • 5 weeks later...
On 5/17/2024 at 2:43 PM, Bryan said:

I will need to take a look into this. 
Webgl has a ton of limitations. 

Hello Bryan, do you have an update on this issue? I am having the same issue with Webgl (I am also using Unity version 2021.3.25, and our project uses URP). From a previous post I read, unchecking the "gpu instancing" option for the grass mesh could fix this, but it did not work in my case. I also get a warning in the paint details tab in the terrain inspector that says, "Uncompressed Atlas. This can be caused by mismatched texture formats." is this related to the Webgl issue?

Link to comment
Share on other sites

Hi @dfai,

this problem could have two causes:

1. The selected terrain detail mode is not supported by WebGL - When you set up terrain details in the Unity terrain system, you have a couple of modes you can choose how the terrain details are being rendered, please see the table on the different "Modes" at the beginning of this article:

https://docs.unity3d.com/Manual/terrain-Grass.html

The "GPU Instancing" you mentioned there influences those modes as well. It can be that a certain mode does not work / is not supported by WebGL. 
I believe GPU instanced Grass should work in WebGL, but then again I cannot tell for sure if this is also the case for URP and this might also change from Unity Version / Render pipeline version.
In order to check this it would be good to create a quick sample terrain where you paint on different terrain details with different terrain detail rendering modes and build them for WebGL - then you should be able to confirm which mode works for the Unity Editor version & Render Pipeline combination.


2. Unity sometimes does not include the required shader variants into the build - it can happen sometimes that the build process does not pick up the corect shaders / shader variants that are required in the build. The objects that use that shader are then either not rendered at all, or rendered wrong (e.g. a transparent object is rendered opaque in the build).

To make sure that the correct shader variants are included, you can store the currently tracked variants in a file which then is always included in the build. In order to do so, please run the scene where the terrain detail is visible on camera, then store the shader variant collection with this button in the Unity Graphics Settings:

image.png

.....and then include it in the list of "Preloaded Shaders" for the build:

image.png

This should assure that the "terrain detail you have just seen being rendered" is tracked correctly and the shaders are included in the build.

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...