Where is the region boundary? #464
Locked
TokisanGames
announced in
Architecture
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(This is a WIP and will be ready for discussion eventually).
The image maps use one pixel to represent one vertex on the terrain. Being sized 0 to 1023, one might think the terrain boundary begins at the top left pixel 0, 0, and end at the bottom right pixel 1023, 1023. But that isn't necessarily the correct or best place to consider the edge of the region.
Currently there are several elements that take the region boundary into consideration:
Here are the current status and discussion points of each element:
Vertex position
Image pixel (0,0) is located at (0, 0, 0). Pixel (1023, 1023) is located at (1023, 0, 1023)
When another region is added, a mesh appears to bridge the gap. Is this a seam mesh?
Collision shape
It begins at 0, 0, 0 and goes to (1024, 0, 1024). It is 1025^2 units, creating a 1 unit row and column lip to bridge the gap to the next region. It reads from the adjacent heightmaps to set this lip.
See #152 for more discussion on this lip.
Height map & alignment with physics
Each pixel on the height map is read into the collision shape vertex height and the shader vertex height. The shader is responsible for aligning the mesh with the collision, which has required a half texel offset in the past, though I'm not sure if that's still the case.
Both are addressed in the two sections above and extends from (0, 0, 0) to (1023, 0, 1023).
Control map
Like above, it extends from (0, 0, 0) to (1023, 0, 1023). It seamlessly blends textures across region boundaries, whether that extends to a seam mesh, or to another region or background mesh.
Color map
Discarded vertices
Vertex grid
when worldbackground is NONE
Region border gizmo
The gizmo starts at 0, 0, and finds edges at 1024, and 2048.
Prior to #348, the function that positions colormap was seemingly off by half a texel. That PR inserted an offset.
Now we're in the situation where the gridmap
Beta Was this translation helpful? Give feedback.
All reactions