Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by jmhoubre · Sep 07, 2021 at 04:05 PM · meshlightingrendering

My procedural mesh leaves traces on rendering

Hello,

I am working with the 2020.3.17f1. A procedural terrain generation script (Zenva's tutorial: the complete procedural terrain generation in Unity course) works correctly, but leaves traces (from the mesh grid I think) in the scene and in the game view, see the 2 screenshots.

It seems to be related to the light, when I rotate my directional light, the tracks move. I have tried everything I know about shadows, but the concern persists.

When I change the terrain material shader from standard to Mobile / Unlit ( Supports Ligthmap), Unlit / Texture (no texture) or Unlit / Transparent cutout, the traces disappear.

I also have the problem with the 2019.4.30.f1.

There are 6 scripts: TileGenerator (generates the terrain), NoiseGenerator (generates the noise with a PerlinNoise and waves), MeshGenerator, TextureBuilder (detailed below), TerrainType and Wave define data types.

Thank you for giving me some avenues to explore.

 using UnityEngine;
 
 public class TextureBuilder
 {
     public static Texture2D BuildTexture (float[,] noiseMap, TerrainType[] terrains)
     {
         Color[] pixels = new Color[noiseMap.Length];
 
         int size = noiseMap.GetLength (0);
 
         for (int x = 0; x < size; x++)
         {
             for (int z = 0; z < size; z++)
             {
                 int index = (x * size) + z;
                 
                 for (int t = 0; t < terrains.Length; t++)
                 {
                     if (noiseMap[x, z] < terrains[t].threshold)
                     {
                         float minVal = (t == 0 ? 0f : terrains[t - 1].threshold);
                         float maxVal = terrains[t].threshold;
 
                         pixels[index] = terrains[t].colorGradient.Evaluate (1f - (maxVal - noiseMap[x, z]) / (maxVal - minVal));
                         break;
                     }
                 }
             }
         }
 
         Texture2D texture = new Texture2D (size, size)
         {
             wrapMode = TextureWrapMode.Clamp,
             filterMode = FilterMode.Bilinear
         };
         texture.SetPixels (pixels);
         texture.Apply ();
 
         return texture;
     }
 }

link text link text

image1.png (283.9 kB)
image2.png (447.1 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image andrew-lukasik · Sep 07, 2021 at 04:31 PM 1
Share

For an unlit shader this looks like a some kind of vertex color interpolation or colormap sampling issue. But if this is a lit shader then my bet is on mesh normals not following surface curvature very well.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

188 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Voxel lighting - apply lightmap to mesh 1 Answer

Mesh only gets shaded when scaled on at least one axis??? 0 Answers

Render object only when illuminated by a specific light. 1 Answer

Need lighting advice for a low poly scene 1 Answer

How do I "unbake" a reflection probe? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges