Painting Polygon Shaped Areas on Terrain/Surface/Ground in Unity

Viewed 29
  • 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.

  • The polygons are to mark of specific areas on a surface so they shouldn't repeat.

  • Polygons can overlap with eachother

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 slight bit about shader programming.

By polygons I don't mean geometry I just mean a regular shapes 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.

1 Answers

First, u need to split the surface into that polygon then u need to have materials on them and the code that specifies the colour should update the colour of the material which is on that specific polygon. Creating materials could be done in code to avoid a lot of work in a simple loop.

Related