mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
removed obsolete ResIn mode
This commit is contained in:
parent
3d3eca9afa
commit
dc70675c22
6 changed files with 2 additions and 144 deletions
|
@ -1235,10 +1235,6 @@ void Application::setWantsMonochrome(bool wantsMonochrome) {
|
|||
_myAvatar.setWantColor(!wantsMonochrome);
|
||||
}
|
||||
|
||||
void Application::setWantsResIn(bool wantsResIn) {
|
||||
_myAvatar.setWantResIn(wantsResIn);
|
||||
}
|
||||
|
||||
void Application::setWantsDelta(bool wantsDelta) {
|
||||
_myAvatar.setWantDelta(wantsDelta);
|
||||
}
|
||||
|
@ -1629,7 +1625,6 @@ void Application::initMenu() {
|
|||
renderDebugMenu->addAction("FALSE Color Occluded V2 Voxels", this, SLOT(doFalseColorizeOccludedV2()), Qt::CTRL | Qt::Key_P);
|
||||
renderDebugMenu->addAction("Show TRUE Colors", this, SLOT(doTrueVoxelColors()), Qt::CTRL | Qt::Key_T);
|
||||
|
||||
debugMenu->addAction("Wants Res-In", this, SLOT(setWantsResIn(bool)))->setCheckable(true);
|
||||
debugMenu->addAction("Wants Monochrome", this, SLOT(setWantsMonochrome(bool)))->setCheckable(true);
|
||||
debugMenu->addAction("Wants View Delta Sending", this, SLOT(setWantsDelta(bool)))->setCheckable(true);
|
||||
(_shouldLowPassFilter = debugMenu->addAction("Test: LowPass filter"))->setCheckable(true);
|
||||
|
|
|
@ -136,7 +136,6 @@ private slots:
|
|||
void doTrueVoxelColors();
|
||||
void doTreeStats();
|
||||
void setWantsMonochrome(bool wantsMonochrome);
|
||||
void setWantsResIn(bool wantsResIn);
|
||||
void setWantsDelta(bool wantsDelta);
|
||||
void disableOcclusionCulling(bool disableOcclusionCulling);
|
||||
void updateVoxelModeActions();
|
||||
|
|
|
@ -32,7 +32,6 @@ AvatarData::AvatarData(Node* owningNode) :
|
|||
_cameraNearClip(0.0f),
|
||||
_cameraFarClip(0.0f),
|
||||
_keyState(NO_KEY_DOWN),
|
||||
_wantResIn(false),
|
||||
_wantColor(true),
|
||||
_wantDelta(false),
|
||||
_wantOcclusionCulling(true),
|
||||
|
@ -113,7 +112,6 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
|||
|
||||
// bitMask of less than byte wide items
|
||||
unsigned char bitItems = 0;
|
||||
if (_wantResIn) { setAtBit(bitItems, WANT_RESIN_AT_BIT); }
|
||||
if (_wantColor) { setAtBit(bitItems, WANT_COLOR_AT_BIT); }
|
||||
if (_wantDelta) { setAtBit(bitItems, WANT_DELTA_AT_BIT); }
|
||||
if (_wantOcclusionCulling) { setAtBit(bitItems, WANT_OCCLUSION_CULLING_BIT); }
|
||||
|
@ -240,7 +238,6 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
|
|||
// voxel sending features...
|
||||
unsigned char bitItems = 0;
|
||||
bitItems = (unsigned char)*sourceBuffer++;
|
||||
_wantResIn = oneAtBit(bitItems, WANT_RESIN_AT_BIT);
|
||||
_wantColor = oneAtBit(bitItems, WANT_COLOR_AT_BIT);
|
||||
_wantDelta = oneAtBit(bitItems, WANT_DELTA_AT_BIT);
|
||||
_wantOcclusionCulling = oneAtBit(bitItems, WANT_OCCLUSION_CULLING_BIT);
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "HeadData.h"
|
||||
#include "HandData.h"
|
||||
|
||||
const int WANT_RESIN_AT_BIT = 0;
|
||||
const int UNUSED_BIT = 0; // this bit is available to use
|
||||
const int WANT_COLOR_AT_BIT = 1;
|
||||
const int WANT_DELTA_AT_BIT = 2;
|
||||
const int KEY_STATE_START_BIT = 3; // 4th and 5th bits
|
||||
|
@ -91,11 +91,9 @@ public:
|
|||
const std::string& chatMessage () const { return _chatMessage; }
|
||||
|
||||
// related to Voxel Sending strategies
|
||||
bool getWantResIn() const { return _wantResIn; }
|
||||
bool getWantColor() const { return _wantColor; }
|
||||
bool getWantDelta() const { return _wantDelta; }
|
||||
bool getWantOcclusionCulling() const { return _wantOcclusionCulling; }
|
||||
void setWantResIn(bool wantResIn) { _wantResIn = wantResIn; }
|
||||
void setWantColor(bool wantColor) { _wantColor = wantColor; }
|
||||
void setWantDelta(bool wantDelta) { _wantDelta = wantDelta; }
|
||||
void setWantOcclusionCulling(bool wantOcclusionCulling) { _wantOcclusionCulling = wantOcclusionCulling; }
|
||||
|
@ -130,7 +128,6 @@ protected:
|
|||
std::string _chatMessage;
|
||||
|
||||
// voxel server sending items
|
||||
bool _wantResIn;
|
||||
bool _wantColor;
|
||||
bool _wantDelta;
|
||||
bool _wantOcclusionCulling;
|
||||
|
|
|
@ -98,7 +98,6 @@ void VoxelTree::recurseTreeWithOperationDistanceSortedTimed(PointerStack* stackO
|
|||
for (int i = currentCount-1; i >= 0; i--) {
|
||||
VoxelNode* child = sortedChildren[i];
|
||||
stackOfNodes->push(child);
|
||||
//printLog("stackOfNodes->size()=%d child->getLevel()=%d\n",stackOfNodes->size(), child->getLevel());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -111,130 +111,6 @@ void eraseVoxelTreeAndCleanupNodeVisitData() {
|
|||
}
|
||||
|
||||
|
||||
// Version of voxel distributor that sends each LOD level at a time
|
||||
void resInVoxelDistributor(NodeList* nodeList,
|
||||
NodeList::iterator& node,
|
||||
VoxelNodeData* nodeData) {
|
||||
ViewFrustum viewFrustum = nodeData->getCurrentViewFrustum();
|
||||
bool searchReset = false;
|
||||
int searchLoops = 0;
|
||||
int searchLevelWas = nodeData->getMaxSearchLevel();
|
||||
long long start = usecTimestampNow();
|
||||
while (!searchReset && nodeData->nodeBag.isEmpty()) {
|
||||
searchLoops++;
|
||||
|
||||
searchLevelWas = nodeData->getMaxSearchLevel();
|
||||
int maxLevelReached = serverTree.searchForColoredNodes(nodeData->getMaxSearchLevel(), serverTree.rootNode,
|
||||
viewFrustum, nodeData->nodeBag);
|
||||
nodeData->setMaxLevelReached(maxLevelReached);
|
||||
|
||||
// If nothing got added, then we bump our levels.
|
||||
if (nodeData->nodeBag.isEmpty()) {
|
||||
if (nodeData->getMaxLevelReached() < nodeData->getMaxSearchLevel()) {
|
||||
nodeData->resetMaxSearchLevel();
|
||||
searchReset = true;
|
||||
} else {
|
||||
nodeData->incrementMaxSearchLevel();
|
||||
}
|
||||
}
|
||||
}
|
||||
long long end = usecTimestampNow();
|
||||
int elapsedmsec = (end - start)/1000;
|
||||
if (elapsedmsec > 100) {
|
||||
if (elapsedmsec > 1000) {
|
||||
int elapsedsec = (end - start)/1000000;
|
||||
printf("WARNING! searchForColoredNodes() took %d seconds to identify %d nodes at level %d in %d loops\n",
|
||||
elapsedsec, nodeData->nodeBag.count(), searchLevelWas, searchLoops);
|
||||
} else {
|
||||
printf("WARNING! searchForColoredNodes() took %d milliseconds to identify %d nodes at level %d in %d loops\n",
|
||||
elapsedmsec, nodeData->nodeBag.count(), searchLevelWas, searchLoops);
|
||||
}
|
||||
} else if (::debugVoxelSending) {
|
||||
printf("searchForColoredNodes() took %d milliseconds to identify %d nodes at level %d in %d loops\n",
|
||||
elapsedmsec, nodeData->nodeBag.count(), searchLevelWas, searchLoops);
|
||||
}
|
||||
|
||||
|
||||
// If we have something in our nodeBag, then turn them into packets and send them out...
|
||||
if (!nodeData->nodeBag.isEmpty()) {
|
||||
static unsigned char tempOutputBuffer[MAX_VOXEL_PACKET_SIZE - 1]; // save on allocs by making this static
|
||||
int bytesWritten = 0;
|
||||
int packetsSentThisInterval = 0;
|
||||
int truePacketsSent = 0;
|
||||
int trueBytesSent = 0;
|
||||
long long start = usecTimestampNow();
|
||||
|
||||
bool shouldSendEnvironments = shouldDo(ENVIRONMENT_SEND_INTERVAL_USECS, VOXEL_SEND_INTERVAL_USECS);
|
||||
while (packetsSentThisInterval < PACKETS_PER_CLIENT_PER_INTERVAL - (shouldSendEnvironments ? 1 : 0)) {
|
||||
if (!nodeData->nodeBag.isEmpty()) {
|
||||
VoxelNode* subTree = nodeData->nodeBag.extract();
|
||||
|
||||
EncodeBitstreamParams params(nodeData->getMaxSearchLevel(), &viewFrustum,
|
||||
nodeData->getWantColor(), WANT_EXISTS_BITS);
|
||||
|
||||
bytesWritten = serverTree.encodeTreeBitstream(subTree, &tempOutputBuffer[0], MAX_VOXEL_PACKET_SIZE - 1,
|
||||
nodeData->nodeBag, params);
|
||||
|
||||
if (nodeData->getAvailable() >= bytesWritten) {
|
||||
nodeData->writeToPacket(&tempOutputBuffer[0], bytesWritten);
|
||||
} else {
|
||||
nodeList->getNodeSocket()->send(node->getActiveSocket(),
|
||||
nodeData->getPacket(), nodeData->getPacketLength());
|
||||
trueBytesSent += nodeData->getPacketLength();
|
||||
truePacketsSent++;
|
||||
packetsSentThisInterval++;
|
||||
nodeData->resetVoxelPacket();
|
||||
nodeData->writeToPacket(&tempOutputBuffer[0], bytesWritten);
|
||||
}
|
||||
} else {
|
||||
if (nodeData->isPacketWaiting()) {
|
||||
nodeList->getNodeSocket()->send(node->getActiveSocket(),
|
||||
nodeData->getPacket(), nodeData->getPacketLength());
|
||||
trueBytesSent += nodeData->getPacketLength();
|
||||
truePacketsSent++;
|
||||
nodeData->resetVoxelPacket();
|
||||
|
||||
}
|
||||
packetsSentThisInterval = PACKETS_PER_CLIENT_PER_INTERVAL; // done for now, no nodes left
|
||||
}
|
||||
}
|
||||
// send the environment packets
|
||||
if (shouldSendEnvironments) {
|
||||
int envPacketLength = 1;
|
||||
*tempOutputBuffer = PACKET_HEADER_ENVIRONMENT_DATA;
|
||||
for (int i = 0; i < sizeof(environmentData) / sizeof(environmentData[0]); i++) {
|
||||
envPacketLength += environmentData[i].getBroadcastData(tempOutputBuffer + envPacketLength);
|
||||
}
|
||||
nodeList->getNodeSocket()->send(node->getActiveSocket(), tempOutputBuffer, envPacketLength);
|
||||
trueBytesSent += envPacketLength;
|
||||
truePacketsSent++;
|
||||
}
|
||||
long long end = usecTimestampNow();
|
||||
int elapsedmsec = (end - start)/1000;
|
||||
if (elapsedmsec > 100) {
|
||||
if (elapsedmsec > 1000) {
|
||||
int elapsedsec = (end - start)/1000000;
|
||||
printf("WARNING! packetLoop() took %d seconds to generate %d bytes in %d packets at level %d, %d nodes still to send\n",
|
||||
elapsedsec, trueBytesSent, truePacketsSent, searchLevelWas, nodeData->nodeBag.count());
|
||||
} else {
|
||||
printf("WARNING! packetLoop() took %d milliseconds to generate %d bytes in %d packets at level %d, %d nodes still to send\n",
|
||||
elapsedmsec, trueBytesSent, truePacketsSent, searchLevelWas, nodeData->nodeBag.count());
|
||||
}
|
||||
} else if (::debugVoxelSending) {
|
||||
printf("packetLoop() took %d milliseconds to generate %d bytes in %d packets at level %d, %d nodes still to send\n",
|
||||
elapsedmsec, trueBytesSent, truePacketsSent, searchLevelWas, nodeData->nodeBag.count());
|
||||
}
|
||||
|
||||
// if during this last pass, we emptied our bag, then we want to move to the next level.
|
||||
if (nodeData->nodeBag.isEmpty()) {
|
||||
if (nodeData->getMaxLevelReached() < nodeData->getMaxSearchLevel()) {
|
||||
nodeData->resetMaxSearchLevel();
|
||||
} else {
|
||||
nodeData->incrementMaxSearchLevel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_t treeLock;
|
||||
|
||||
|
@ -463,12 +339,7 @@ void *distributeVoxelsToListeners(void *args) {
|
|||
if (::debugVoxelSending) {
|
||||
printf("nodeData->updateCurrentViewFrustum() changed=%s\n", debug::valueOf(viewFrustumChanged));
|
||||
}
|
||||
|
||||
if (nodeData->getWantResIn()) {
|
||||
resInVoxelDistributor(nodeList, node, nodeData);
|
||||
} else {
|
||||
deepestLevelVoxelDistributor(nodeList, node, nodeData, viewFrustumChanged);
|
||||
}
|
||||
deepestLevelVoxelDistributor(nodeList, node, nodeData, viewFrustumChanged);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue