mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
fix debug tools
This commit is contained in:
parent
82029b4cb0
commit
6ff0b9d417
8 changed files with 90 additions and 118 deletions
|
@ -22,10 +22,8 @@
|
||||||
|
|
||||||
#include "Args.h"
|
#include "Args.h"
|
||||||
|
|
||||||
|
|
||||||
using namespace render;
|
using namespace render;
|
||||||
|
|
||||||
|
|
||||||
const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() {
|
const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() {
|
||||||
if (!_drawCellBoundsPipeline) {
|
if (!_drawCellBoundsPipeline) {
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawCellBounds);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawCellBounds);
|
||||||
|
@ -71,7 +69,6 @@ void DrawSceneOctree::run(const RenderContextPointer& renderContext, const ItemS
|
||||||
std::static_pointer_cast<Config>(renderContext->jobConfig)->numAllocatedCells = (int)scene->getSpatialTree().getNumAllocatedCells();
|
std::static_pointer_cast<Config>(renderContext->jobConfig)->numAllocatedCells = (int)scene->getSpatialTree().getNumAllocatedCells();
|
||||||
std::static_pointer_cast<Config>(renderContext->jobConfig)->numFreeCells = (int)scene->getSpatialTree().getNumFreeCells();
|
std::static_pointer_cast<Config>(renderContext->jobConfig)->numFreeCells = (int)scene->getSpatialTree().getNumFreeCells();
|
||||||
|
|
||||||
|
|
||||||
gpu::doInBatch("DrawSceneOctree::run", args->_context, [&](gpu::Batch& batch) {
|
gpu::doInBatch("DrawSceneOctree::run", args->_context, [&](gpu::Batch& batch) {
|
||||||
glm::mat4 projMat;
|
glm::mat4 projMat;
|
||||||
Transform viewMat;
|
Transform viewMat;
|
||||||
|
@ -86,44 +83,30 @@ void DrawSceneOctree::run(const RenderContextPointer& renderContext, const ItemS
|
||||||
// bind the one gpu::Pipeline we need
|
// bind the one gpu::Pipeline we need
|
||||||
batch.setPipeline(getDrawCellBoundsPipeline());
|
batch.setPipeline(getDrawCellBoundsPipeline());
|
||||||
|
|
||||||
if (_showVisibleCells) {
|
auto drawCellBounds = [this, &scene, &batch](const std::vector<gpu::Stamp>& cells) {
|
||||||
|
for (const auto& cellID : cells) {
|
||||||
for (const auto& cellID : inSelection.cellSelection.insideCells) {
|
|
||||||
auto cell = scene->getSpatialTree().getConcreteCell(cellID);
|
auto cell = scene->getSpatialTree().getConcreteCell(cellID);
|
||||||
auto cellLoc = cell.getlocation();
|
auto cellLoc = cell.getlocation();
|
||||||
glm::ivec4 cellLocation(cellLoc.pos.x, cellLoc.pos.y, cellLoc.pos.z, cellLoc.depth);
|
glm::ivec4 cellLocation(cellLoc.pos.x, cellLoc.pos.y, cellLoc.pos.z, cellLoc.depth);
|
||||||
|
|
||||||
bool doDraw = true;
|
bool empty = cell.isBrickEmpty() || !cell.hasBrick();
|
||||||
if (cell.isBrickEmpty() || !cell.hasBrick()) {
|
if (empty) {
|
||||||
if (!_showEmptyCells) {
|
if (!_showEmptyCells) {
|
||||||
doDraw = false;
|
continue;
|
||||||
}
|
}
|
||||||
cellLocation.w *= -1;
|
cellLocation.w *= -1.0;
|
||||||
|
} else if (!empty && !_showVisibleCells) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if (doDraw) {
|
|
||||||
batch._glUniform4iv(gpu::slot::uniform::Extra0, 1, ((const int*)(&cellLocation)));
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& cellID : inSelection.cellSelection.partialCells) {
|
batch._glUniform4iv(gpu::slot::uniform::Extra0, 1, ((const int*)(&cellLocation)));
|
||||||
auto cell = scene->getSpatialTree().getConcreteCell(cellID);
|
batch.draw(gpu::LINES, 24, 0);
|
||||||
auto cellLoc = cell.getlocation();
|
|
||||||
glm::ivec4 cellLocation(cellLoc.pos.x, cellLoc.pos.y, cellLoc.pos.z, cellLoc.depth);
|
|
||||||
|
|
||||||
bool doDraw = true;
|
|
||||||
if (cell.isBrickEmpty() || !cell.hasBrick()) {
|
|
||||||
if (!_showEmptyCells) {
|
|
||||||
doDraw = false;
|
|
||||||
}
|
|
||||||
cellLocation.w *= -1;
|
|
||||||
}
|
|
||||||
if (doDraw) {
|
|
||||||
batch._glUniform4iv(gpu::slot::uniform::Extra0, 1, ((const int*)(&cellLocation)));
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
drawCellBounds(inSelection.cellSelection.insideCells);
|
||||||
|
drawCellBounds(inSelection.cellSelection.partialCells);
|
||||||
|
|
||||||
// Draw the LOD Reticle
|
// Draw the LOD Reticle
|
||||||
{
|
{
|
||||||
float angle = glm::degrees(getPerspectiveAccuracyAngle(args->_sizeScale, args->_boundaryLevelAdjust));
|
float angle = glm::degrees(getPerspectiveAccuracyAngle(args->_sizeScale, args->_boundaryLevelAdjust));
|
||||||
|
@ -169,6 +152,19 @@ void DrawItemSelection::run(const RenderContextPointer& renderContext, const Ite
|
||||||
RenderArgs* args = renderContext->args;
|
RenderArgs* args = renderContext->args;
|
||||||
auto& scene = renderContext->_scene;
|
auto& scene = renderContext->_scene;
|
||||||
|
|
||||||
|
if (!_boundsBufferInside) {
|
||||||
|
_boundsBufferInside = std::make_shared<gpu::Buffer>(sizeof(render::ItemBound));
|
||||||
|
}
|
||||||
|
if (!_boundsBufferInsideSubcell) {
|
||||||
|
_boundsBufferInsideSubcell = std::make_shared<gpu::Buffer>(sizeof(render::ItemBound));
|
||||||
|
}
|
||||||
|
if (!_boundsBufferPartial) {
|
||||||
|
_boundsBufferPartial = std::make_shared<gpu::Buffer>(sizeof(render::ItemBound));
|
||||||
|
}
|
||||||
|
if (!_boundsBufferPartialSubcell) {
|
||||||
|
_boundsBufferPartialSubcell = std::make_shared<gpu::Buffer>(sizeof(render::ItemBound));
|
||||||
|
}
|
||||||
|
|
||||||
gpu::doInBatch("DrawItemSelection::run", args->_context, [&](gpu::Batch& batch) {
|
gpu::doInBatch("DrawItemSelection::run", args->_context, [&](gpu::Batch& batch) {
|
||||||
glm::mat4 projMat;
|
glm::mat4 projMat;
|
||||||
Transform viewMat;
|
Transform viewMat;
|
||||||
|
@ -183,48 +179,35 @@ void DrawItemSelection::run(const RenderContextPointer& renderContext, const Ite
|
||||||
// bind the one gpu::Pipeline we need
|
// bind the one gpu::Pipeline we need
|
||||||
batch.setPipeline(getDrawItemBoundPipeline());
|
batch.setPipeline(getDrawItemBoundPipeline());
|
||||||
|
|
||||||
|
auto drawItemBounds = [&](const render::ItemIDs itemIDs, const gpu::BufferPointer buffer) {
|
||||||
|
render::ItemBounds itemBounds;
|
||||||
|
for (const auto& itemID : itemIDs) {
|
||||||
|
auto& item = scene->getItem(itemID);
|
||||||
|
auto itemBound = item.getBound();
|
||||||
|
if (!itemBound.isInvalid()) {
|
||||||
|
itemBounds.emplace_back(itemID, itemBound);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemBounds.size() > 0) {
|
||||||
|
buffer->setData(itemBounds.size() * sizeof(render::ItemBound), (const gpu::Byte*) itemBounds.data());
|
||||||
|
batch.setResourceBuffer(0, buffer);
|
||||||
|
batch.draw(gpu::LINES, (gpu::uint32) itemBounds.size() * 24, 0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (_showInsideItems) {
|
if (_showInsideItems) {
|
||||||
for (const auto& itemID : inSelection.insideItems) {
|
drawItemBounds(inSelection.insideItems, _boundsBufferInside);
|
||||||
auto& item = scene->getItem(itemID);
|
|
||||||
auto itemBound = item.getBound();
|
|
||||||
auto itemCell = scene->getSpatialTree().getCellLocation(item.getCell());
|
|
||||||
glm::ivec4 cellLocation(0, 0, 0, itemCell.depth);
|
|
||||||
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_showInsideSubcellItems) {
|
if (_showInsideSubcellItems) {
|
||||||
for (const auto& itemID : inSelection.insideSubcellItems) {
|
drawItemBounds(inSelection.insideSubcellItems, _boundsBufferInsideSubcell);
|
||||||
auto& item = scene->getItem(itemID);
|
|
||||||
auto itemBound = item.getBound();
|
|
||||||
auto itemCell = scene->getSpatialTree().getCellLocation(item.getCell());
|
|
||||||
glm::ivec4 cellLocation(0, 0, 1, itemCell.depth);
|
|
||||||
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_showPartialItems) {
|
if (_showPartialItems) {
|
||||||
for (const auto& itemID : inSelection.partialItems) {
|
drawItemBounds(inSelection.partialItems, _boundsBufferPartial);
|
||||||
auto& item = scene->getItem(itemID);
|
|
||||||
auto itemBound = item.getBound();
|
|
||||||
auto itemCell = scene->getSpatialTree().getCellLocation(item.getCell());
|
|
||||||
glm::ivec4 cellLocation(0, 0, 0, itemCell.depth);
|
|
||||||
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_showPartialSubcellItems) {
|
if (_showPartialSubcellItems) {
|
||||||
for (const auto& itemID : inSelection.partialSubcellItems) {
|
drawItemBounds(inSelection.partialSubcellItems, _boundsBufferPartialSubcell);
|
||||||
auto& item = scene->getItem(itemID);
|
|
||||||
auto itemBound = item.getBound();
|
|
||||||
auto itemCell = scene->getSpatialTree().getCellLocation(item.getCell());
|
|
||||||
glm::ivec4 cellLocation(0, 0, 1, itemCell.depth);
|
|
||||||
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
batch.setResourceBuffer(0, 0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,6 @@ namespace render {
|
||||||
|
|
||||||
class DrawSceneOctree {
|
class DrawSceneOctree {
|
||||||
gpu::PipelinePointer _drawCellBoundsPipeline;
|
gpu::PipelinePointer _drawCellBoundsPipeline;
|
||||||
gpu::BufferPointer _cells;
|
|
||||||
gpu::PipelinePointer _drawLODReticlePipeline;
|
gpu::PipelinePointer _drawLODReticlePipeline;
|
||||||
gpu::PipelinePointer _drawItemBoundPipeline;
|
gpu::PipelinePointer _drawItemBoundPipeline;
|
||||||
|
|
||||||
|
@ -107,6 +106,10 @@ namespace render {
|
||||||
|
|
||||||
class DrawItemSelection {
|
class DrawItemSelection {
|
||||||
gpu::PipelinePointer _drawItemBoundPipeline;
|
gpu::PipelinePointer _drawItemBoundPipeline;
|
||||||
|
gpu::BufferPointer _boundsBufferInside;
|
||||||
|
gpu::BufferPointer _boundsBufferInsideSubcell;
|
||||||
|
gpu::BufferPointer _boundsBufferPartial;
|
||||||
|
gpu::BufferPointer _boundsBufferPartialSubcell;
|
||||||
|
|
||||||
bool _showInsideItems; // initialized by Config
|
bool _showInsideItems; // initialized by Config
|
||||||
bool _showInsideSubcellItems; // initialized by Config
|
bool _showInsideSubcellItems; // initialized by Config
|
||||||
|
|
|
@ -51,7 +51,7 @@ const gpu::PipelinePointer DrawStatus::getDrawItemBoundsPipeline() {
|
||||||
|
|
||||||
const gpu::PipelinePointer DrawStatus::getDrawItemStatusPipeline() {
|
const gpu::PipelinePointer DrawStatus::getDrawItemStatusPipeline() {
|
||||||
if (!_drawItemStatusPipeline) {
|
if (!_drawItemStatusPipeline) {
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::blurGaussianDepthAwareV);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawItemStatus);
|
||||||
|
|
||||||
auto state = std::make_shared<gpu::State>();
|
auto state = std::make_shared<gpu::State>();
|
||||||
|
|
||||||
|
@ -92,36 +92,30 @@ void DrawStatus::run(const RenderContextPointer& renderContext, const Input& inp
|
||||||
const auto& inItems = input.get0();
|
const auto& inItems = input.get0();
|
||||||
const auto jitter = input.get1();
|
const auto jitter = input.get1();
|
||||||
|
|
||||||
// FIrst thing, we collect the bound and the status for all the items we want to render
|
// First thing, we collect the bound and the status for all the items we want to render
|
||||||
int nbItems = 0;
|
int nbItems = 0;
|
||||||
|
render::ItemBounds itemBounds;
|
||||||
|
std::vector<std::pair<glm::ivec4, glm::ivec4>> itemStatus;
|
||||||
{
|
{
|
||||||
_itemBounds.resize(inItems.size());
|
|
||||||
_itemStatus.resize(inItems.size());
|
|
||||||
_itemCells.resize(inItems.size());
|
|
||||||
|
|
||||||
// AABox* itemAABox = reinterpret_cast<AABox*> (_itemBounds->editData());
|
|
||||||
// glm::ivec4* itemStatus = reinterpret_cast<glm::ivec4*> (_itemStatus->editData());
|
|
||||||
// Octree::Location* itemCell = reinterpret_cast<Octree::Location*> (_itemCells->editData());
|
|
||||||
for (size_t i = 0; i < inItems.size(); ++i) {
|
for (size_t i = 0; i < inItems.size(); ++i) {
|
||||||
const auto& item = inItems[i];
|
const auto& item = inItems[i];
|
||||||
if (!item.bound.isInvalid()) {
|
if (!item.bound.isInvalid()) {
|
||||||
if (!item.bound.isNull()) {
|
if (!item.bound.isNull()) {
|
||||||
_itemBounds[i] = item.bound;
|
itemBounds.emplace_back(render::ItemBound(item.id, item.bound));
|
||||||
} else {
|
} else {
|
||||||
_itemBounds[i].setBox(item.bound.getCorner(), 0.1f);
|
itemBounds.emplace_back(item.id, AABox(item.bound.getCorner(), 0.1f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
auto& itemScene = scene->getItem(item.id);
|
auto& itemScene = scene->getItem(item.id);
|
||||||
_itemCells[i] = scene->getSpatialTree().getCellLocation(itemScene.getCell());
|
|
||||||
|
|
||||||
auto itemStatusPointer = itemScene.getStatus();
|
auto itemStatusPointer = itemScene.getStatus();
|
||||||
if (itemStatusPointer) {
|
if (itemStatusPointer) {
|
||||||
|
itemStatus.push_back(std::pair<glm::ivec4, glm::ivec4>());
|
||||||
// Query the current status values, this is where the statusGetter lambda get called
|
// Query the current status values, this is where the statusGetter lambda get called
|
||||||
auto&& currentStatusValues = itemStatusPointer->getCurrentValues();
|
auto&& currentStatusValues = itemStatusPointer->getCurrentValues();
|
||||||
int valueNum = 0;
|
int valueNum = 0;
|
||||||
for (int vec4Num = 0; vec4Num < NUM_STATUS_VEC4_PER_ITEM; vec4Num++) {
|
for (int vec4Num = 0; vec4Num < NUM_STATUS_VEC4_PER_ITEM; vec4Num++) {
|
||||||
auto& value = (vec4Num ? _itemStatus[i].first : _itemStatus[i].second);
|
auto& value = (vec4Num ? itemStatus[nbItems].first : itemStatus[nbItems].second);
|
||||||
value = glm::ivec4(Item::Status::Value::INVALID.getPackedData());
|
value = glm::ivec4(Item::Status::Value::INVALID.getPackedData());
|
||||||
for (int component = 0; component < VEC4_LENGTH; component++) {
|
for (int component = 0; component < VEC4_LENGTH; component++) {
|
||||||
valueNum = vec4Num * VEC4_LENGTH + component;
|
valueNum = vec4Num * VEC4_LENGTH + component;
|
||||||
|
@ -131,7 +125,8 @@ void DrawStatus::run(const RenderContextPointer& renderContext, const Input& inp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_itemStatus[i].first = _itemStatus[i].second = glm::ivec4(Item::Status::Value::INVALID.getPackedData());
|
auto invalid = glm::ivec4(Item::Status::Value::INVALID.getPackedData());
|
||||||
|
itemStatus.emplace_back(invalid, invalid);
|
||||||
}
|
}
|
||||||
nbItems++;
|
nbItems++;
|
||||||
}
|
}
|
||||||
|
@ -142,7 +137,11 @@ void DrawStatus::run(const RenderContextPointer& renderContext, const Input& inp
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allright, something to render let's do it
|
if (!_boundsBuffer) {
|
||||||
|
_boundsBuffer = std::make_shared<gpu::Buffer>(sizeof(render::ItemBound));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alright, something to render let's do it
|
||||||
gpu::doInBatch("DrawStatus::run", args->_context, [&](gpu::Batch& batch) {
|
gpu::doInBatch("DrawStatus::run", args->_context, [&](gpu::Batch& batch) {
|
||||||
glm::mat4 projMat;
|
glm::mat4 projMat;
|
||||||
Transform viewMat;
|
Transform viewMat;
|
||||||
|
@ -158,32 +157,24 @@ void DrawStatus::run(const RenderContextPointer& renderContext, const Input& inp
|
||||||
// bind the one gpu::Pipeline we need
|
// bind the one gpu::Pipeline we need
|
||||||
batch.setPipeline(getDrawItemBoundsPipeline());
|
batch.setPipeline(getDrawItemBoundsPipeline());
|
||||||
|
|
||||||
//AABox* itemAABox = reinterpret_cast<AABox*> (_itemBounds->editData());
|
_boundsBuffer->setData(itemBounds.size() * sizeof(render::ItemBound), (const gpu::Byte*) itemBounds.data());
|
||||||
//glm::ivec4* itemStatus = reinterpret_cast<glm::ivec4*> (_itemStatus->editData());
|
|
||||||
//Octree::Location* itemCell = reinterpret_cast<Octree::Location*> (_itemCells->editData());
|
|
||||||
|
|
||||||
const unsigned int VEC3_ADRESS_OFFSET = 3;
|
|
||||||
|
|
||||||
if (_showDisplay) {
|
if (_showDisplay) {
|
||||||
for (int i = 0; i < nbItems; i++) {
|
batch.setResourceBuffer(0, _boundsBuffer);
|
||||||
//batch._glUniform3fv(gpu::slot::uniform::Extra0, 1, (const float*)&(_itemBounds[i]));
|
batch.draw(gpu::LINES, (gpu::uint32) itemBounds.size() * 24, 0);
|
||||||
//batch._glUniform3fv(gpu::slot::uniform::Extra1, 1, ((const float*)&(_itemBounds[i])) + VEC3_ADRESS_OFFSET);
|
|
||||||
//glm::ivec4 cellLocation(_itemCells[i].pos, _itemCells[i].depth);
|
|
||||||
//batch._glUniform4iv(_drawItemCellLocLoc, 1, ((const int*)(&cellLocation)));
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
batch.setResourceBuffer(0, 0);
|
||||||
|
|
||||||
batch.setResourceTexture(0, gpu::TextureView(getStatusIconMap(), 0));
|
batch.setResourceTexture(0, gpu::TextureView(getStatusIconMap(), 0));
|
||||||
|
|
||||||
batch.setPipeline(getDrawItemStatusPipeline());
|
batch.setPipeline(getDrawItemStatusPipeline());
|
||||||
|
|
||||||
if (_showNetwork) {
|
if (_showNetwork) {
|
||||||
for (int i = 0; i < nbItems; i++) {
|
for (size_t i = 0; i < itemBounds.size(); i++) {
|
||||||
batch._glUniform3fv(gpu::slot::uniform::Extra0, 1, (const float*)&(_itemBounds[i]));
|
batch._glUniform3fv(gpu::slot::uniform::Extra0, 1, (const float*)&itemBounds[i].bound.getCorner());
|
||||||
batch._glUniform3fv(gpu::slot::uniform::Extra1, 1, ((const float*)&(_itemBounds[i])) + VEC3_ADRESS_OFFSET);
|
batch._glUniform3fv(gpu::slot::uniform::Extra1, 1, ((const float*)&itemBounds[i].bound.getScale()));
|
||||||
batch._glUniform4iv(gpu::slot::uniform::Extra2, 1, (const int*)&(_itemStatus[i].first));
|
batch._glUniform4iv(gpu::slot::uniform::Extra2, 1, (const int*)&(itemStatus[i].first));
|
||||||
batch._glUniform4iv(gpu::slot::uniform::Extra3, 1, (const int*)&(_itemStatus[i].second));
|
batch._glUniform4iv(gpu::slot::uniform::Extra3, 1, (const int*)&(itemStatus[i].second));
|
||||||
batch.draw(gpu::TRIANGLES, 24 * NUM_STATUS_VEC4_PER_ITEM, 0);
|
batch.draw(gpu::TRIANGLES, 24 * NUM_STATUS_VEC4_PER_ITEM, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,12 +62,7 @@ namespace render {
|
||||||
gpu::PipelinePointer _drawItemBoundsPipeline;
|
gpu::PipelinePointer _drawItemBoundsPipeline;
|
||||||
gpu::PipelinePointer _drawItemStatusPipeline;
|
gpu::PipelinePointer _drawItemStatusPipeline;
|
||||||
|
|
||||||
std::vector<AABox> _itemBounds;
|
gpu::BufferPointer _boundsBuffer;
|
||||||
std::vector<std::pair<glm::ivec4, glm::ivec4>> _itemStatus;
|
|
||||||
std::vector<Octree::Location> _itemCells;
|
|
||||||
//gpu::BufferPointer _itemBounds;
|
|
||||||
//gpu::BufferPointer _itemCells;
|
|
||||||
//gpu::BufferPointer _itemStatus;
|
|
||||||
gpu::TexturePointer _statusIconMap;
|
gpu::TexturePointer _statusIconMap;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,6 +321,7 @@ inline QDebug operator<<(QDebug debug, const ItemFilter& me) {
|
||||||
// Handy type to just pass the ID and the bound of an item
|
// Handy type to just pass the ID and the bound of an item
|
||||||
class ItemBound {
|
class ItemBound {
|
||||||
public:
|
public:
|
||||||
|
ItemBound() {}
|
||||||
ItemBound(ItemID id) : id(id) { }
|
ItemBound(ItemID id) : id(id) { }
|
||||||
ItemBound(ItemID id, const AABox& bound) : id(id), bound(bound) { }
|
ItemBound(ItemID id, const AABox& bound) : id(id), bound(bound) { }
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ layout(location=GPU_UNIFORM_EXTRA0) uniform ivec4 inCellLocation;
|
||||||
|
|
||||||
layout(location=0) out vec4 varColor;
|
layout(location=0) out vec4 varColor;
|
||||||
|
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
const vec4 UNIT_BOX[8] = vec4[8](
|
const vec4 UNIT_BOX[8] = vec4[8](
|
||||||
vec4(0.0, 0.0, 0.0, 1.0),
|
vec4(0.0, 0.0, 0.0, 1.0),
|
||||||
|
|
|
@ -20,10 +20,8 @@
|
||||||
<@include gpu/Color.slh@>
|
<@include gpu/Color.slh@>
|
||||||
<$declareColorWheel()$>
|
<$declareColorWheel()$>
|
||||||
|
|
||||||
|
|
||||||
layout(location=GPU_UNIFORM_COLOR) uniform vec4 inColor;
|
layout(location=GPU_UNIFORM_COLOR) uniform vec4 inColor;
|
||||||
|
|
||||||
|
|
||||||
struct ItemBound {
|
struct ItemBound {
|
||||||
vec4 id_boundPos;
|
vec4 id_boundPos;
|
||||||
vec4 boundDim_s;
|
vec4 boundDim_s;
|
||||||
|
@ -48,8 +46,6 @@ ItemBound getItemBound(int i) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
layout(location=0) out vec4 varColor;
|
layout(location=0) out vec4 varColor;
|
||||||
layout(location=1) out vec2 varTexcoord;
|
layout(location=1) out vec2 varTexcoord;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ Column {
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
sceneOctree.enabled = true;
|
sceneOctree.enabled = true;
|
||||||
itemSelection.enabled = true;
|
itemSelection.enabled = true;
|
||||||
sceneOctree.showVisibleCells = false;
|
sceneOctree.showVisibleCells = false;
|
||||||
sceneOctree.showEmptyCells = false;
|
sceneOctree.showEmptyCells = false;
|
||||||
itemSelection.showInsideItems = false;
|
itemSelection.showInsideItems = false;
|
||||||
|
@ -29,9 +29,9 @@ Column {
|
||||||
}
|
}
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
sceneOctree.enabled = false;
|
sceneOctree.enabled = false;
|
||||||
itemSelection.enabled = false;
|
itemSelection.enabled = false;
|
||||||
Render.getConfig("RenderMainView.FetchSceneSelection").freezeFrustum = false;
|
Render.getConfig("RenderMainView.FetchSceneSelection").freezeFrustum = false;
|
||||||
Render.getConfig("RenderMainView.CullSceneSelection").freezeFrustum = false;
|
Render.getConfig("RenderMainView.CullSceneSelection").freezeFrustum = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupBox {
|
GroupBox {
|
||||||
|
@ -44,7 +44,7 @@ Column {
|
||||||
CheckBox {
|
CheckBox {
|
||||||
text: "Freeze Culling Frustum"
|
text: "Freeze Culling Frustum"
|
||||||
checked: false
|
checked: false
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
Render.getConfig("RenderMainView.FetchSceneSelection").freezeFrustum = checked;
|
Render.getConfig("RenderMainView.FetchSceneSelection").freezeFrustum = checked;
|
||||||
Render.getConfig("RenderMainView.CullSceneSelection").freezeFrustum = checked;
|
Render.getConfig("RenderMainView.CullSceneSelection").freezeFrustum = checked;
|
||||||
}
|
}
|
||||||
|
@ -88,15 +88,19 @@ Column {
|
||||||
text: "Partial Sub-cell Items"
|
text: "Partial Sub-cell Items"
|
||||||
checked: false
|
checked: false
|
||||||
onCheckedChanged: { root.itemSelection.showPartialSubcellItems = checked }
|
onCheckedChanged: { root.itemSelection.showPartialSubcellItems = checked }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupBox {
|
GroupBox {
|
||||||
title: "Render Items"
|
title: "Render Items"
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
|
||||||
Column{
|
Column{
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.right: parent.right;
|
||||||
Repeater {
|
Repeater {
|
||||||
model: [ "Opaque:RenderMainView.DrawOpaqueDeferred", "Transparent:RenderMainView.DrawTransparentDeferred", "Light:RenderMainView.DrawLight",
|
model: [ "Opaque:RenderMainView.DrawOpaqueDeferred", "Transparent:RenderMainView.DrawTransparentDeferred", "Light:RenderMainView.DrawLight",
|
||||||
"Opaque Overlays:RenderMainView.DrawOverlay3DOpaque", "Transparent Overlays:RenderMainView.DrawOverlay3DTransparent" ]
|
"Opaque Overlays:RenderMainView.DrawOverlay3DOpaque", "Transparent Overlays:RenderMainView.DrawOverlay3DTransparent" ]
|
||||||
|
|
Loading…
Reference in a new issue