History

Fixed a bug in LOD boundaries - changed the way we calculate whether or not to render a parent "average" voxel so that if any of it's most distant child would not be visible, then it's used instead of it's children - added precalculated value for topFarLeft corner of AABox (optimization) - changed VoxelSystem::newTreeToArrays() and VoxelTree::encodeTreeBitstreamRecursion() to use the same help function for determining this LOD boundary behavior - deleted old dead code in voxel-server and VoxelTree for picking which node to start sending with, since it wasn't being used - added VoxelNode::furthestDistanceToCamera() which tells you not the distance to the center of the voxel, but the distance from the camera to the furthest corner relative to the camera. - added ViewFrustum::getFurthestPointFromCamera() which given an axis-aligned box will tell you which vertex of the box is furthest from the camera

ZappoMan committed 13 years ago

Commit f415f401 parent 861ee9b11 files · +98 −169Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 11 files). Show all

Unified · Split

interface/src/VoxelSystem.cpp+1−8
@@ -319,14 +319,7 @@ int VoxelSystem::newTreeToArrays(VoxelNode* node) { · 318 unmodified lines
319319 int voxelsUpdated = 0;
320320 bool shouldRender = false; // assume we don't need to render it
321321 // if it's colored, we might need to render it!
322− if (node->isColored()) {
323− float distanceToNode = node->distanceToCamera(*Application::getInstance()->getViewFrustum());
324− float boundary = boundaryDistanceForRenderLevel(node->getLevel());
325− float childBoundary = boundaryDistanceForRenderLevel(node->getLevel() + 1);
326− bool inBoundary = (distanceToNode <= boundary);
327− bool inChildBoundary = (distanceToNode <= childBoundary);
328− shouldRender = (node->isLeaf() && inChildBoundary) || (inBoundary && !inChildBoundary);
329− }
322+ shouldRender = node->calculateShouldRender(Application::getInstance()->getViewFrustum());
330323 node->setShouldRender(shouldRender && !node->isStagedForDeletion());
331324 // let children figure out their renderness
332325 if (!node->isLeaf()) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t