History

Merge branch 'master' of https://github.com/highfidelity/hifi into applications_diet

Atlante45 committed 11 years ago

Commit 11a2eca2 parents 2039895 7632dbe92 files · +607 −340Browse files

Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 92 files). Show all

Unified · Split

interface/src/MetavoxelSystem.cpp+17−16
@@ -21,17 +21,18 @@ · 20 unmodified lines
2121
2222 #include <glm/gtx/transform.hpp>
2323
24+#include <DeferredLightingEffect.h>
2425 #include <GeometryUtil.h>
26+#include <Model.h>
2527 #include <SharedUtil.h>
2628
2729 #include <MetavoxelMessages.h>
2830 #include <MetavoxelUtil.h>
31+#include <PathUtils.h>
2932 #include <ScriptCache.h>
3033
3134 #include "Application.h"
3235 #include "MetavoxelSystem.h"
33−#include "renderer/Model.h"
34−#include "renderer/RenderUtil.h"
3536
3637 REGISTER_META_OBJECT(DefaultMetavoxelRendererImplementation)
3738 REGISTER_META_OBJECT(SphereRenderer)
@@ -63,9 +64,9 @@ void MetavoxelSystem::init() { · 25 unmodified lines
6364 _voxelBufferAttribute->setLODThresholdMultiplier(
6465 AttributeRegistry::getInstance()->getVoxelColorAttribute()->getLODThresholdMultiplier());
6566
66− _baseHeightfieldProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() +
67+ _baseHeightfieldProgram.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() +
6768 "shaders/metavoxel_heightfield_base.vert");
68− _baseHeightfieldProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() +
69+ _baseHeightfieldProgram.addShaderFromSourceFile(QGLShader::Fragment, PathUtils::resourcesPath() +
6970 "shaders/metavoxel_heightfield_base.frag");
7071 _baseHeightfieldProgram.link();
7172
@@ -78,9 +79,9 @@ void MetavoxelSystem::init() { · 6 unmodified lines
7879
7980 loadSplatProgram("heightfield", _splatHeightfieldProgram, _splatHeightfieldLocations);
8081
81− _heightfieldCursorProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() +
82+ _heightfieldCursorProgram.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() +
8283 "shaders/metavoxel_heightfield_cursor.vert");
83− _heightfieldCursorProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() +
84+ _heightfieldCursorProgram.addShaderFromSourceFile(QGLShader::Fragment, PathUtils::resourcesPath() +
8485 "shaders/metavoxel_cursor.frag");
8586 _heightfieldCursorProgram.link();
8687
@@ -88,17 +89,17 @@ void MetavoxelSystem::init() { · 1 unmodified line
8889 _heightfieldCursorProgram.setUniformValue("heightMap", 0);
8990 _heightfieldCursorProgram.release();
9091
91− _baseVoxelProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() +
92+ _baseVoxelProgram.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() +
9293 "shaders/metavoxel_voxel_base.vert");
93− _baseVoxelProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() +
94+ _baseVoxelProgram.addShaderFromSourceFile(QGLShader::Fragment, PathUtils::resourcesPath() +
9495 "shaders/metavoxel_voxel_base.frag");
9596 _baseVoxelProgram.link();
9697
9798 loadSplatProgram("voxel", _splatVoxelProgram, _splatVoxelLocations);
9899
99− _voxelCursorProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() +
100+ _voxelCursorProgram.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() +
100101 "shaders/metavoxel_voxel_cursor.vert");
101− _voxelCursorProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() +
102+ _voxelCursorProgram.addShaderFromSourceFile(QGLShader::Fragment, PathUtils::resourcesPath() +
102103 "shaders/metavoxel_cursor.frag");
103104 _voxelCursorProgram.link();
104105 }
@@ -470,7 +471,7 @@ void MetavoxelSystem::render() { · 365 unmodified lines
470471 glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
471472 glNormal3f(0.0f, 1.0f, 0.0f);
472473
473− Application::getInstance()->getDeferredLightingEffect()->bindSimpleProgram();
474+ DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram();
474475
475476 foreach (const HermiteBatch& batch, _hermiteBatches) {
476477 batch.vertexBuffer->bind();
@@ -482,7 +483,7 @@ void MetavoxelSystem::render() { · 5 unmodified lines
482483 batch.vertexBuffer->release();
483484 }
484485
485− Application::getInstance()->getDeferredLightingEffect()->releaseSimpleProgram();
486+ DependencyManager::get<DeferredLightingEffect>()->releaseSimpleProgram();
486487
487488 glDisableClientState(GL_VERTEX_ARRAY);
488489
@@ -836,9 +837,9 @@ void MetavoxelSystem::guideToAugmented(MetavoxelVisitor& visitor, bool render) { · 347 unmodified lines
836837 }
837838
838839 void MetavoxelSystem::loadSplatProgram(const char* type, ProgramObject& program, SplatLocations& locations) {
839− program.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() +
840+ program.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() +
840841 "shaders/metavoxel_" + type + "_splat.vert");
841− program.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() +
842+ program.addShaderFromSourceFile(QGLShader::Fragment, PathUtils::resourcesPath() +
842843 "shaders/metavoxel_" + type + "_splat.frag");
843844 program.link();
844845
@@ -1981,7 +1982,7 @@ void SphereRenderer::render(const MetavoxelLOD& lod, bool contained, bool cursor · 1136 unmodified lines
19811982 glm::vec3 axis = glm::axis(rotation);
19821983 glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
19831984
1984− Application::getInstance()->getDeferredLightingEffect()->renderSolidSphere(sphere->getScale(), 32, 32);
1985+ DependencyManager::get<DeferredLightingEffect>()->renderSolidSphere(sphere->getScale(), 32, 32);
19851986
19861987 glPopMatrix();
19871988 }
@@ -2002,7 +2003,7 @@ void CuboidRenderer::render(const MetavoxelLOD& lod, bool contained, bool cursor · 14 unmodified lines
20022003 glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
20032004 glScalef(1.0f, cuboid->getAspectY(), cuboid->getAspectZ());
20042005
2005− Application::getInstance()->getDeferredLightingEffect()->renderSolidCube(cuboid->getScale() * 2.0f);
2006+ DependencyManager::get<DeferredLightingEffect>()->renderSolidCube(cuboid->getScale() * 2.0f);
20062007
20072008 glPopMatrix();
20082009 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t