mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 01:00:44 +02:00
Merge pull request #5307 from howard-stearns/remove-octreeFades
Remove old octreeFade code that wasn't working anyway
This commit is contained in:
commit
049419cec7
7 changed files with 0 additions and 165 deletions
|
@ -3572,23 +3572,6 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se
|
||||||
if (!selfAvatarOnly) {
|
if (!selfAvatarOnly) {
|
||||||
_nodeBoundsDisplay.draw();
|
_nodeBoundsDisplay.draw();
|
||||||
|
|
||||||
// render octree fades if they exist
|
|
||||||
if (_octreeFades.size() > 0) {
|
|
||||||
PerformanceTimer perfTimer("octreeFades");
|
|
||||||
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
|
||||||
"Application::displaySide() ... octree fades...");
|
|
||||||
_octreeFadesLock.lockForWrite();
|
|
||||||
for(std::vector<OctreeFade>::iterator fade = _octreeFades.begin(); fade != _octreeFades.end();) {
|
|
||||||
fade->render(renderArgs);
|
|
||||||
if(fade->isDone()) {
|
|
||||||
fade = _octreeFades.erase(fade);
|
|
||||||
} else {
|
|
||||||
++fade;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_octreeFadesLock.unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
// give external parties a change to hook in
|
// give external parties a change to hook in
|
||||||
{
|
{
|
||||||
PerformanceTimer perfTimer("inWorldInterface");
|
PerformanceTimer perfTimer("inWorldInterface");
|
||||||
|
@ -3880,17 +3863,6 @@ void Application::nodeKilled(SharedNodePointer node) {
|
||||||
qCDebug(interfaceapp, "model server going away...... v[%f, %f, %f, %f]",
|
qCDebug(interfaceapp, "model server going away...... v[%f, %f, %f, %f]",
|
||||||
(double)rootDetails.x, (double)rootDetails.y, (double)rootDetails.z, (double)rootDetails.s);
|
(double)rootDetails.x, (double)rootDetails.y, (double)rootDetails.z, (double)rootDetails.s);
|
||||||
|
|
||||||
// Add the jurisditionDetails object to the list of "fade outs"
|
|
||||||
if (!Menu::getInstance()->isOptionChecked(MenuOption::DontFadeOnOctreeServerChanges)) {
|
|
||||||
OctreeFade fade(OctreeFade::FADE_OUT, NODE_KILLED_RED, NODE_KILLED_GREEN, NODE_KILLED_BLUE);
|
|
||||||
fade.voxelDetails = rootDetails;
|
|
||||||
const float slightly_smaller = 0.99f;
|
|
||||||
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
|
|
||||||
_octreeFadesLock.lockForWrite();
|
|
||||||
_octreeFades.push_back(fade);
|
|
||||||
_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
|
||||||
_entityServerJurisdictions.lockForWrite();
|
_entityServerJurisdictions.lockForWrite();
|
||||||
_entityServerJurisdictions.erase(_entityServerJurisdictions.find(nodeUUID));
|
_entityServerJurisdictions.erase(_entityServerJurisdictions.find(nodeUUID));
|
||||||
|
@ -3967,16 +3939,6 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin
|
||||||
qPrintable(serverType),
|
qPrintable(serverType),
|
||||||
(double)rootDetails.x, (double)rootDetails.y, (double)rootDetails.z, (double)rootDetails.s);
|
(double)rootDetails.x, (double)rootDetails.y, (double)rootDetails.z, (double)rootDetails.s);
|
||||||
|
|
||||||
// Add the jurisditionDetails object to the list of "fade outs"
|
|
||||||
if (!Menu::getInstance()->isOptionChecked(MenuOption::DontFadeOnOctreeServerChanges)) {
|
|
||||||
OctreeFade fade(OctreeFade::FADE_OUT, NODE_ADDED_RED, NODE_ADDED_GREEN, NODE_ADDED_BLUE);
|
|
||||||
fade.voxelDetails = rootDetails;
|
|
||||||
const float slightly_smaller = 0.99f;
|
|
||||||
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
|
|
||||||
_octreeFadesLock.lockForWrite();
|
|
||||||
_octreeFades.push_back(fade);
|
|
||||||
_octreeFadesLock.unlock();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
jurisdiction->unlock();
|
jurisdiction->unlock();
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,6 @@
|
||||||
#include "ui/ToolWindow.h"
|
#include "ui/ToolWindow.h"
|
||||||
#include "ui/UserInputMapper.h"
|
#include "ui/UserInputMapper.h"
|
||||||
#include "devices/KeyboardMouseDevice.h"
|
#include "devices/KeyboardMouseDevice.h"
|
||||||
#include "octree/OctreeFade.h"
|
|
||||||
#include "octree/OctreePacketProcessor.h"
|
#include "octree/OctreePacketProcessor.h"
|
||||||
#include "UndoStackScriptingInterface.h"
|
#include "UndoStackScriptingInterface.h"
|
||||||
|
|
||||||
|
@ -91,13 +90,6 @@ class Node;
|
||||||
class ProgramObject;
|
class ProgramObject;
|
||||||
class ScriptEngine;
|
class ScriptEngine;
|
||||||
|
|
||||||
static const float NODE_ADDED_RED = 0.0f;
|
|
||||||
static const float NODE_ADDED_GREEN = 1.0f;
|
|
||||||
static const float NODE_ADDED_BLUE = 0.0f;
|
|
||||||
static const float NODE_KILLED_RED = 1.0f;
|
|
||||||
static const float NODE_KILLED_GREEN = 0.0f;
|
|
||||||
static const float NODE_KILLED_BLUE = 0.0f;
|
|
||||||
|
|
||||||
static const QString SNAPSHOT_EXTENSION = ".jpg";
|
static const QString SNAPSHOT_EXTENSION = ".jpg";
|
||||||
static const QString SVO_EXTENSION = ".svo";
|
static const QString SVO_EXTENSION = ".svo";
|
||||||
static const QString SVO_JSON_EXTENSION = ".svo.json";
|
static const QString SVO_JSON_EXTENSION = ".svo.json";
|
||||||
|
@ -627,8 +619,6 @@ private:
|
||||||
|
|
||||||
NodeBounds _nodeBoundsDisplay;
|
NodeBounds _nodeBoundsDisplay;
|
||||||
|
|
||||||
std::vector<OctreeFade> _octreeFades;
|
|
||||||
QReadWriteLock _octreeFadesLock;
|
|
||||||
ControllerScriptingInterface _controllerScriptingInterface;
|
ControllerScriptingInterface _controllerScriptingInterface;
|
||||||
QPointer<LogDialog> _logDialog;
|
QPointer<LogDialog> _logDialog;
|
||||||
QPointer<SnapshotShareDialog> _snapshotShareDialog;
|
QPointer<SnapshotShareDialog> _snapshotShareDialog;
|
||||||
|
|
|
@ -340,7 +340,6 @@ Menu::Menu() {
|
||||||
0, // QML Qt::SHIFT | Qt::Key_A,
|
0, // QML Qt::SHIFT | Qt::Key_A,
|
||||||
true);
|
true);
|
||||||
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AmbientOcclusion);
|
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AmbientOcclusion);
|
||||||
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::DontFadeOnOctreeServerChanges);
|
|
||||||
|
|
||||||
MenuWrapper* ambientLightMenu = renderOptionsMenu->addMenu(MenuOption::RenderAmbientLight);
|
MenuWrapper* ambientLightMenu = renderOptionsMenu->addMenu(MenuOption::RenderAmbientLight);
|
||||||
QActionGroup* ambientLightGroup = new QActionGroup(ambientLightMenu);
|
QActionGroup* ambientLightGroup = new QActionGroup(ambientLightMenu);
|
||||||
|
|
|
@ -179,7 +179,6 @@ namespace MenuOption {
|
||||||
const QString DisplayModelElementProxy = "Display Model Element Bounds";
|
const QString DisplayModelElementProxy = "Display Model Element Bounds";
|
||||||
const QString DisplayDebugTimingDetails = "Display Timing Details";
|
const QString DisplayDebugTimingDetails = "Display Timing Details";
|
||||||
const QString DontDoPrecisionPicking = "Don't Do Precision Picking";
|
const QString DontDoPrecisionPicking = "Don't Do Precision Picking";
|
||||||
const QString DontFadeOnOctreeServerChanges = "Don't Fade In/Out on Octree Server Changes";
|
|
||||||
const QString DontRenderEntitiesAsScene = "Don't Render Entities as Scene";
|
const QString DontRenderEntitiesAsScene = "Don't Render Entities as Scene";
|
||||||
const QString EchoLocalAudio = "Echo Local Audio";
|
const QString EchoLocalAudio = "Echo Local Audio";
|
||||||
const QString EchoServerAudio = "Echo Server Audio";
|
const QString EchoServerAudio = "Echo Server Audio";
|
||||||
|
|
|
@ -1,68 +0,0 @@
|
||||||
//
|
|
||||||
// OctreeFade.cpp
|
|
||||||
// interface/src/octree
|
|
||||||
//
|
|
||||||
// Created by Brad Hefta-Gaub on 8/6/13.
|
|
||||||
// Copyright 2013 High Fidelity, Inc.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "InterfaceConfig.h"
|
|
||||||
|
|
||||||
#include <GlowEffect.h>
|
|
||||||
#include <GeometryCache.h>
|
|
||||||
#include <OctreeConstants.h>
|
|
||||||
|
|
||||||
#include "Application.h"
|
|
||||||
#include "OctreeFade.h"
|
|
||||||
|
|
||||||
const float OctreeFade::FADE_OUT_START = 0.5f;
|
|
||||||
const float OctreeFade::FADE_OUT_END = 0.05f;
|
|
||||||
const float OctreeFade::FADE_OUT_STEP = 0.9f;
|
|
||||||
const float OctreeFade::FADE_IN_START = 0.05f;
|
|
||||||
const float OctreeFade::FADE_IN_END = 0.5f;
|
|
||||||
const float OctreeFade::FADE_IN_STEP = 1.1f;
|
|
||||||
const float OctreeFade::DEFAULT_RED = 0.5f;
|
|
||||||
const float OctreeFade::DEFAULT_GREEN = 0.5f;
|
|
||||||
const float OctreeFade::DEFAULT_BLUE = 0.5f;
|
|
||||||
|
|
||||||
OctreeFade::OctreeFade(FadeDirection direction, float red, float green, float blue) :
|
|
||||||
direction(direction),
|
|
||||||
red(red),
|
|
||||||
green(green),
|
|
||||||
blue(blue)
|
|
||||||
{
|
|
||||||
opacity = (direction == FADE_OUT) ? FADE_OUT_START : FADE_IN_START;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OctreeFade::render(RenderArgs* renderArgs) {
|
|
||||||
DependencyManager::get<GlowEffect>()->begin(renderArgs);
|
|
||||||
|
|
||||||
glDisable(GL_LIGHTING);
|
|
||||||
glPushMatrix();
|
|
||||||
glScalef(1.0f, 1.0f, 1.0f);
|
|
||||||
glTranslatef(voxelDetails.x + voxelDetails.s * 0.5f,
|
|
||||||
voxelDetails.y + voxelDetails.s * 0.5f,
|
|
||||||
voxelDetails.z + voxelDetails.s * 0.5f);
|
|
||||||
glLineWidth(1.0f);
|
|
||||||
DependencyManager::get<GeometryCache>()->renderSolidCube(voxelDetails.s, glm::vec4(red, green, blue, opacity));
|
|
||||||
glLineWidth(1.0f);
|
|
||||||
glPopMatrix();
|
|
||||||
glEnable(GL_LIGHTING);
|
|
||||||
|
|
||||||
|
|
||||||
DependencyManager::get<GlowEffect>()->end(renderArgs);
|
|
||||||
|
|
||||||
opacity *= (direction == FADE_OUT) ? FADE_OUT_STEP : FADE_IN_STEP;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OctreeFade::isDone() const {
|
|
||||||
if (direction == FADE_OUT) {
|
|
||||||
return opacity <= FADE_OUT_END;
|
|
||||||
} else {
|
|
||||||
return opacity >= FADE_IN_END;
|
|
||||||
}
|
|
||||||
return true; // unexpected case, assume we're done
|
|
||||||
}
|
|
|
@ -1,46 +0,0 @@
|
||||||
//
|
|
||||||
// OctreeFade.h
|
|
||||||
// interface/src/octree
|
|
||||||
//
|
|
||||||
// Created by Brad Hefta-Gaub on 8/6/13.
|
|
||||||
// Copyright 2013 High Fidelity, Inc.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef hifi_OctreeFade_h
|
|
||||||
#define hifi_OctreeFade_h
|
|
||||||
|
|
||||||
#include <OctalCode.h> // for VoxelPositionSize
|
|
||||||
|
|
||||||
class OctreeFade {
|
|
||||||
public:
|
|
||||||
|
|
||||||
enum FadeDirection { FADE_OUT, FADE_IN};
|
|
||||||
static const float FADE_OUT_START;
|
|
||||||
static const float FADE_OUT_END;
|
|
||||||
static const float FADE_OUT_STEP;
|
|
||||||
static const float FADE_IN_START;
|
|
||||||
static const float FADE_IN_END;
|
|
||||||
static const float FADE_IN_STEP;
|
|
||||||
static const float DEFAULT_RED;
|
|
||||||
static const float DEFAULT_GREEN;
|
|
||||||
static const float DEFAULT_BLUE;
|
|
||||||
|
|
||||||
VoxelPositionSize voxelDetails;
|
|
||||||
FadeDirection direction;
|
|
||||||
float opacity;
|
|
||||||
|
|
||||||
float red;
|
|
||||||
float green;
|
|
||||||
float blue;
|
|
||||||
|
|
||||||
OctreeFade(FadeDirection direction = FADE_OUT, float red = DEFAULT_RED,
|
|
||||||
float green = DEFAULT_GREEN, float blue = DEFAULT_BLUE);
|
|
||||||
|
|
||||||
void render(RenderArgs* renderArgs);
|
|
||||||
bool isDone() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // hifi_OctreeFade_h
|
|
|
@ -125,7 +125,6 @@ public:
|
||||||
DisplayModelElementProxy,
|
DisplayModelElementProxy,
|
||||||
DisplayDebugTimingDetails,
|
DisplayDebugTimingDetails,
|
||||||
DontDoPrecisionPicking,
|
DontDoPrecisionPicking,
|
||||||
DontFadeOnOctreeServerChanges,
|
|
||||||
DontRenderEntitiesAsScene,
|
DontRenderEntitiesAsScene,
|
||||||
EchoLocalAudio,
|
EchoLocalAudio,
|
||||||
EchoServerAudio,
|
EchoServerAudio,
|
||||||
|
|
Loading…
Reference in a new issue