Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Procedural Generated Mesh isn't scaling and is mirrored

Discussion in 'General Graphics' started by Gadz, Dec 28, 2020.

  1. Gadz

    Gadz

    Joined:
    Dec 28, 2020
    Posts:
    2
    Hi All,

    I hope this is a simple one for you all. I recently downloaded and started playing with Sebastian Lague's Procedural Generation tutorials. Specifically Proc Gen E06 which I imported into Unity 2019.4.17f1 (which needed a bit of conversion). Everything seems to be working fine except for 2 things:
    1. For some reason the mesh is always mirrored in the x direction. i.e. the mesh is a mirror image of the Colour and Noise Maps.
    2. If I want to make the map larger I increase the mapChunkSize in MapGenerator.cs to 1000. For some reason the Mesh ends up being a strip along the edge of the Colour Map and does not cover anywhere else. Anyone have any idea?
    Appreciate any help. I am new to unity and this is driving me crazy. I also imported several other versions of the code and they all do the same thing. I am wondering if something has changed in unity between versions that may be causing this.

    https://github.com/SebLague/Procedural-Landmass-Generation

    1. Mirrored map when using the tutorial out of the box mapChunkSize =241

    Colour Map Plane
    upload_2020-12-28_14-14-16.png
    Mesh
    upload_2020-12-28_14-14-39.png

    Colour Map Plane shown is ok. Mesh only at side of map if mapChunkSize =1000
    upload_2020-12-28_14-17-5.png


    Cheers, Gadz
     

    Attached Files:

  2. NevilleZong

    NevilleZong

    Joined:
    Jan 2, 2021
    Posts:
    1
    Hi, got the same problem as yours. I'm using a pretty fast easy fix, in
    MapDisplay.cs
    , change
    textureRender.transform.localScale = new Vector3(texture.width, 1, texture.height);
    to
    textureRender.transform.localScale = new Vector3(-1 * texture.width, 1, texture.height);
    . This will mirror the plane.

    However, this might not fix the root of the problem, it's more like an illusion that the bug is fixed. I'll keep updating if I found a way to really solve this problem.

    Cheers,
    Neville
     
    Gadz likes this.