Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug Logic issue with generating multiple chunks (Flattening a array and indexing it)

Discussion in 'Scripting' started by Bloxxy213, Apr 14, 2023.

  1. Bloxxy213

    Bloxxy213

    Joined:
    Mar 24, 2023
    Posts:
    11
    NOTE TO MODERATORS: THIS THREAD IS IN THE CORRECT PLACE. PLEASE READ IT AND DO NOT MOVE IT TO SHADERS, ITS NOT A SHADER PROBLEM. ITS A LOGIC ISSUE.

    Hello! So I'm trying to make terrain using compute shaders instead of CPU, and it works just fine for one single chunk, but whenever I try to use more chunks it gives weird results.

    One chunk:

    CPU:


    View attachment 1227954

    GPU:

    View attachment 1227957

    Multiple chunks (This is where it breaks itself):

    CPU:

    View attachment 1227972

    GPU:

    View attachment 1227975
     
  2. Bloxxy213

    Bloxxy213

    Joined:
    Mar 24, 2023
    Posts:
    11