mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 19:03:07 +02:00
Cleaning up changes, removing comments and dead code etc...
This commit is contained in:
parent
49779754ff
commit
5394ac8672
3 changed files with 2 additions and 59 deletions
|
@ -343,7 +343,7 @@ public:
|
||||||
// Don't actually crash in debug builds, in case this apparent deadlock is simply from
|
// Don't actually crash in debug builds, in case this apparent deadlock is simply from
|
||||||
// the developer actively debugging code
|
// the developer actively debugging code
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
// deadlockDetectionCrash();
|
deadlockDetectionCrash();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,12 +59,8 @@
|
||||||
#include "EntityEditPacketSender.h"
|
#include "EntityEditPacketSender.h"
|
||||||
#include "PhysicalEntitySimulation.h"
|
#include "PhysicalEntitySimulation.h"
|
||||||
|
|
||||||
//gpu::PipelinePointer RenderablePolyVoxEntityItem::_pipeline = nullptr;
|
|
||||||
//gpu::PipelinePointer RenderablePolyVoxEntityItem::_wireframePipeline = nullptr;
|
|
||||||
|
|
||||||
const float MARCHING_CUBE_COLLISION_HULL_OFFSET = 0.5;
|
const float MARCHING_CUBE_COLLISION_HULL_OFFSET = 0.5;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A PolyVoxEntity has several interdependent parts:
|
A PolyVoxEntity has several interdependent parts:
|
||||||
|
|
||||||
|
@ -737,35 +733,6 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if (!_pipeline) {
|
|
||||||
gpu::ShaderPointer vertexShader = gpu::Shader::createVertex(std::string(polyvox_vert));
|
|
||||||
gpu::ShaderPointer pixelShader = gpu::Shader::createPixel(std::string(polyvox_frag));
|
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
|
||||||
slotBindings.insert(gpu::Shader::Binding(std::string("materialBuffer"), MATERIAL_GPU_SLOT));
|
|
||||||
slotBindings.insert(gpu::Shader::Binding(std::string("xMap"), 0));
|
|
||||||
slotBindings.insert(gpu::Shader::Binding(std::string("yMap"), 1));
|
|
||||||
slotBindings.insert(gpu::Shader::Binding(std::string("zMap"), 2));
|
|
||||||
|
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vertexShader, pixelShader);
|
|
||||||
gpu::Shader::makeProgram(*program, slotBindings);
|
|
||||||
|
|
||||||
auto state = std::make_shared<gpu::State>();
|
|
||||||
state->setCullMode(gpu::State::CULL_BACK);
|
|
||||||
state->setDepthTest(true, true, gpu::LESS_EQUAL);
|
|
||||||
PrepareStencil::testMaskDrawShape(*state);
|
|
||||||
|
|
||||||
_pipeline = gpu::Pipeline::create(program, state);
|
|
||||||
|
|
||||||
auto wireframeState = std::make_shared<gpu::State>();
|
|
||||||
wireframeState->setCullMode(gpu::State::CULL_BACK);
|
|
||||||
wireframeState->setDepthTest(true, true, gpu::LESS_EQUAL);
|
|
||||||
wireframeState->setFillMode(gpu::State::FILL_LINE);
|
|
||||||
PrepareStencil::testMaskDrawShape(*wireframeState);
|
|
||||||
|
|
||||||
_wireframePipeline = gpu::Pipeline::create(program, wireframeState);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (!_vertexFormat) {
|
if (!_vertexFormat) {
|
||||||
auto vf = std::make_shared<gpu::Stream::Format>();
|
auto vf = std::make_shared<gpu::Stream::Format>();
|
||||||
vf->setAttribute(gpu::Stream::POSITION, 0, gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::XYZ), 0);
|
vf->setAttribute(gpu::Stream::POSITION, 0, gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::XYZ), 0);
|
||||||
|
@ -775,11 +742,6 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) {
|
||||||
|
|
||||||
gpu::Batch& batch = *args->_batch;
|
gpu::Batch& batch = *args->_batch;
|
||||||
|
|
||||||
// Pick correct Pipeline
|
|
||||||
// bool wireframe = (render::ShapeKey(args->_globalShapeKey).isWireframe());
|
|
||||||
// auto pipeline = (wireframe ? _wireframePipeline : _pipeline);
|
|
||||||
// batch.setPipeline(pipeline);
|
|
||||||
|
|
||||||
Transform transform(voxelToWorldMatrix());
|
Transform transform(voxelToWorldMatrix());
|
||||||
batch.setModelTransform(transform);
|
batch.setModelTransform(transform);
|
||||||
batch.setInputFormat(_vertexFormat);
|
batch.setInputFormat(_vertexFormat);
|
||||||
|
@ -1669,7 +1631,7 @@ void RenderablePolyVoxEntityItem::bonkNeighbors() {
|
||||||
|
|
||||||
void RenderablePolyVoxEntityItem::locationChanged(bool tellPhysics) {
|
void RenderablePolyVoxEntityItem::locationChanged(bool tellPhysics) {
|
||||||
EntityItem::locationChanged(tellPhysics);
|
EntityItem::locationChanged(tellPhysics);
|
||||||
if (/*!_pipeline || */!render::Item::isValidID(_myItem)) {
|
if (!render::Item::isValidID(_myItem)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
render::ScenePointer scene = AbstractViewStateInterface::instance()->getMain3DScene();
|
render::ScenePointer scene = AbstractViewStateInterface::instance()->getMain3DScene();
|
||||||
|
|
|
@ -44,13 +44,6 @@ void renderShape(RenderArgs* args, const ShapePlumberPointer& shapeContext, cons
|
||||||
auto key = item.getShapeKey() | globalKey;
|
auto key = item.getShapeKey() | globalKey;
|
||||||
if (key.isValid() && !key.hasOwnPipeline()) {
|
if (key.isValid() && !key.hasOwnPipeline()) {
|
||||||
args->_shapePipeline = shapeContext->pickPipeline(args, key);
|
args->_shapePipeline = shapeContext->pickPipeline(args, key);
|
||||||
/* if (!args->_shapePipeline) {
|
|
||||||
if (key.isCustom()) {
|
|
||||||
if (item.defineCustomShapePipeline(*shapeContext, key)) {
|
|
||||||
args->_shapePipeline = shapeContext->pickPipeline(args, key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
if (args->_shapePipeline) {
|
if (args->_shapePipeline) {
|
||||||
args->_shapePipeline->prepareShapeItem(args, key, item);
|
args->_shapePipeline->prepareShapeItem(args, key, item);
|
||||||
item.render(args);
|
item.render(args);
|
||||||
|
@ -119,18 +112,6 @@ void render::renderStateSortShapes(const RenderContextPointer& renderContext,
|
||||||
auto& bucket = sortedShapes[pipelineKey];
|
auto& bucket = sortedShapes[pipelineKey];
|
||||||
args->_shapePipeline = shapeContext->pickPipeline(args, pipelineKey);
|
args->_shapePipeline = shapeContext->pickPipeline(args, pipelineKey);
|
||||||
if (!args->_shapePipeline) {
|
if (!args->_shapePipeline) {
|
||||||
/* if (pipelineKey.isCustom()) {
|
|
||||||
if (bucket.front().defineCustomShapePipeline(*shapeContext, pipelineKey)) {
|
|
||||||
args->_shapePipeline = shapeContext->pickPipeline(args, pipelineKey);
|
|
||||||
if (!args->_shapePipeline) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (auto& item : bucket) {
|
for (auto& item : bucket) {
|
||||||
|
|
Loading…
Reference in a new issue