mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
more voxelEctomy
This commit is contained in:
parent
27d8ccb51e
commit
95bb125e48
6 changed files with 40 additions and 40 deletions
|
@ -2897,21 +2897,21 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly, RenderAr
|
||||||
renderViewFrustum(_viewFrustum);
|
renderViewFrustum(_viewFrustum);
|
||||||
}
|
}
|
||||||
|
|
||||||
// render voxel fades if they exist
|
// render octree fades if they exist
|
||||||
if (_voxelFades.size() > 0) {
|
if (_octreeFades.size() > 0) {
|
||||||
PerformanceTimer perfTimer("voxelFades");
|
PerformanceTimer perfTimer("octreeFades");
|
||||||
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
||||||
"Application::displaySide() ... voxel fades...");
|
"Application::displaySide() ... octree fades...");
|
||||||
_voxelFadesLock.lockForWrite();
|
_octreeFadesLock.lockForWrite();
|
||||||
for(std::vector<VoxelFade>::iterator fade = _voxelFades.begin(); fade != _voxelFades.end();) {
|
for(std::vector<OctreeFade>::iterator fade = _octreeFades.begin(); fade != _octreeFades.end();) {
|
||||||
fade->render();
|
fade->render();
|
||||||
if(fade->isDone()) {
|
if(fade->isDone()) {
|
||||||
fade = _voxelFades.erase(fade);
|
fade = _octreeFades.erase(fade);
|
||||||
} else {
|
} else {
|
||||||
++fade;
|
++fade;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_voxelFadesLock.unlock();
|
_octreeFadesLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
// give external parties a change to hook in
|
// give external parties a change to hook in
|
||||||
|
@ -3453,13 +3453,13 @@ void Application::nodeKilled(SharedNodePointer node) {
|
||||||
|
|
||||||
// Add the jurisditionDetails object to the list of "fade outs"
|
// Add the jurisditionDetails object to the list of "fade outs"
|
||||||
if (!Menu::getInstance()->isOptionChecked(MenuOption::DontFadeOnOctreeServerChanges)) {
|
if (!Menu::getInstance()->isOptionChecked(MenuOption::DontFadeOnOctreeServerChanges)) {
|
||||||
VoxelFade fade(VoxelFade::FADE_OUT, NODE_KILLED_RED, NODE_KILLED_GREEN, NODE_KILLED_BLUE);
|
OctreeFade fade(OctreeFade::FADE_OUT, NODE_KILLED_RED, NODE_KILLED_GREEN, NODE_KILLED_BLUE);
|
||||||
fade.voxelDetails = rootDetails;
|
fade.voxelDetails = rootDetails;
|
||||||
const float slightly_smaller = 0.99f;
|
const float slightly_smaller = 0.99f;
|
||||||
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
|
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
|
||||||
_voxelFadesLock.lockForWrite();
|
_octreeFadesLock.lockForWrite();
|
||||||
_voxelFades.push_back(fade);
|
_octreeFades.push_back(fade);
|
||||||
_voxelFadesLock.unlock();
|
_octreeFadesLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the model server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server
|
// If the model server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server
|
||||||
|
@ -3539,13 +3539,13 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin
|
||||||
|
|
||||||
// Add the jurisditionDetails object to the list of "fade outs"
|
// Add the jurisditionDetails object to the list of "fade outs"
|
||||||
if (!Menu::getInstance()->isOptionChecked(MenuOption::DontFadeOnOctreeServerChanges)) {
|
if (!Menu::getInstance()->isOptionChecked(MenuOption::DontFadeOnOctreeServerChanges)) {
|
||||||
VoxelFade fade(VoxelFade::FADE_OUT, NODE_ADDED_RED, NODE_ADDED_GREEN, NODE_ADDED_BLUE);
|
OctreeFade fade(OctreeFade::FADE_OUT, NODE_ADDED_RED, NODE_ADDED_GREEN, NODE_ADDED_BLUE);
|
||||||
fade.voxelDetails = rootDetails;
|
fade.voxelDetails = rootDetails;
|
||||||
const float slightly_smaller = 0.99f;
|
const float slightly_smaller = 0.99f;
|
||||||
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
|
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
|
||||||
_voxelFadesLock.lockForWrite();
|
_octreeFadesLock.lockForWrite();
|
||||||
_voxelFades.push_back(fade);
|
_octreeFades.push_back(fade);
|
||||||
_voxelFadesLock.unlock();
|
_octreeFadesLock.unlock();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
jurisdiction->unlock();
|
jurisdiction->unlock();
|
||||||
|
|
|
@ -68,8 +68,8 @@
|
||||||
#include "ui/ApplicationOverlay.h"
|
#include "ui/ApplicationOverlay.h"
|
||||||
#include "ui/RunningScriptsWidget.h"
|
#include "ui/RunningScriptsWidget.h"
|
||||||
#include "ui/ToolWindow.h"
|
#include "ui/ToolWindow.h"
|
||||||
#include "voxels/VoxelFade.h"
|
#include "octree/OctreeFade.h"
|
||||||
#include "voxels/OctreePacketProcessor.h"
|
#include "octree/OctreePacketProcessor.h"
|
||||||
|
|
||||||
|
|
||||||
#include "UndoStackScriptingInterface.h"
|
#include "UndoStackScriptingInterface.h"
|
||||||
|
@ -535,8 +535,8 @@ private:
|
||||||
|
|
||||||
NodeBounds _nodeBoundsDisplay;
|
NodeBounds _nodeBoundsDisplay;
|
||||||
|
|
||||||
std::vector<VoxelFade> _voxelFades;
|
std::vector<OctreeFade> _octreeFades;
|
||||||
QReadWriteLock _voxelFadesLock;
|
QReadWriteLock _octreeFadesLock;
|
||||||
ControllerScriptingInterface _controllerScriptingInterface;
|
ControllerScriptingInterface _controllerScriptingInterface;
|
||||||
QPointer<LogDialog> _logDialog;
|
QPointer<LogDialog> _logDialog;
|
||||||
QPointer<SnapshotShareDialog> _snapshotShareDialog;
|
QPointer<SnapshotShareDialog> _snapshotShareDialog;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// VoxelFade.cpp
|
// OctreeFade.cpp
|
||||||
// interface/src/voxels
|
// interface/src/voxels
|
||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 8/6/13.
|
// Created by Brad Hefta-Gaub on 8/6/13.
|
||||||
|
@ -16,19 +16,19 @@
|
||||||
#include <OctreeConstants.h>
|
#include <OctreeConstants.h>
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "VoxelFade.h"
|
#include "OctreeFade.h"
|
||||||
|
|
||||||
const float VoxelFade::FADE_OUT_START = 0.5f;
|
const float OctreeFade::FADE_OUT_START = 0.5f;
|
||||||
const float VoxelFade::FADE_OUT_END = 0.05f;
|
const float OctreeFade::FADE_OUT_END = 0.05f;
|
||||||
const float VoxelFade::FADE_OUT_STEP = 0.9f;
|
const float OctreeFade::FADE_OUT_STEP = 0.9f;
|
||||||
const float VoxelFade::FADE_IN_START = 0.05f;
|
const float OctreeFade::FADE_IN_START = 0.05f;
|
||||||
const float VoxelFade::FADE_IN_END = 0.5f;
|
const float OctreeFade::FADE_IN_END = 0.5f;
|
||||||
const float VoxelFade::FADE_IN_STEP = 1.1f;
|
const float OctreeFade::FADE_IN_STEP = 1.1f;
|
||||||
const float VoxelFade::DEFAULT_RED = 0.5f;
|
const float OctreeFade::DEFAULT_RED = 0.5f;
|
||||||
const float VoxelFade::DEFAULT_GREEN = 0.5f;
|
const float OctreeFade::DEFAULT_GREEN = 0.5f;
|
||||||
const float VoxelFade::DEFAULT_BLUE = 0.5f;
|
const float OctreeFade::DEFAULT_BLUE = 0.5f;
|
||||||
|
|
||||||
VoxelFade::VoxelFade(FadeDirection direction, float red, float green, float blue) :
|
OctreeFade::OctreeFade(FadeDirection direction, float red, float green, float blue) :
|
||||||
direction(direction),
|
direction(direction),
|
||||||
red(red),
|
red(red),
|
||||||
green(green),
|
green(green),
|
||||||
|
@ -37,7 +37,7 @@ VoxelFade::VoxelFade(FadeDirection direction, float red, float green, float blue
|
||||||
opacity = (direction == FADE_OUT) ? FADE_OUT_START : FADE_IN_START;
|
opacity = (direction == FADE_OUT) ? FADE_OUT_START : FADE_IN_START;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelFade::render() {
|
void OctreeFade::render() {
|
||||||
DependencyManager::get<GlowEffect>()->begin();
|
DependencyManager::get<GlowEffect>()->begin();
|
||||||
|
|
||||||
glDisable(GL_LIGHTING);
|
glDisable(GL_LIGHTING);
|
||||||
|
@ -59,7 +59,7 @@ void VoxelFade::render() {
|
||||||
opacity *= (direction == FADE_OUT) ? FADE_OUT_STEP : FADE_IN_STEP;
|
opacity *= (direction == FADE_OUT) ? FADE_OUT_STEP : FADE_IN_STEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VoxelFade::isDone() const {
|
bool OctreeFade::isDone() const {
|
||||||
if (direction == FADE_OUT) {
|
if (direction == FADE_OUT) {
|
||||||
return opacity <= FADE_OUT_END;
|
return opacity <= FADE_OUT_END;
|
||||||
} else {
|
} else {
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// VoxelFade.h
|
// OctreeFade.h
|
||||||
// interface/src/voxels
|
// interface/src/voxels
|
||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 8/6/13.
|
// Created by Brad Hefta-Gaub on 8/6/13.
|
||||||
|
@ -9,12 +9,12 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef hifi_VoxelFade_h
|
#ifndef hifi_OctreeFade_h
|
||||||
#define hifi_VoxelFade_h
|
#define hifi_OctreeFade_h
|
||||||
|
|
||||||
#include <OctalCode.h> // for VoxelPositionSize
|
#include <OctalCode.h> // for VoxelPositionSize
|
||||||
|
|
||||||
class VoxelFade {
|
class OctreeFade {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum FadeDirection { FADE_OUT, FADE_IN};
|
enum FadeDirection { FADE_OUT, FADE_IN};
|
||||||
|
@ -36,11 +36,11 @@ public:
|
||||||
float green;
|
float green;
|
||||||
float blue;
|
float blue;
|
||||||
|
|
||||||
VoxelFade(FadeDirection direction = FADE_OUT, float red = DEFAULT_RED,
|
OctreeFade(FadeDirection direction = FADE_OUT, float red = DEFAULT_RED,
|
||||||
float green = DEFAULT_GREEN, float blue = DEFAULT_BLUE);
|
float green = DEFAULT_GREEN, float blue = DEFAULT_BLUE);
|
||||||
|
|
||||||
void render();
|
void render();
|
||||||
bool isDone() const;
|
bool isDone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_VoxelFade_h
|
#endif // hifi_OctreeFade_h
|
Loading…
Reference in a new issue