mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 12:54:30 +02:00
Working on the LOD system
This commit is contained in:
parent
04d72ea39d
commit
473f8d0ca5
9 changed files with 198 additions and 24 deletions
|
@ -264,20 +264,27 @@ Item {
|
||||||
StatText {
|
StatText {
|
||||||
text: "GPU: " + root.gpuFrameTime.toFixed(1) + " ms"
|
text: "GPU: " + root.gpuFrameTime.toFixed(1) + " ms"
|
||||||
}
|
}
|
||||||
|
StatText {
|
||||||
|
text: "Drawcalls: " + root.drawcalls
|
||||||
|
}
|
||||||
StatText {
|
StatText {
|
||||||
text: "Triangles: " + root.triangles +
|
text: "Triangles: " + root.triangles +
|
||||||
" / Material Switches: " + root.materialSwitches
|
" / Material Switches: " + root.materialSwitches
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: "GPU Free Memory: " + root.gpuFreeMemory + " MB";
|
text: "GPU Free Memory: " + root.gpuFreeMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: "GPU Textures: ";
|
text: "GPU Textures: ";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " Count: " + root.gpuTextures;
|
text: " Count: " + root.gpuTextures;
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " Pressure State: " + root.gpuTextureMemoryPressureState;
|
text: " Pressure State: " + root.gpuTextureMemoryPressureState;
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
@ -287,27 +294,35 @@ Item {
|
||||||
text: " " + root.gpuTextureResourceMemory + " / " + root.gpuTextureResourcePopulatedMemory + " / " + root.texturePendingTransfers + " MB";
|
text: " " + root.gpuTextureResourceMemory + " / " + root.gpuTextureResourcePopulatedMemory + " / " + root.texturePendingTransfers + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " Resident Memory: " + root.gpuTextureResidentMemory + " MB";
|
text: " Resident Memory: " + root.gpuTextureResidentMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " Framebuffer Memory: " + root.gpuTextureFramebufferMemory + " MB";
|
text: " Framebuffer Memory: " + root.gpuTextureFramebufferMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " External Memory: " + root.gpuTextureExternalMemory + " MB";
|
text: " External Memory: " + root.gpuTextureExternalMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: "GPU Buffers: "
|
text: "GPU Buffers: "
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " Count: " + root.gpuBuffers;
|
text: " Count: " + root.gpuBuffers;
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " Memory: " + root.gpuBufferMemory + " MB";
|
text: " Memory: " + root.gpuBufferMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: "GL Swapchain Memory: " + root.glContextSwapchainMemory + " MB";
|
text: "GL Swapchain Memory: " + root.glContextSwapchainMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: "QML Texture Memory: " + root.qmlTextureMemory + " MB";
|
text: "QML Texture Memory: " + root.qmlTextureMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
|
|
@ -285,52 +285,69 @@ Item {
|
||||||
StatText {
|
StatText {
|
||||||
text: "GPU frame size: " + root.gpuFrameSize.x + " x " + root.gpuFrameSize.y
|
text: "GPU frame size: " + root.gpuFrameSize.x + " x " + root.gpuFrameSize.y
|
||||||
}
|
}
|
||||||
|
StatText {
|
||||||
|
text: "Drawcalls: " + root.drawcalls
|
||||||
|
}
|
||||||
StatText {
|
StatText {
|
||||||
text: "Triangles: " + root.triangles +
|
text: "Triangles: " + root.triangles +
|
||||||
" / Material Switches: " + root.materialSwitches
|
" / Material Switches: " + root.materialSwitches
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: "GPU Free Memory: " + root.gpuFreeMemory + " MB";
|
text: "GPU Free Memory: " + root.gpuFreeMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: "GPU Textures: ";
|
text: "GPU Textures: ";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " Count: " + root.gpuTextures;
|
text: " Count: " + root.gpuTextures;
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " Pressure State: " + root.gpuTextureMemoryPressureState;
|
text: " Pressure State: " + root.gpuTextureMemoryPressureState;
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
property bool showIdeal: (root.gpuTextureResourceIdealMemory != root.gpuTextureResourceMemory);
|
property bool showIdeal: (root.gpuTextureResourceIdealMemory != root.gpuTextureResourceMemory);
|
||||||
text: " Resource Allocated " + (showIdeal ? "(Ideal)" : "") + " / Populated / Pending: ";
|
text: " Resource Allocated " + (showIdeal ? "(Ideal)" : "") + " / Populated / Pending: ";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
property bool showIdeal: (root.gpuTextureResourceIdealMemory != root.gpuTextureResourceMemory);
|
property bool showIdeal: (root.gpuTextureResourceIdealMemory != root.gpuTextureResourceMemory);
|
||||||
text: " " + root.gpuTextureResourceMemory + (showIdeal ? ("(" + root.gpuTextureResourceIdealMemory + ")") : "") + " / " + root.gpuTextureResourcePopulatedMemory + " / " + root.texturePendingTransfers + " MB";
|
text: " " + root.gpuTextureResourceMemory + (showIdeal ? ("(" + root.gpuTextureResourceIdealMemory + ")") : "") + " / " + root.gpuTextureResourcePopulatedMemory + " / " + root.texturePendingTransfers + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " Resident Memory: " + root.gpuTextureResidentMemory + " MB";
|
text: " Resident Memory: " + root.gpuTextureResidentMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " Framebuffer Memory: " + root.gpuTextureFramebufferMemory + " MB";
|
text: " Framebuffer Memory: " + root.gpuTextureFramebufferMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " External Memory: " + root.gpuTextureExternalMemory + " MB";
|
text: " External Memory: " + root.gpuTextureExternalMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: "GPU Buffers: "
|
text: "GPU Buffers: "
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " Count: " + root.gpuBuffers;
|
text: " Count: " + root.gpuBuffers;
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: " Memory: " + root.gpuBufferMemory + " MB";
|
text: " Memory: " + root.gpuBufferMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: "GL Swapchain Memory: " + root.glContextSwapchainMemory + " MB";
|
text: "GL Swapchain Memory: " + root.glContextSwapchainMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
visible: root.expanded;
|
||||||
text: "QML Texture Memory: " + root.qmlTextureMemory + " MB";
|
text: "QML Texture Memory: " + root.qmlTextureMemory + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
|
|
|
@ -87,6 +87,7 @@ void LODManager::autoAdjustLOD(float realTimeDelta) {
|
||||||
_octreeSizeScale = ADJUST_LOD_MIN_SIZE_SCALE;
|
_octreeSizeScale = ADJUST_LOD_MIN_SIZE_SCALE;
|
||||||
}
|
}
|
||||||
emit LODDecreased();
|
emit LODDecreased();
|
||||||
|
emit LODChanged();
|
||||||
// Assuming the LOD adjustment will work: we optimistically reset _avgRenderTime
|
// Assuming the LOD adjustment will work: we optimistically reset _avgRenderTime
|
||||||
// to provide an FPS just above the decrease threshold. It will drift close to its
|
// to provide an FPS just above the decrease threshold. It will drift close to its
|
||||||
// true value after a few LOD_ADJUST_TIMESCALEs and we'll adjust again as necessary.
|
// true value after a few LOD_ADJUST_TIMESCALEs and we'll adjust again as necessary.
|
||||||
|
@ -108,6 +109,8 @@ void LODManager::autoAdjustLOD(float realTimeDelta) {
|
||||||
_octreeSizeScale = ADJUST_LOD_MAX_SIZE_SCALE;
|
_octreeSizeScale = ADJUST_LOD_MAX_SIZE_SCALE;
|
||||||
}
|
}
|
||||||
emit LODIncreased();
|
emit LODIncreased();
|
||||||
|
emit LODChanged();
|
||||||
|
|
||||||
// Assuming the LOD adjustment will work: we optimistically reset _avgRenderTime
|
// Assuming the LOD adjustment will work: we optimistically reset _avgRenderTime
|
||||||
// to provide an FPS just below the increase threshold. It will drift close to its
|
// to provide an FPS just below the increase threshold. It will drift close to its
|
||||||
// true value after a few LOD_ADJUST_TIMESCALEs and we'll adjust again as necessary.
|
// true value after a few LOD_ADJUST_TIMESCALEs and we'll adjust again as necessary.
|
||||||
|
@ -145,6 +148,10 @@ float LODManager::getLODLevel() const {
|
||||||
return simpleLOD;
|
return simpleLOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LODManager::setLODLevel(float level) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const float MIN_DECREASE_FPS = 0.5f;
|
const float MIN_DECREASE_FPS = 0.5f;
|
||||||
|
|
||||||
void LODManager::setDesktopLODDecreaseFPS(float fps) {
|
void LODManager::setDesktopLODDecreaseFPS(float fps) {
|
||||||
|
|
|
@ -30,7 +30,9 @@ const float INCREASE_LOD_GAP_FPS = 10.0f; // fps
|
||||||
// The default value DEFAULT_OCTREE_SIZE_SCALE means you can be 400 meters away from a 1 meter object in order to see it (which is ~20:20 vision).
|
// The default value DEFAULT_OCTREE_SIZE_SCALE means you can be 400 meters away from a 1 meter object in order to see it (which is ~20:20 vision).
|
||||||
const float ADJUST_LOD_MAX_SIZE_SCALE = DEFAULT_OCTREE_SIZE_SCALE;
|
const float ADJUST_LOD_MAX_SIZE_SCALE = DEFAULT_OCTREE_SIZE_SCALE;
|
||||||
// This controls how low the auto-adjust LOD will go. We want a minimum vision of ~20:500 or 0.04 of default
|
// This controls how low the auto-adjust LOD will go. We want a minimum vision of ~20:500 or 0.04 of default
|
||||||
const float ADJUST_LOD_MIN_SIZE_SCALE = DEFAULT_OCTREE_SIZE_SCALE * 0.04f;
|
// const float ADJUST_LOD_MIN_SIZE_SCALE = DEFAULT_OCTREE_SIZE_SCALE * 0.04f;
|
||||||
|
// const float ADJUST_LOD_MIN_SIZE_SCALE = DEFAULT_OCTREE_SIZE_SCALE * 0.02f;
|
||||||
|
const float ADJUST_LOD_MIN_SIZE_SCALE = DEFAULT_OCTREE_SIZE_SCALE * 0.01f;
|
||||||
|
|
||||||
class AABox;
|
class AABox;
|
||||||
|
|
||||||
|
@ -60,9 +62,10 @@ class LODManager : public QObject, public Dependency {
|
||||||
Q_PROPERTY(float gpuTime READ getGPUTime)
|
Q_PROPERTY(float gpuTime READ getGPUTime)
|
||||||
Q_PROPERTY(float avgRenderTime READ getAverageRenderTime)
|
Q_PROPERTY(float avgRenderTime READ getAverageRenderTime)
|
||||||
Q_PROPERTY(float fps READ getMaxTheoreticalFPS)
|
Q_PROPERTY(float fps READ getMaxTheoreticalFPS)
|
||||||
Q_PROPERTY(float lodLevel READ getLODLevel)
|
Q_PROPERTY(float lodLevel READ getLODLevel WRITE setLODLevel NOTIFY LODChanged)
|
||||||
Q_PROPERTY(float lodDecreaseFPS READ getLODDecreaseFPS)
|
Q_PROPERTY(float lodDecreaseFPS READ getLODDecreaseFPS)
|
||||||
Q_PROPERTY(float lodIncreaseFPS READ getLODIncreaseFPS)
|
Q_PROPERTY(float lodIncreaseFPS READ getLODIncreaseFPS)
|
||||||
|
Q_PROPERTY(bool automaticLODAdjust READ getAutomaticLODAdjust WRITE setAutomaticLODAdjust)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -174,6 +177,7 @@ public:
|
||||||
float getAverageRenderTime() const { return _avgRenderTime; };
|
float getAverageRenderTime() const { return _avgRenderTime; };
|
||||||
float getMaxTheoreticalFPS() const { return (float)MSECS_PER_SECOND / _avgRenderTime; };
|
float getMaxTheoreticalFPS() const { return (float)MSECS_PER_SECOND / _avgRenderTime; };
|
||||||
float getLODLevel() const;
|
float getLODLevel() const;
|
||||||
|
void setLODLevel(float level);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -189,6 +193,8 @@ signals:
|
||||||
*/
|
*/
|
||||||
void LODDecreased();
|
void LODDecreased();
|
||||||
|
|
||||||
|
void LODChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LODManager();
|
LODManager();
|
||||||
|
|
||||||
|
|
|
@ -376,6 +376,12 @@ void Stats::updateStats(bool force) {
|
||||||
STAT_UPDATE(rectifiedTextureCount, (int)RECTIFIED_TEXTURE_COUNT.load());
|
STAT_UPDATE(rectifiedTextureCount, (int)RECTIFIED_TEXTURE_COUNT.load());
|
||||||
STAT_UPDATE(decimatedTextureCount, (int)DECIMATED_TEXTURE_COUNT.load());
|
STAT_UPDATE(decimatedTextureCount, (int)DECIMATED_TEXTURE_COUNT.load());
|
||||||
|
|
||||||
|
gpu::ContextStats gpuFrameStats;
|
||||||
|
gpuContext->getFrameStats(gpuFrameStats);
|
||||||
|
|
||||||
|
STAT_UPDATE(drawcalls, gpuFrameStats._DSNumDrawcalls);
|
||||||
|
|
||||||
|
|
||||||
// Incoming packets
|
// Incoming packets
|
||||||
QLocale locale(QLocale::English);
|
QLocale locale(QLocale::English);
|
||||||
auto voxelPacketsToProcess = qApp->getOctreePacketProcessor().packetsToProcessCount();
|
auto voxelPacketsToProcess = qApp->getOctreePacketProcessor().packetsToProcessCount();
|
||||||
|
|
|
@ -239,7 +239,8 @@ class Stats : public QQuickItem {
|
||||||
STATS_PROPERTY(int, processing, 0)
|
STATS_PROPERTY(int, processing, 0)
|
||||||
STATS_PROPERTY(int, processingPending, 0)
|
STATS_PROPERTY(int, processingPending, 0)
|
||||||
STATS_PROPERTY(int, triangles, 0)
|
STATS_PROPERTY(int, triangles, 0)
|
||||||
STATS_PROPERTY(int, quads, 0)
|
STATS_PROPERTY(int, drawcalls, 0)
|
||||||
|
// STATS_PROPERTY(int, quads, 0)
|
||||||
STATS_PROPERTY(int, materialSwitches, 0)
|
STATS_PROPERTY(int, materialSwitches, 0)
|
||||||
STATS_PROPERTY(int, itemConsidered, 0)
|
STATS_PROPERTY(int, itemConsidered, 0)
|
||||||
STATS_PROPERTY(int, itemOutOfView, 0)
|
STATS_PROPERTY(int, itemOutOfView, 0)
|
||||||
|
@ -708,12 +709,20 @@ signals:
|
||||||
*/
|
*/
|
||||||
void trianglesChanged();
|
void trianglesChanged();
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when the value of the <code>drawcalls</code> property changes.
|
||||||
|
* This
|
||||||
|
* @function Stats.drawcallsChanged
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void drawcallsChanged();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Triggered when the value of the <code>quads</code> property changes.
|
* Triggered when the value of the <code>quads</code> property changes.
|
||||||
* @function Stats.quadsChanged
|
* @function Stats.quadsChanged
|
||||||
* @returns {Signal}
|
* @returns {Signal}
|
||||||
*/
|
*/
|
||||||
void quadsChanged();
|
// void quadsChanged();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Triggered when the value of the <code>materialSwitches</code> property changes.
|
* Triggered when the value of the <code>materialSwitches</code> property changes.
|
||||||
|
|
|
@ -56,13 +56,13 @@ Item {
|
||||||
anchors.verticalCenter: root.verticalCenter
|
anchors.verticalCenter: root.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
Binding {
|
/* Binding {
|
||||||
id: bindingControl
|
id: bindingControl
|
||||||
target: root.config
|
target: root.config
|
||||||
property: root.property
|
property: root.property
|
||||||
value: sliderControl.value
|
value: sliderControl.value
|
||||||
when: false
|
when: false
|
||||||
}
|
}*/
|
||||||
|
|
||||||
HifiControls.Slider {
|
HifiControls.Slider {
|
||||||
id: sliderControl
|
id: sliderControl
|
||||||
|
@ -73,7 +73,7 @@ Item {
|
||||||
anchors.top: root.top
|
anchors.top: root.top
|
||||||
anchors.topMargin: 0
|
anchors.topMargin: 0
|
||||||
|
|
||||||
onValueChanged: { root.valueChanged(value) }
|
// onValueChanged: { root.valueChanged(value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiControls.Label {
|
HifiControls.Label {
|
||||||
|
|
|
@ -16,15 +16,9 @@
|
||||||
var ICON_URL = Script.resolvePath("../../../system/assets/images/lod-i.svg");
|
var ICON_URL = Script.resolvePath("../../../system/assets/images/lod-i.svg");
|
||||||
var ACTIVE_ICON_URL = Script.resolvePath("../../../system/assets/images/lod-a.svg");
|
var ACTIVE_ICON_URL = Script.resolvePath("../../../system/assets/images/lod-a.svg");
|
||||||
|
|
||||||
var onScreen = false;
|
var onTablet = false; // set this to true to use the tablet, false use a floating window
|
||||||
|
|
||||||
function onClicked() {
|
var onAppScreen = false;
|
||||||
if (onScreen) {
|
|
||||||
tablet.gotoHomeScreen();
|
|
||||||
} else {
|
|
||||||
tablet.loadQMLSource(QMLAPP_URL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
var button = tablet.addButton({
|
var button = tablet.addButton({
|
||||||
|
@ -35,6 +29,51 @@
|
||||||
|
|
||||||
var hasEventBridge = false;
|
var hasEventBridge = false;
|
||||||
|
|
||||||
|
var onScreen = false;
|
||||||
|
var window;
|
||||||
|
|
||||||
|
function onClicked() {
|
||||||
|
if (onTablet) {
|
||||||
|
if (onAppScreen) {
|
||||||
|
tablet.gotoHomeScreen();
|
||||||
|
} else {
|
||||||
|
tablet.loadQMLSource(QMLAPP_URL);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (onScreen) {
|
||||||
|
killWindow()
|
||||||
|
} else {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createWindow() {
|
||||||
|
var qml = Script.resolvePath(QMLAPP_URL);
|
||||||
|
window = Desktop.createWindow(Script.resolvePath(QMLAPP_URL), {
|
||||||
|
title: TABLET_BUTTON_NAME,
|
||||||
|
flags: Desktop.ALWAYS_ON_TOP,
|
||||||
|
presentationMode: Desktop.PresentationMode.NATIVE,
|
||||||
|
size: {x: 400, y: 600}
|
||||||
|
});
|
||||||
|
// window.setPosition(200, 50);
|
||||||
|
window.closed.connect(killWindow);
|
||||||
|
window.fromQml.connect(fromQml);
|
||||||
|
onScreen = true
|
||||||
|
button.editProperties({isActive: true});
|
||||||
|
}
|
||||||
|
|
||||||
|
function killWindow() {
|
||||||
|
if (window !== undefined) {
|
||||||
|
window.closed.disconnect(killWindow);
|
||||||
|
window.fromQml.disconnect(fromQml);
|
||||||
|
window.close()
|
||||||
|
window = undefined
|
||||||
|
}
|
||||||
|
onScreen = false
|
||||||
|
button.editProperties({isActive: false})
|
||||||
|
}
|
||||||
|
|
||||||
function wireEventBridge(on) {
|
function wireEventBridge(on) {
|
||||||
if (!tablet) {
|
if (!tablet) {
|
||||||
print("Warning in wireEventBridge(): 'tablet' undefined!");
|
print("Warning in wireEventBridge(): 'tablet' undefined!");
|
||||||
|
@ -54,23 +93,42 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function onScreenChanged(type, url) {
|
function onScreenChanged(type, url) {
|
||||||
onScreen = (url === QMLAPP_URL);
|
if (onTablet) {
|
||||||
button.editProperties({isActive: onScreen});
|
if (url === QMLAPP_URL) {
|
||||||
wireEventBridge(onScreen);
|
onAppScreen = true;
|
||||||
}
|
} else {
|
||||||
|
onAppScreen = false;
|
||||||
function fromQml(message) {
|
}
|
||||||
|
|
||||||
|
button.editProperties({isActive: onAppScreen});
|
||||||
|
wireEventBridge(onAppScreen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button.clicked.connect(onClicked);
|
button.clicked.connect(onClicked);
|
||||||
tablet.screenChanged.connect(onScreenChanged);
|
tablet.screenChanged.connect(onScreenChanged);
|
||||||
|
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
if (onScreen) {
|
killWindow()
|
||||||
|
if (onAppScreen) {
|
||||||
tablet.gotoHomeScreen();
|
tablet.gotoHomeScreen();
|
||||||
}
|
}
|
||||||
button.clicked.disconnect(onClicked);
|
button.clicked.disconnect(onClicked);
|
||||||
tablet.screenChanged.disconnect(onScreenChanged);
|
tablet.screenChanged.disconnect(onScreenChanged);
|
||||||
tablet.removeButton(button);
|
tablet.removeButton(button);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function fromQml(message) {
|
||||||
|
}
|
||||||
|
|
||||||
|
function sendToQml(message) {
|
||||||
|
if (onTablet) {
|
||||||
|
tablet.sendToQml(message);
|
||||||
|
} else {
|
||||||
|
if (window) {
|
||||||
|
window.sendToQml(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
|
@ -10,20 +10,73 @@
|
||||||
//
|
//
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 1.4
|
||||||
|
|
||||||
|
import "qrc:///qml/styles-uit"
|
||||||
|
import "qrc:///qml/controls-uit" as HifiControls
|
||||||
|
|
||||||
import "../lib/plotperf"
|
import "../lib/plotperf"
|
||||||
|
import "configSlider"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: lodIU
|
id: lodIU
|
||||||
anchors.fill:parent
|
anchors.fill:parent
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
Render.getConfig("RenderMainView.DrawSceneOctree").showVisibleCells = false
|
||||||
|
Render.getConfig("RenderMainView.DrawSceneOctree").showEmptyCells = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: {
|
||||||
|
Render.getConfig("RenderMainView.DrawSceneOctree").enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: topHeader
|
||||||
|
spacing: 8
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.left: parent.left
|
||||||
|
|
||||||
|
HifiControls.CheckBox {
|
||||||
|
boxSize: 20
|
||||||
|
text: "Show LOD Reticule"
|
||||||
|
checked: Render.getConfig("RenderMainView.DrawSceneOctree").enabled
|
||||||
|
onCheckedChanged: { Render.getConfig("RenderMainView.DrawSceneOctree").enabled = checked }
|
||||||
|
}
|
||||||
|
HifiControls.CheckBox {
|
||||||
|
boxSize: 20
|
||||||
|
text: "Manual LOD"
|
||||||
|
checked: LODManager.getAutomaticLODAdjust()
|
||||||
|
onCheckedChanged: { LODManager.setAutomaticLODAdjust(checked) }
|
||||||
|
}
|
||||||
|
ConfigSlider {
|
||||||
|
showLabel: true
|
||||||
|
config: LODManager
|
||||||
|
property: "lodLevel"
|
||||||
|
max: 13
|
||||||
|
min: 0
|
||||||
|
integral: false
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: stats
|
id: stats
|
||||||
spacing: 8
|
spacing: 8
|
||||||
anchors.fill:parent
|
anchors.right: parent.right
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: topHeader.bottom
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
function evalEvenHeight() {
|
function evalEvenHeight() {
|
||||||
// Why do we have to do that manually ? cannot seem to find a qml / anchor / layout mode that does that ?
|
// Why do we have to do that manually ? cannot seem to find a qml / anchor / layout mode that does that ?
|
||||||
return (height - spacing * (children.length - 1)) / children.length
|
return (height - topLine.height - bottomLine.height - spacing * (children.length - 3)) / (children.length - 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
id: topLine
|
||||||
}
|
}
|
||||||
|
|
||||||
PlotPerf {
|
PlotPerf {
|
||||||
|
@ -87,6 +140,9 @@ Item {
|
||||||
color: "#9999FF"
|
color: "#9999FF"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
Separator {
|
||||||
|
id: bottomLine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue