History

Merge remote-tracking branch 'upstream/master' into android

Brad Davis committed 8 years ago

Commit 6a06bf42 parents b422321 d4571bd188 files · +1191 −774Browse files

Showing the changes to libraries/render-utils/src/DeferredLightingEffect.cpp (1 of 188 files). Show all

Unified · Split

libraries/render-utils/src/DeferredLightingEffect.cpp+21−21
@@ -106,13 +106,13 @@ void DeferredLightingEffect::init() { · 105 unmodified lines
106106
107107 void DeferredLightingEffect::setupKeyLightBatch(const RenderArgs* args, gpu::Batch& batch, int lightBufferUnit, int ambientBufferUnit, int skyboxCubemapUnit) {
108108 PerformanceTimer perfTimer("DLE->setupBatch()");
109− model::LightPointer keySunLight;
109+ graphics::LightPointer keySunLight;
110110 auto lightStage = args->_scene->getStage<LightStage>();
111111 if (lightStage) {
112112 keySunLight = lightStage->getCurrentKeyLight();
113113 }
114114
115− model::LightPointer keyAmbiLight;
115+ graphics::LightPointer keyAmbiLight;
116116 if (lightStage) {
117117 keyAmbiLight = lightStage->getCurrentAmbientLight();
118118 }
@@ -232,9 +232,9 @@ static void loadLightProgram(const char* vertSource, const char* fragSource, boo · 113 unmodified lines
232232
233233 #include <shared/Shapes.h>
234234
235−model::MeshPointer DeferredLightingEffect::getPointLightMesh() {
235+graphics::MeshPointer DeferredLightingEffect::getPointLightMesh() {
236236 if (!_pointLightMesh) {
237− _pointLightMesh = std::make_shared<model::Mesh>();
237+ _pointLightMesh = std::make_shared<graphics::Mesh>();
238238
239239 // let's use a icosahedron
240240 auto solid = geometry::icosahedron();
@@ -259,19 +259,19 @@ model::MeshPointer DeferredLightingEffect::getPointLightMesh() { · 18 unmodified lines
259259 delete[] indexData;
260260
261261
262− std::vector<model::Mesh::Part> parts;
263− parts.push_back(model::Mesh::Part(0, nbIndices, 0, model::Mesh::TRIANGLES));
264− parts.push_back(model::Mesh::Part(0, nbIndices, 0, model::Mesh::LINE_STRIP)); // outline version
262+ std::vector<graphics::Mesh::Part> parts;
263+ parts.push_back(graphics::Mesh::Part(0, nbIndices, 0, graphics::Mesh::TRIANGLES));
264+ parts.push_back(graphics::Mesh::Part(0, nbIndices, 0, graphics::Mesh::LINE_STRIP)); // outline version
265265
266266
267− _pointLightMesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(model::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL));
267+ _pointLightMesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(graphics::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL));
268268 }
269269 return _pointLightMesh;
270270 }
271271
272−model::MeshPointer DeferredLightingEffect::getSpotLightMesh() {
272+graphics::MeshPointer DeferredLightingEffect::getSpotLightMesh() {
273273 if (!_spotLightMesh) {
274− _spotLightMesh = std::make_shared<model::Mesh>();
274+ _spotLightMesh = std::make_shared<graphics::Mesh>();
275275
276276 int slices = 16;
277277 int rings = 3;
@@ -356,12 +356,12 @@ model::MeshPointer DeferredLightingEffect::getSpotLightMesh() { · 78 unmodified lines
356356 delete[] indexData;
357357
358358
359− std::vector<model::Mesh::Part> parts;
360− parts.push_back(model::Mesh::Part(0, indices, 0, model::Mesh::TRIANGLES));
361− parts.push_back(model::Mesh::Part(0, indices, 0, model::Mesh::LINE_STRIP)); // outline version
359+ std::vector<graphics::Mesh::Part> parts;
360+ parts.push_back(graphics::Mesh::Part(0, indices, 0, graphics::Mesh::TRIANGLES));
361+ parts.push_back(graphics::Mesh::Part(0, indices, 0, graphics::Mesh::LINE_STRIP)); // outline version
362362
363363
364− _spotLightMesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(model::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL));
364+ _spotLightMesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(graphics::Mesh::Part), (gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL));
365365 }
366366 return _spotLightMesh;
367367 }
@@ -442,7 +442,7 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext, · 74 unmodified lines
442442 const DeferredFrameTransformPointer& frameTransform,
443443 const DeferredFramebufferPointer& deferredFramebuffer,
444444 const LightingModelPointer& lightingModel,
445− const model::HazePointer& haze,
445+ const graphics::HazePointer& haze,
446446 const SurfaceGeometryFramebufferPointer& surfaceGeometryFramebuffer,
447447 const AmbientOcclusionFramebufferPointer& ambientOcclusionFramebuffer,
448448 const SubsurfaceScatteringResourcePointer& subsurfaceScatteringResource) {
@@ -516,7 +516,7 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext, · 67 unmodified lines
516516
517517 auto keyLight = lightAndShadow.first;
518518
519− model::LightPointer keyAmbientLight;
519+ graphics::LightPointer keyAmbientLight;
520520 if (lightStage && lightStage->_currentFrame._ambientLights.size()) {
521521 keyAmbientLight = lightStage->getLight(lightStage->_currentFrame._ambientLights.front());
522522 }
@@ -749,12 +749,12 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) { · 226 unmodified lines
749749 if (lightStage) {
750750
751751 // Allocate a default global light directional and ambient
752− auto lp = std::make_shared<model::Light>();
753− lp->setType(model::Light::SUN);
752+ auto lp = std::make_shared<graphics::Light>();
753+ lp->setType(graphics::Light::SUN);
754754 lp->setDirection(glm::vec3(-1.0f));
755755 lp->setColor(glm::vec3(1.0f));
756756 lp->setIntensity(1.0f);
757− lp->setType(model::Light::SUN);
757+ lp->setType(graphics::Light::SUN);
758758 lp->setAmbientSpherePreset(gpu::SphericalHarmonics::Preset::OLD_TOWN_SQUARE);
759759
760760 lp->setAmbientIntensity(0.5f);
@@ -776,7 +776,7 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) { · 15 unmodified lines
776776 auto backgroundStage = renderContext->_scene->getStage<BackgroundStage>();
777777 if (backgroundStage) {
778778
779− auto background = std::make_shared<model::SunSkyStage>();
779+ auto background = std::make_shared<graphics::SunSkyStage>();
780780 background->setSkybox(_defaultSkybox);
781781
782782 // capture deault background
@@ -791,7 +791,7 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) { · 8 unmodified lines
791791 auto hazeStage = renderContext->_scene->getStage<HazeStage>();
792792 if (hazeStage) {
793793
794− auto haze = std::make_shared<model::Haze>();
794+ auto haze = std::make_shared<graphics::Haze>();
795795
796796 _defaultHaze = haze;
797797 _defaultHazeID = hazeStage->addHaze(_defaultHaze);