mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 20:06:02 +02:00
Fixing the VaryingPair problem
This commit is contained in:
parent
6a5dff06c4
commit
f69c72f984
7 changed files with 21 additions and 16 deletions
|
@ -123,7 +123,10 @@ RenderDeferredTask::RenderDeferredTask(CullFunctor cullFunctor) {
|
||||||
// Draw Lights just add the lights to the current list of lights to deal with. NOt really gpu job for now.
|
// Draw Lights just add the lights to the current list of lights to deal with. NOt really gpu job for now.
|
||||||
addJob<DrawLight>("DrawLight", lights);
|
addJob<DrawLight>("DrawLight", lights);
|
||||||
|
|
||||||
const auto scatteringInputs = render::Varying(SubsurfaceScattering::Inputs(deferredFrameTransform, curvatureFramebufferAndDepth[0]));
|
curvatureFramebufferAndDepth.get<SurfaceGeometryPass::Outputs>().first;
|
||||||
|
|
||||||
|
// const auto scatteringInputs = render::Varying(SubsurfaceScattering::Inputs(deferredFrameTransform, curvatureFramebufferAndDepth[0]));
|
||||||
|
const auto scatteringInputs = render::Varying(SubsurfaceScattering::Inputs(deferredFrameTransform, curvatureFramebufferAndDepth.get<SurfaceGeometryPass::Outputs>().first));
|
||||||
const auto scatteringFramebuffer = addJob<SubsurfaceScattering>("Scattering", scatteringInputs);
|
const auto scatteringFramebuffer = addJob<SubsurfaceScattering>("Scattering", scatteringInputs);
|
||||||
|
|
||||||
// DeferredBuffer is complete, now let's shade it into the LightingBuffer
|
// DeferredBuffer is complete, now let's shade it into the LightingBuffer
|
||||||
|
|
|
@ -33,8 +33,7 @@ signals:
|
||||||
|
|
||||||
class SubsurfaceScattering {
|
class SubsurfaceScattering {
|
||||||
public:
|
public:
|
||||||
using Inputs = render::VaryingPair;//<DeferredFrameTransformPointer, gpu::FramebufferPointer>;
|
using Inputs = render::VaryingPair<DeferredFrameTransformPointer, gpu::FramebufferPointer>;
|
||||||
//using Inputs = render::VaryingPairBase;//<gpu::FramebufferPointer, gpu::TexturePointer>;
|
|
||||||
using Config = SubsurfaceScatteringConfig;
|
using Config = SubsurfaceScatteringConfig;
|
||||||
using JobModel = render::Job::ModelIO<SubsurfaceScattering, Inputs, gpu::FramebufferPointer, Config>;
|
using JobModel = render::Job::ModelIO<SubsurfaceScattering, Inputs, gpu::FramebufferPointer, Config>;
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ void SurfaceGeometryPass::run(const render::SceneContextPointer& sceneContext, c
|
||||||
|
|
||||||
auto pyramidTexture = framebufferCache->getDepthPyramidTexture();
|
auto pyramidTexture = framebufferCache->getDepthPyramidTexture();
|
||||||
auto curvatureFBO = framebufferCache->getCurvatureFramebuffer();
|
auto curvatureFBO = framebufferCache->getCurvatureFramebuffer();
|
||||||
|
|
||||||
curvatureAndDepth.first. template edit<gpu::FramebufferPointer>() = curvatureFBO;
|
curvatureAndDepth.first. template edit<gpu::FramebufferPointer>() = curvatureFBO;
|
||||||
curvatureAndDepth.second. template edit<gpu::TexturePointer>() = pyramidTexture;
|
curvatureAndDepth.second. template edit<gpu::TexturePointer>() = pyramidTexture;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ signals:
|
||||||
|
|
||||||
class SurfaceGeometryPass {
|
class SurfaceGeometryPass {
|
||||||
public:
|
public:
|
||||||
using Outputs = render::VaryingPair;//<gpu::FramebufferPointer, gpu::TexturePointer>;
|
using Outputs = render::VaryingPair<gpu::FramebufferPointer, gpu::TexturePointer>;
|
||||||
using Config = SurfaceGeometryPassConfig;
|
using Config = SurfaceGeometryPassConfig;
|
||||||
using JobModel = render::Job::ModelIO<SurfaceGeometryPass, DeferredFrameTransformPointer, Outputs, Config>;
|
using JobModel = render::Job::ModelIO<SurfaceGeometryPass, DeferredFrameTransformPointer, Outputs, Config>;
|
||||||
|
|
||||||
|
|
|
@ -108,8 +108,7 @@ protected:
|
||||||
|
|
||||||
class BlurGaussianDepthAware {
|
class BlurGaussianDepthAware {
|
||||||
public:
|
public:
|
||||||
using Inputs = VaryingPair;//<gpu::FramebufferPointer, gpu::TexturePointer>;
|
using Inputs = VaryingPair<gpu::FramebufferPointer, gpu::TexturePointer>;
|
||||||
// using InputPair = VaryingPairBase;//<gpu::FramebufferPointer, gpu::TexturePointer>;
|
|
||||||
using Config = BlurGaussianDepthAwareConfig;
|
using Config = BlurGaussianDepthAwareConfig;
|
||||||
using JobModel = Job::ModelIO<BlurGaussianDepthAware, Inputs, gpu::FramebufferPointer, Config>;
|
using JobModel = Job::ModelIO<BlurGaussianDepthAware, Inputs, gpu::FramebufferPointer, Config>;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ void TaskConfig::refresh() {
|
||||||
|
|
||||||
namespace render{
|
namespace render{
|
||||||
|
|
||||||
template <> void varyingGet(const VaryingPair& data, uint8_t index, Varying& var) {
|
template <> void varyingGet(const VaryingPairBase& data, uint8_t index, Varying& var) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
var = data.first;
|
var = data.first;
|
||||||
} else {
|
} else {
|
||||||
|
@ -35,6 +35,6 @@ namespace render{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <> uint8_t varyingLength(const VaryingPair& data) { return 2; }
|
template <> uint8_t varyingLength(const VaryingPairBase& data) { return 2; }
|
||||||
|
|
||||||
}
|
}
|
|
@ -85,7 +85,12 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
using VaryingPair = std::pair<Varying, Varying>;
|
using VaryingPairBase = std::pair<Varying, Varying>;
|
||||||
|
|
||||||
|
|
||||||
|
template <> void varyingGet(const VaryingPairBase& data, uint8_t index, Varying& var);
|
||||||
|
template <> uint8_t varyingLength(const VaryingPairBase& data);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
class VaryingPairBase {
|
class VaryingPairBase {
|
||||||
public:
|
public:
|
||||||
|
@ -98,11 +103,11 @@ class VaryingPairBase {
|
||||||
VaryingPairBase(const Varying& _first, const Varying& _second) : first(_first), second(_second) {}
|
VaryingPairBase(const Varying& _first, const Varying& _second) : first(_first), second(_second) {}
|
||||||
|
|
||||||
};
|
};
|
||||||
*/ /*
|
*/
|
||||||
template < class T0, class T1 >
|
template < class T0, class T1 >
|
||||||
class VaryingPair : public std::pair<Varying, Varying> {
|
class VaryingPair : public VaryingPairBase {
|
||||||
public:
|
public:
|
||||||
using Parent = std::pair<Varying, Varying>;
|
using Parent = VaryingPairBase;
|
||||||
|
|
||||||
VaryingPair() : Parent(Varying(T0()), Varying(T1())) {}
|
VaryingPair() : Parent(Varying(T0()), Varying(T1())) {}
|
||||||
VaryingPair(const VaryingPair& pair) : Parent(pair.first, pair.second) {}
|
VaryingPair(const VaryingPair& pair) : Parent(pair.first, pair.second) {}
|
||||||
|
@ -113,12 +118,10 @@ public:
|
||||||
|
|
||||||
const T1& getSecond() const { return second.get<T1>(); }
|
const T1& getSecond() const { return second.get<T1>(); }
|
||||||
T1& editSecond() { return second.edit<T1>(); }
|
T1& editSecond() { return second.edit<T1>(); }
|
||||||
|
|
||||||
};
|
};
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
template <> void varyingGet(const VaryingPair& data, uint8_t index, Varying& var);
|
|
||||||
template <> uint8_t varyingLength(const VaryingPair& data);
|
|
||||||
/* template <class T> Varying varyingGet(const T& data, uint8_t index) {
|
/* template <class T> Varying varyingGet(const T& data, uint8_t index) {
|
||||||
return Varying(T());
|
return Varying(T());
|
||||||
}*/
|
}*/
|
||||||
|
|
Loading…
Reference in a new issue