Added Haze model as input to transparency shader.

This commit is contained in:
Nissim Hadar 2017-11-08 08:01:19 -08:00
parent 83ff20b599
commit 3d2c8186e7
3 changed files with 6 additions and 3 deletions

View file

@ -163,7 +163,7 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
task.addJob<DrawHaze>("DrawHazeDeferred", drawHazeInputs);
// Render transparent objects forward in LightingBuffer
const auto transparentsInputs = DrawDeferred::Inputs(transparents, lightingModel).asVarying();
const auto transparentsInputs = DrawDeferred::Inputs(transparents, lightingModel, hazeModel).asVarying();
task.addJob<DrawDeferred>("DrawTransparentDeferred", transparentsInputs, shapePlumber);
// LIght Cluster Grid Debuging job
@ -291,6 +291,7 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs&
const auto& inItems = inputs.get0();
const auto& lightingModel = inputs.get1();
const auto& hazeModel = inputs.get2();
RenderArgs* args = renderContext->args;
@ -311,6 +312,7 @@ void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs&
// Setup lighting model for all items;
batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer());
batch.setUniformBuffer(render::ShapePipeline::Slot::HAZE_MODEL, hazeModel->getParametersBuffer());
// From the lighting model define a global shapKey ORED with individiual keys
ShapeKey::Builder keyBuilder;

View file

@ -15,7 +15,7 @@
#include <gpu/Pipeline.h>
#include <render/RenderFetchCullSortTask.h>
#include "LightingModel.h"
#include "model/Haze.h"
class BeginGPURangeTimer {
public:
@ -66,7 +66,7 @@ protected:
class DrawDeferred {
public:
using Inputs = render::VaryingSet2 <render::ItemBounds, LightingModelPointer>;
using Inputs = render::VaryingSet3 <render::ItemBounds, LightingModelPointer, model::HazePointer>;
using Config = DrawConfig;
using JobModel = render::Job::ModelI<DrawDeferred, Inputs, Config>;

View file

@ -238,6 +238,7 @@ public:
LIGHT,
LIGHT_AMBIENT_BUFFER,
FADE_PARAMETERS,
HAZE_MODEL
};
enum MAP {