主权项 |
1. A computer-implemented method for blending custom terrain patches onto a surface of a terrain of a virtual three-dimensional environment comprising:
accessing, by at least one computer processor, terrain data that describes a mesh representing the surface of the terrain of the virtual three-dimensional environment, wherein the mesh is constructed of primitives, each primitive defined by a terrain altitude at each vertex of the primitive; accessing, by at least one computer processor, custom terrain data, wherein the custom terrain data includes a plurality of terrain altitudes arranged in a custom terrain grid, a boundary of the custom terrain grid defining an area of the surface; determining, by at least one computer processor, a surface grid from the primitives that overlap the area defined by the custom terrain grid such that each point in the surface grid includes the terrain altitude according to where the point in the surface grid falls on the mesh; determining, by at least one computer processor, a patch grid from the custom terrain grid such that each point in the patch grid includes a terrain altitude derived from the custom terrain grid, wherein a resolution of the patch grid corresponds to a resolution of the surface grid such that each point in the patch grid aligns with a point in the surface grid, and wherein an area of the patch grid includes at least a portion of the area of the custom terrain grid; and blending, by at least one computer processor, the patch grid and the surface grid to obtain a blended surface grid, wherein the blended surface grid includes at least one terrain altitude from the surface grid modified by a corresponding terrain altitude from the patch grid. |