소스 검색

Further optimize not drawing tiles that have all their children drawn.

Previously, tiles with fewer than four children were always drawn, even if
all their children were also drawn.
pull/1205/head
Matthew Petroff 9 달 전
부모
커밋
021b512fa8
1개의 변경된 파일11개의 추가작업 그리고 4개의 파일을 삭제
  1. +11
    -4
      src/js/libpannellum.js

+ 11
- 4
src/js/libpannellum.js 파일 보기

@@ -1078,11 +1078,10 @@ function Renderer(container, context) {
}
// Draw tiles
for (var i = 0; i < program.currentNodes.length; i++) {
// This optimization that doesn't draw a node if all its children
// will be drawn ignores the fact that some nodes don't have
// four children; these tiles are always drawn.
// This optimization doesn't draw a node if all its children
// will be drawn
if (program.currentNodes[i].textureLoaded > 1 &&
node_paths[program.currentNodes[i].path] != 4) {
node_paths[program.currentNodes[i].path] != program.currentNodes[i].numChildren) {
//var color = program.currentNodes[i].color;
//gl.uniform4f(program.colorUniform, color[0], color[1], color[2], 1.0);
@@ -1269,6 +1268,7 @@ function Renderer(container, context) {
f3 = 0;
i3 = 1;
}
node.numChildren = 2;
}
if (node.y == numTiles) {
f2 = 0;
@@ -1277,7 +1277,12 @@ function Renderer(container, context) {
f3 = 0;
i3 = 1;
}
node.numChildren = 2;
}
if (node.x == numTiles && node.y == numTiles)
node.numChildren = 1;
} else {
node.numChildren = 4;
}
vtmp = new Float32Array([
@@ -1322,6 +1327,8 @@ function Renderer(container, context) {
for (var j = 0; j < children.length; j++) {
testMultiresNode(rotPersp, rotPerspNoClip, children[j], pitch, yaw, hfov);
}
} else {
node.numChildren = 0;
}
}
}


불러오는 중...
취소
저장