Showing the changes to libraries/render-utils/src/DeferredLightingEffect.cpp (1 of 188 files). Show all
Unified · Split
| @@ -106,13 +106,13 @@ void DeferredLightingEffect::init() { · 105 unmodified lines | ||
| 106 | 106 | |
| 107 | 107 | void DeferredLightingEffect::setupKeyLightBatch(const RenderArgs* args, gpu::Batch& batch, int lightBufferUnit, int ambientBufferUnit, int skyboxCubemapUnit) { |
| 108 | 108 | PerformanceTimer perfTimer("DLE->setupBatch()"); |
| 109 | − model::LightPointer keySunLight; | |
| 109 | + graphics::LightPointer keySunLight; | |
| 110 | 110 | auto lightStage = args->_scene->getStage<LightStage>(); |
| 111 | 111 | if (lightStage) { |
| 112 | 112 | keySunLight = lightStage->getCurrentKeyLight(); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | − model::LightPointer keyAmbiLight; | |
| 115 | + graphics::LightPointer keyAmbiLight; | |
| 116 | 116 | if (lightStage) { |
| 117 | 117 | keyAmbiLight = lightStage->getCurrentAmbientLight(); |
| 118 | 118 | } |
| @@ -232,9 +232,9 @@ static void loadLightProgram(const char* vertSource, const char* fragSource, boo · 113 unmodified lines | ||
| 232 | 232 | |
| 233 | 233 | #include <shared/Shapes.h> |
| 234 | 234 | |
| 235 | −model::MeshPointer DeferredLightingEffect::getPointLightMesh() { | |
| 235 | +graphics::MeshPointer DeferredLightingEffect::getPointLightMesh() { | |
| 236 | 236 | if (!_pointLightMesh) { |
| 237 | − _pointLightMesh = std::make_shared<model::Mesh>(); | |
| 237 | + _pointLightMesh = std::make_shared<graphics::Mesh>(); | |
| 238 | 238 | |
| 239 | 239 | // let's use a icosahedron |
| 240 | 240 | auto solid = geometry::icosahedron(); |
| @@ -259,19 +259,19 @@ model::MeshPointer DeferredLightingEffect::getPointLightMesh() { · 18 unmodified lines | ||
| 259 | 259 | delete[] indexData; |
| 260 | 260 | |
| 261 | 261 | |
| 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 | |
| 265 | 265 | |
| 266 | 266 | |
| 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)); | |
| 268 | 268 | } |
| 269 | 269 | return _pointLightMesh; |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | −model::MeshPointer DeferredLightingEffect::getSpotLightMesh() { | |
| 272 | +graphics::MeshPointer DeferredLightingEffect::getSpotLightMesh() { | |
| 273 | 273 | if (!_spotLightMesh) { |
| 274 | − _spotLightMesh = std::make_shared<model::Mesh>(); | |
| 274 | + _spotLightMesh = std::make_shared<graphics::Mesh>(); | |
| 275 | 275 | |
| 276 | 276 | int slices = 16; |
| 277 | 277 | int rings = 3; |
| @@ -356,12 +356,12 @@ model::MeshPointer DeferredLightingEffect::getSpotLightMesh() { · 78 unmodified lines | ||
| 356 | 356 | delete[] indexData; |
| 357 | 357 | |
| 358 | 358 | |
| 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 | |
| 362 | 362 | |
| 363 | 363 | |
| 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)); | |
| 365 | 365 | } |
| 366 | 366 | return _spotLightMesh; |
| 367 | 367 | } |
| @@ -442,7 +442,7 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext, · 74 unmodified lines | ||
| 442 | 442 | const DeferredFrameTransformPointer& frameTransform, |
| 443 | 443 | const DeferredFramebufferPointer& deferredFramebuffer, |
| 444 | 444 | const LightingModelPointer& lightingModel, |
| 445 | − const model::HazePointer& haze, | |
| 445 | + const graphics::HazePointer& haze, | |
| 446 | 446 | const SurfaceGeometryFramebufferPointer& surfaceGeometryFramebuffer, |
| 447 | 447 | const AmbientOcclusionFramebufferPointer& ambientOcclusionFramebuffer, |
| 448 | 448 | const SubsurfaceScatteringResourcePointer& subsurfaceScatteringResource) { |
| @@ -516,7 +516,7 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext, · 67 unmodified lines | ||
| 516 | 516 | |
| 517 | 517 | auto keyLight = lightAndShadow.first; |
| 518 | 518 | |
| 519 | − model::LightPointer keyAmbientLight; | |
| 519 | + graphics::LightPointer keyAmbientLight; | |
| 520 | 520 | if (lightStage && lightStage->_currentFrame._ambientLights.size()) { |
| 521 | 521 | keyAmbientLight = lightStage->getLight(lightStage->_currentFrame._ambientLights.front()); |
| 522 | 522 | } |
| @@ -749,12 +749,12 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) { · 226 unmodified lines | ||
| 749 | 749 | if (lightStage) { |
| 750 | 750 | |
| 751 | 751 | // 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); | |
| 754 | 754 | lp->setDirection(glm::vec3(-1.0f)); |
| 755 | 755 | lp->setColor(glm::vec3(1.0f)); |
| 756 | 756 | lp->setIntensity(1.0f); |
| 757 | − lp->setType(model::Light::SUN); | |
| 757 | + lp->setType(graphics::Light::SUN); | |
| 758 | 758 | lp->setAmbientSpherePreset(gpu::SphericalHarmonics::Preset::OLD_TOWN_SQUARE); |
| 759 | 759 | |
| 760 | 760 | lp->setAmbientIntensity(0.5f); |
| @@ -776,7 +776,7 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) { · 15 unmodified lines | ||
| 776 | 776 | auto backgroundStage = renderContext->_scene->getStage<BackgroundStage>(); |
| 777 | 777 | if (backgroundStage) { |
| 778 | 778 | |
| 779 | − auto background = std::make_shared<model::SunSkyStage>(); | |
| 779 | + auto background = std::make_shared<graphics::SunSkyStage>(); | |
| 780 | 780 | background->setSkybox(_defaultSkybox); |
| 781 | 781 | |
| 782 | 782 | // capture deault background |
| @@ -791,7 +791,7 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) { · 8 unmodified lines | ||
| 791 | 791 | auto hazeStage = renderContext->_scene->getStage<HazeStage>(); |
| 792 | 792 | if (hazeStage) { |
| 793 | 793 | |
| 794 | − auto haze = std::make_shared<model::Haze>(); | |
| 794 | + auto haze = std::make_shared<graphics::Haze>(); | |
| 795 | 795 | |
| 796 | 796 | _defaultHaze = haze; |
| 797 | 797 | _defaultHazeID = hazeStage->addHaze(_defaultHaze); |