Search Unity

Displaying Polygon Shaped Areas on Terrain/Surface/Ground

Discussion in 'Scripting' started by Tifufu, Sep 12, 2022.

  1. Tifufu

    Tifufu

    Joined:
    Aug 15, 2017
    Posts:
    3
    Problem:
    I have a set of 2D polygon shapes, each one with a varying amount of points that are determined at runtime.
    I need to draw (or "paint") these polygons on top of a surface.
    I also need to fill in the areas of each polygon with a specific color that is also determined at runtime.
    The polygons only really need to be drawn once, however solutions that would allow me to update/change the colors would be nice.
    The project will be built for WebGL

    What are the different/best solutions that may help me achieve this?
    Am also open to suggestions and further reading

    I'm a relative Beginner to Unity but a somewhat experienced programmer and know a bit about shader programming.

    Edit:
    By polygons I don't mean geometry I just mean a regular shape I would like to paint on to a surface. Its just that I will always have polygons with a varying amount of points that are loaded in at runtime.
     
    Last edited: Sep 14, 2022
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697
  3. Tifufu

    Tifufu

    Joined:
    Aug 15, 2017
    Posts:
    3
    Thanks for the reply but i'm not exactly after creating geometry. Perhaps I should've made it more clear that I didn't mean the usual polygons in computer graphics. I just need to draw or "paint" a shape on a surface, but my shapes are always going to be polygons.