mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-12 08:16:46 +02:00
added render pipeline warnings menu item
This commit is contained in:
parent
7625c9a621
commit
8f0dd1ffa1
3 changed files with 21 additions and 5 deletions
|
@ -103,7 +103,7 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) {
|
|||
_tree->readBitstreamToTree(voxelData, numBytes - 1);
|
||||
double end = usecTimestampNow();
|
||||
double elapsedmsec = (end - start)/1000.0;
|
||||
if (elapsedmsec > 1) {
|
||||
if (_renderWarningsOn && elapsedmsec > 1) {
|
||||
if (elapsedmsec > 1000) {
|
||||
double elapsedsec = (end - start)/1000000.0;
|
||||
printLog("WARNING! readBitstreamToTree() took %lf seconds\n",elapsedsec);
|
||||
|
@ -155,7 +155,7 @@ void VoxelSystem::setupNewVoxelsForDrawing() {
|
|||
}
|
||||
double end = usecTimestampNow();
|
||||
double elapsedmsec = (end - start)/1000.0;
|
||||
if (elapsedmsec > 1) {
|
||||
if (_renderWarningsOn && elapsedmsec > 1) {
|
||||
if (elapsedmsec > 1000) {
|
||||
double elapsedsec = (end - start)/1000000.0;
|
||||
printLog("WARNING! newTreeToArrays() took %lf seconds\n",elapsedsec);
|
||||
|
@ -181,7 +181,7 @@ void VoxelSystem::copyWrittenDataToReadArrays() {
|
|||
}
|
||||
double end = usecTimestampNow();
|
||||
double elapsedmsec = (end - start)/1000.0;
|
||||
if (elapsedmsec > 1) {
|
||||
if (_renderWarningsOn && elapsedmsec > 1) {
|
||||
if (elapsedmsec > 1000) {
|
||||
double elapsedsec = (end - start)/1000000.0;
|
||||
printLog("WARNING! copyWrittenDataToReadArrays() took %lf seconds\n",elapsedsec);
|
||||
|
@ -260,6 +260,8 @@ VoxelSystem* VoxelSystem::clone() const {
|
|||
|
||||
void VoxelSystem::init() {
|
||||
|
||||
_renderWarningsOn = false;
|
||||
|
||||
// When we change voxels representations in the arrays, we'll update this
|
||||
_voxelsDirty = false;
|
||||
_voxelsInArrays = 0;
|
||||
|
@ -365,7 +367,7 @@ void VoxelSystem::updateVBOs() {
|
|||
}
|
||||
double end = usecTimestampNow();
|
||||
double elapsedmsec = (end - start)/1000.0;
|
||||
if (elapsedmsec > 1) {
|
||||
if (_renderWarningsOn && elapsedmsec > 1) {
|
||||
if (elapsedmsec > 1000) {
|
||||
double elapsedsec = (end - start)/1000000.0;
|
||||
printLog("WARNING! updateVBOs() took %lf seconds\n",elapsedsec);
|
||||
|
@ -411,7 +413,7 @@ void VoxelSystem::render() {
|
|||
glPopMatrix();
|
||||
double end = usecTimestampNow();
|
||||
double elapsedmsec = (end - start)/1000.0;
|
||||
if (elapsedmsec > 1) {
|
||||
if (_renderWarningsOn && elapsedmsec > 1) {
|
||||
if (elapsedmsec > 1000) {
|
||||
double elapsedsec = (end - start)/1000000.0;
|
||||
printLog("WARNING! render() took %lf seconds\n",elapsedsec);
|
||||
|
|
|
@ -59,8 +59,11 @@ public:
|
|||
void falseColorizeDistanceFromView(ViewFrustum* viewFrustum);
|
||||
|
||||
void killLocalVoxels();
|
||||
void setRenderPipelineWarnings(bool on) { _renderWarningsOn = on; };
|
||||
bool getRenderPipelineWarnings() const { return _renderWarningsOn; };
|
||||
|
||||
private:
|
||||
bool _renderWarningsOn;
|
||||
// Operation functions for tree recursion methods
|
||||
static int _nodeCount;
|
||||
static bool randomColorOperation(VoxelNode* node, void* extraData);
|
||||
|
|
|
@ -143,6 +143,8 @@ Audio audio(&audioScope, &myAvatar);
|
|||
// Where one's own agent begins in the world (needs to become a dynamic thing passed to the program)
|
||||
glm::vec3 start_location(6.1f, 0, 1.4f);
|
||||
|
||||
bool renderWarningsOn = false; // Whether to show render pipeline warnings
|
||||
|
||||
bool statsOn = false; // Whether to show onscreen text overlay with stats
|
||||
bool starsOn = false; // Whether to display the stars
|
||||
bool paintOn = false; // Whether to paint voxels as you fly around
|
||||
|
@ -1041,6 +1043,14 @@ int setMenu(int state) {
|
|||
return setValue(state, &::menuOn);
|
||||
}
|
||||
|
||||
int setRenderWarnings(int state) {
|
||||
int value = setValue(state, &::renderWarningsOn);
|
||||
if (state == MENU_ROW_PICKED) {
|
||||
::voxels.setRenderPipelineWarnings(::renderWarningsOn);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
int setDisplayFrustum(int state) {
|
||||
return setValue(state, &::frustumOn);
|
||||
}
|
||||
|
@ -1178,6 +1188,7 @@ void initMenu() {
|
|||
|
||||
// Debug
|
||||
menuColumnDebug = menu.addColumn("Debug");
|
||||
menuColumnDebug->addRow("Show Render Pipeline Warnings", setRenderWarnings);
|
||||
menuColumnDebug->addRow("Kill Local Voxels", doKillLocalVoxels);
|
||||
menuColumnDebug->addRow("Randomize Voxel TRUE Colors", doRandomizeVoxelColors);
|
||||
menuColumnDebug->addRow("FALSE Color Voxels Randomly", doFalseRandomizeVoxelColors);
|
||||
|
|
Loading…
Reference in a new issue