Applying changes done in deferred to forward

This commit is contained in:
sam gateau 2018-12-03 16:58:54 -08:00
parent 5af24aa7d9
commit 0343983f31
3 changed files with 47 additions and 15 deletions

View file

@ -48,7 +48,12 @@ using namespace render;
extern void initForwardPipelines(ShapePlumber& plumber);
void RenderForwardTask::build(JobModel& task, const render::Varying& input, render::Varying& output) {
auto items = input.get<Input>();
// const auto& inputs = input.get<Input>();
const auto& fetchedItems = input.get<Input>();
// const auto& fetchedItems = inputs[0];
// const auto& items = fetchedItems[0];
const auto& items = fetchedItems.get0();
auto fadeEffect = DependencyManager::get<FadeEffect>();
// Prepare the ShapePipelines
@ -56,15 +61,19 @@ void RenderForwardTask::build(JobModel& task, const render::Varying& input, rend
initForwardPipelines(*shapePlumber);
// Extract opaques / transparents / lights / metas / overlays / background
const auto& opaques = items.get0()[RenderFetchCullSortTask::OPAQUE_SHAPE];
const auto& transparents = items.get0()[RenderFetchCullSortTask::TRANSPARENT_SHAPE];
//const auto& lights = items.get0()[RenderFetchCullSortTask::LIGHT];
const auto& metas = items.get0()[RenderFetchCullSortTask::META];
const auto& overlayOpaques = items.get0()[RenderFetchCullSortTask::OVERLAY_OPAQUE_SHAPE];
const auto& overlayTransparents = items.get0()[RenderFetchCullSortTask::OVERLAY_TRANSPARENT_SHAPE];
const auto& opaques = items[RenderFetchCullSortTask::OPAQUE_SHAPE];
const auto& transparents = items[RenderFetchCullSortTask::TRANSPARENT_SHAPE];
const auto& lights = items[RenderFetchCullSortTask::LIGHT];
const auto& metas = items[RenderFetchCullSortTask::META];
const auto& overlayOpaques = items[RenderFetchCullSortTask::OVERLAY_OPAQUE_SHAPE];
const auto& overlayTransparents = items[RenderFetchCullSortTask::OVERLAY_TRANSPARENT_SHAPE];
const auto& overlaysInFrontOpaque = items[RenderFetchCullSortTask::LAYER_FRONT_OPAQUE_SHAPE];
const auto& overlaysInFrontTransparent = items[RenderFetchCullSortTask::LAYER_FRONT_TRANSPARENT_SHAPE];
const auto& overlaysHUDOpaque = items[RenderFetchCullSortTask::LAYER_HUD_OPAQUE_SHAPE];
const auto& overlaysHUDTransparent = items[RenderFetchCullSortTask::LAYER_HUD_TRANSPARENT_SHAPE];
const auto& spatialSelection = fetchedItems[1];
//const auto& background = items.get0()[RenderFetchCullSortTask::BACKGROUND];
//const auto& spatialSelection = items[1];
fadeEffect->build(task, opaques);
@ -91,12 +100,9 @@ void RenderForwardTask::build(JobModel& task, const render::Varying& input, rend
task.addJob<PrepareStencil>("PrepareStencil", framebuffer);
// Layered Overlays
const auto filteredOverlaysOpaque = task.addJob<FilterLayeredItems>("FilterOverlaysLayeredOpaque", overlayOpaques, render::hifi::LAYER_3D_FRONT);
const auto filteredOverlaysTransparent = task.addJob<FilterLayeredItems>("FilterOverlaysLayeredTransparent", overlayTransparents, render::hifi::LAYER_3D_FRONT);
const auto overlaysInFrontOpaque = filteredOverlaysOpaque.getN<FilterLayeredItems::Outputs>(0);
const auto overlaysInFrontTransparent = filteredOverlaysTransparent.getN<FilterLayeredItems::Outputs>(0);
const auto nullJitter = Varying(glm::vec2(0.0f, 0.0f));
// Layered Over (in front)
const auto overlayInFrontOpaquesInputs = DrawOverlay3D::Inputs(overlaysInFrontOpaque, lightingModel, nullJitter).asVarying();
const auto overlayInFrontTransparentsInputs = DrawOverlay3D::Inputs(overlaysInFrontTransparent, lightingModel, nullJitter).asVarying();
task.addJob<DrawOverlay3D>("DrawOverlayInFrontOpaque", overlayInFrontOpaquesInputs, true);

View file

@ -45,6 +45,24 @@ function job_propKeys(job) {
return propKeys;
}
// Access job inputs
// return all the inputs of a job
function job_inoutKeys(job) {
var keys = Object.keys(job)
var inoutKeys = [];
for (var k=0; k < keys.length;k++) {
// Filter for relevant property
var key = keys[k]
if ((typeof job[key]) !== "function") {
if ((key == "input") || (key == "output")) {
inoutKeys.push(keys[k]);
}
}
}
return inoutKeys;
}
// Use this function to create a functor that will fill the specifed array with one entry name per task and job and it s rank
function job_list_functor(jobList, maxDepth) {
if (maxDepth === undefined) maxDepth = 100
@ -55,7 +73,7 @@ function job_list_functor(jobList, maxDepth) {
}
// Use this function to create a functor that will print the content of the Job visited calling the specified 'printout' function
function job_print_functor(printout, showProps, maxDepth) {
function job_print_functor(printout, showProps, showInOuts, maxDepth) {
if (maxDepth === undefined) maxDepth = 100
return function (job, depth, index) {
var tab = " "
@ -69,6 +87,14 @@ function job_print_functor(printout, showProps, maxDepth) {
printout(depthTab + tab + tab + typeof prop + " " + keys[p] + " " + prop);
}
}
if (showInOuts) {
printout("jsdkfkjdskflj")
var inouts = job_inoutKeys(job);
for (var p=0; p < inouts.length;p++) {
var prop = job[inouts[p]]
printout(depthTab + tab + tab + typeof prop + " " + inouts[p] + " " + prop);
}
}
return depth < maxDepth;
}
}

View file

@ -32,7 +32,7 @@ Rectangle {
Component.onCompleted: {
var message = ""
var functor = Jet.job_print_functor(function (line) { message += line + "\n"; }, false);
var functor = Jet.job_print_functor(function (line) { message += line + "\n"; }, false, true);
Jet.task_traverseTree(rootConfig, functor);
textArea.append(message);
}