【发布时间】:2019-06-13 11:42:23
【问题描述】:
Octree 保存体素 lod 级别,单个 Octant 有 16x16x16 体素。
需要在所有 6 个面上获取 Octant 的邻居体素(邻居不得有子对象),以便为无缝网格创建正确的网格边界。
人脸可以有多个邻居或部分邻居。
例如:
Octant 的比例为 64,一个邻居的比例为 32 -> 一个 Octant 侧面体素从 4(2x2) 个相邻体素计算,
另一个邻居的比例为 16 -> 一个 Octant 侧体素从 16(4x4) 个体素计算得出。
第三个邻居的比例为 1 -> 一个八分圆侧体素从 4096(64*64) 个体素计算得出。
Octant 可以有太多的邻居,需要添加一些限制。
当邻居更新时 - 设置“网格边界过时”标志
当前不好的解决方案:不要得到邻居,所以渲染所有侧面体素。
我的想法:
solution 1:
{
p_neighbours[Face::FACE_COUNT] in Octant
create Octant neighbours for all childs on creating
create Octant neighbours when childs are removed
update meshs_borders flag when neighbour changed
Octant with childs has invalid Octant neighbours
problems:
Octant can have too many neighbours with different scales, or part of neighbour
hard to code and maintain, too much cases to solve
Octant still can have too many neighbours
}
solution 2:
{
don't store neighbour pointers in childs
instead get neighbour every time by coordinates
same problems as in prev solution, and new:
can't update "mesh borders out of date" flag when creating or removing childs
}
【问题讨论】:
标签: graphics 3d mesh voxel octree