Jump to content

Output terrain looks terrible in game view in Unity WebGL


zhenglixing

Recommended Posts

Hi there,

I am developing content using Gaia Pro 2021 and Unity 2021.3. As our project is intented to show on web browser, we switch the target platform to WebGL in Unity.

 

However, the output terrain looks very terrible in game view, for example, with  default stamps like plains or moutains, the output terrain is always displayed with densely terrace-like things and densely small protrusions, which is totally unusable. And when switching the target platform to Desktop, everything works fine like a charm.

 

Problem Image links;

https://ibb.co/jhnLNQD

https://ibb.co/jwtpGXk

https://ibb.co/9cYMHmD

https://ibb.co/PFcCqVT

 

I believe I strictly follow what the tutorials say, my key configurations are as followed: 

1. Gaia Pro 2021 3.2.4 in Unity 2021 LTS version

2. URP with linear color space

3. Setup Gaia manager following the instructions such as rendering pipeline, shader and defered rendering.

 

I`ve tried several ways to solve the problem:

1. Under webgl unity, switch to built-in rendering pipeline, the problem is still there

2. Under webgl unity, swiitch to Gamma color space, the problem is strill there

3. Under webgl unity, try use different texture compression format, the problem is still there.

4. Under webgl unity, try different terrain sizes, manual stamp/world designer, the problem is still there.

5. Under webgl unity, after making the terribly looking terrain, use smooth tool to dampen the terraces and protrusions, the terrain still looks terrible as they are highly dense, which is not like the occasional artifacts when designning in Unity with Desktop as target platform

6. Switch to Desktop for target platform, the problem is solved.

7. Switch to Desktop to make terrains with Gaia. After completing the work, switch to Webgl and build, the browser doesn`t display the terrain at all. 

 

I also noticed that when working in webgl unity, in the inspector of Stamp object, there`s a warning says something like "8 bit doesn`t work fine, please switch to 16 bits for stamp textures". So I wonder the root cause is related to that unity webgl compress all textures in current project which result in lossing information for heightmaps.

 

Would you please help me check this issue?

Link to comment
Share on other sites

Yep. The issues there are caused by using 8 bit stamps.

 

8 bit stamps only have a max of 256 possible height values, so you get the stepping you are seeing. You need 16 bit as this gives you the smooth height transitions you are looking for.

 

In general I would not use Unity terrain for WebGL, as it is slow and heavy. Depending on your use case I would consider generating your environment as normal unity terrain, then exporting as optimized mesh (see under advanced tab in gaia).

 

You would need to profile and make sure you do not push too much content as your performance will drop.

 

Not sure why your stamp formatting is corrupted. One of the team will advise more.

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