Search Unity

Generate a low poly water chunk on a (proceduraly) generated land mass

Discussion in 'Scripting' started by Orr10c, Oct 7, 2017.

  1. Orr10c

    Orr10c

    Joined:
    Sep 11, 2016
    Posts:
    45
    Hello! :)

    So i'm working on this low poly game where i'm generating a procedural low poly land mass by combining a number of perlin noise functions, lately I have been working on adding water to the map generation but i've incountered some problems so i'm turning to you guys for help: The generated water is a prefab of a squared mesh generated through script attatched to that prefab, the mesh has a waves effect done by using another perlin noise function, then I can litterate through my 2d array which holds the surface info and can generate the water when the surface is lower then some value and the water will only be visible on the parts where the surface is lower than the water's height, the problem with that is sometimes you can just see a part of the water mesh peeking through a mountain or a hill and its just cut because it is the edge of the mesh (because it's a square shape)... I've thought of a few things that could solve this problem but they seem slopy and sometimes even demanding too much CPU power (another something that needs consideration), for example try and generate a specific mesh shape to fit the place it's being instantiated at or find another way rather than instantiating a water prefab but these ways also have their disadvantages.

    Anyway, i'm open to seggestions, since it's my first time experiencing this kind of games i'm learning everything for the first time so I would really like to learn from more experienced people ways of doing this, thanks alot for any help! :D