Search Unity

Question Applying texture to a terrain mesh

Discussion in 'General Graphics' started by Lazy_Evaluation, May 8, 2022.

  1. Lazy_Evaluation

    Lazy_Evaluation

    Joined:
    Nov 16, 2019
    Posts:
    16
    Hello! I've got a working procedural terrain system that creates meshes as chunks. I need to apply texture in it. I'd like the drawing to be data-based (an array created in real time via scripting, containing the information of each square of terrain: a bit like a tilemap), and not just a shader that calculates color/texture based on height: I need that because I need to edit the terrain texture in real time. (e.g. the player removes grass, different biomes etc).
    How can I do that?


    I've now searched for months online and it seems like there are absolutely no tutorials or articles about that, it's the first time in 2 years of learning game development that this happened to me. Sebastian Larson, with his procedural tutorial video, got close to what I wanted (he still applied texture based on height), but now the videos are 6 years old and what he has writted is not anymore compatible with URP! It feels like noone can help me... And I'm really stuck on this problem. If you can help please, it would be really appreciated.