// // Created by Samuel Gateau on 2018/12/06 // Copyright 2013-2018 High Fidelity, Inc. // Copyright 2024 Overte e.V. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "AssembleLightingStageTask.h" #include void FetchCurrentFrames::run(const render::RenderContextPointer& renderContext, Output& output) { auto lightStage = renderContext->_scene->getStage(); assert(lightStage); output.edit0() = std::make_shared(lightStage->_currentFrame); auto backgroundStage = renderContext->_scene->getStage(); assert(backgroundStage); output.edit1() = std::make_shared(backgroundStage->_currentFrame); auto hazeStage = renderContext->_scene->getStage(); assert(hazeStage); output.edit2() = std::make_shared(hazeStage->_currentFrame); auto bloomStage = renderContext->_scene->getStage(); assert(bloomStage); output.edit3() = std::make_shared(bloomStage->_currentFrame); auto tonemappingStage = renderContext->_scene->getStage(); assert(tonemappingStage); output.edit4() = std::make_shared(tonemappingStage->_currentFrame); auto ambientOcclusionStage = renderContext->_scene->getStage(); assert(ambientOcclusionStage); output.edit5() = std::make_shared(ambientOcclusionStage->_currentFrame); auto normalMapAttenuationStage = renderContext->_scene->getStage(); assert(normalMapAttenuationStage); output.edit6() = std::make_shared(normalMapAttenuationStage->_currentFrame); } void AssembleLightingStageTask::build(JobModel& task, const render::Varying& input, render::Varying& output) { const auto& fetchCullSortOut = input.get(); const auto& items = fetchCullSortOut.get0(); //const auto& items = input.get(); const auto& lights = items[RenderFetchCullSortTask::LIGHT]; const auto& metas = items[RenderFetchCullSortTask::META]; // Clear Light, Haze, Bloom, and Skybox Stages and render zones from the general metas bucket const auto zones = task.addJob("ZoneRenderer", metas); // Draw Lights just add the lights to the current list of lights to deal with. NOt really gpu job for now. task.addJob("DrawLight", lights); // Fetch the current frame stacks from all the stages const auto currentStageFrames = task.addJob("FetchCurrentFrames"); output = Output(currentStageFrames, zones); }