drafting more factorisation of render tasks

This commit is contained in:
sam gateau 2018-12-05 17:47:33 -08:00
parent 8efdec1e51
commit a267c3115a
3 changed files with 13 additions and 32 deletions

View file

@ -74,36 +74,6 @@ void ZoneEntityRenderer::onRemoveFromSceneTyped(const TypedEntityPointer& entity
}
void ZoneEntityRenderer::doRender(RenderArgs* args) {
#if 0
if (ZoneEntityItem::getDrawZoneBoundaries()) {
switch (_entity->getShapeType()) {
case SHAPE_TYPE_BOX:
case SHAPE_TYPE_SPHERE:
{
PerformanceTimer perfTimer("zone->renderPrimitive");
static const glm::vec4 DEFAULT_COLOR(1.0f, 1.0f, 1.0f, 1.0f);
if (!updateModelTransform()) {
break;
}
auto geometryCache = DependencyManager::get<GeometryCache>();
gpu::Batch& batch = *args->_batch;
batch.setModelTransform(_modelTransform);
if (_entity->getShapeType() == SHAPE_TYPE_SPHERE) {
geometryCache->renderWireSphereInstance(args, batch, DEFAULT_COLOR);
} else {
geometryCache->renderWireCubeInstance(args, batch, DEFAULT_COLOR);
}
}
break;
// Compund shapes are handled by the _model member
case SHAPE_TYPE_COMPOUND:
default:
// Not handled
break;
}
}
#endif
if (!_stage) {
_stage = args->_scene->getStage<LightStage>();
assert(_stage);

View file

@ -129,4 +129,15 @@ public:
void run(const render::RenderContextPointer& renderContext, Outputs& outputs);
};
class RenderUpdateStageLightingTask {
public:
using Inputs =
using Outputs = render::VaryingSet4<LightStage::FramePointer, BackgroundStage::FramePointer, HazeStage::FramePointer, BloomStage::FramePointer>;
using JobModel = render::Job::ModelIO<FetchCurrentFrames, Outputs>;
RenderUpdateStageLightingTask() {}
void run(const render::RenderContextPointer& renderContext, Outputs& outputs);
};
#endif // hifi_RenderDeferredTask_h

View file

@ -207,7 +207,7 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
const auto velocityBufferOutputs = task.addJob<VelocityBufferPass>("VelocityBuffer", velocityBufferInputs);
const auto velocityBuffer = velocityBufferOutputs.getN<VelocityBufferPass::Outputs>(0);
// Clear Light, Haze, Bloom, and Skybox Stages and render zones from the general metas bucket
/* // Clear Light, Haze, Bloom, and Skybox Stages and render zones from the general metas bucket
const auto zones = task.addJob<ZoneRendererTask>("ZoneRenderer", metas);
// Draw Lights just add the lights to the current list of lights to deal with. NOt really gpu job for now.
@ -219,7 +219,7 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
const auto backgroundFrame = currentStageFrames.getN<FetchCurrentFrames::Outputs>(1);
const auto hazeFrame = currentStageFrames.getN<FetchCurrentFrames::Outputs>(2);
const auto bloomFrame = currentStageFrames.getN<FetchCurrentFrames::Outputs>(3);
*/
// Light Clustering
// Create the cluster grid of lights, cpu job for now
const auto lightClusteringPassInputs = LightClusteringPass::Inputs(deferredFrameTransform, lightingModel, lightFrame, linearDepthTarget).asVarying();