Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendertarget review #388

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DemoAntialiasingAggregationPipeline::DemoAntialiasingAggregationPipeline(glopera
m_antialiasingPipeline->multiFrameCount << multiFrameCount;

// Inputs
*m_multiFramePipeline->canvasInterface.colorRenderTargetInput(0) << *createInput<gloperate::ColorRenderTarget *>("Color");
*m_multiFramePipeline->canvasInterface.colorRenderTargetInputs()[0] << *createInput<gloperate::ColorRenderTarget *>("Color");

m_multiFramePipeline->canvasInterface.viewport << canvasInterface.viewport;
m_multiFramePipeline->canvasInterface.backgroundColor << canvasInterface.backgroundColor;
Expand All @@ -31,7 +31,7 @@ DemoAntialiasingAggregationPipeline::DemoAntialiasingAggregationPipeline(glopera
m_multiFramePipeline->multiFrameCount << multiFrameCount;

// Outputs
*createOutput<gloperate::ColorRenderTarget *>("ColorOut") << *m_multiFramePipeline->canvasInterface.colorRenderTargetOutput(0);
*createOutput<gloperate::ColorRenderTarget *>("ColorOut") << *m_multiFramePipeline->canvasInterface.colorRenderTargetOutputs()[0];
}

DemoAntialiasingAggregationPipeline::~DemoAntialiasingAggregationPipeline()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DemoDOFAggregationPipeline::DemoDOFAggregationPipeline(gloperate::Environment *
m_dofPipeline->multiFrameCount << multiFrameCount;

// Inputs
*m_multiFramePipeline->canvasInterface.colorRenderTargetInput(0) << *createInput<gloperate::ColorRenderTarget *>("Color");
*m_multiFramePipeline->canvasInterface.colorRenderTargetInputs()[0] << *createInput<gloperate::ColorRenderTarget *>("Color");

m_multiFramePipeline->canvasInterface.viewport << canvasInterface.viewport;
m_multiFramePipeline->canvasInterface.backgroundColor << canvasInterface.backgroundColor;
Expand All @@ -31,7 +31,7 @@ DemoDOFAggregationPipeline::DemoDOFAggregationPipeline(gloperate::Environment *
m_multiFramePipeline->multiFrameCount << multiFrameCount;

// Outputs
*createOutput<gloperate::ColorRenderTarget *>("ColorOut") << *m_multiFramePipeline->canvasInterface.colorRenderTargetOutput(0);
*createOutput<gloperate::ColorRenderTarget *>("ColorOut") << *m_multiFramePipeline->canvasInterface.colorRenderTargetOutputs()[0];
}

DemoDOFAggregationPipeline::~DemoDOFAggregationPipeline()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DemoMultiFrameAggregationPipeline::DemoMultiFrameAggregationPipeline(gloperate::
m_renderingPipeline->multiFrameCount << multiFrameCount;

// Inputs
*m_multiFramePipeline->canvasInterface.colorRenderTargetInput(0) << *createInput<gloperate::ColorRenderTarget *>("Color");
*m_multiFramePipeline->canvasInterface.colorRenderTargetInputs()[0] << *createInput<gloperate::ColorRenderTarget *>("Color");

m_multiFramePipeline->canvasInterface.viewport << canvasInterface.viewport;
m_multiFramePipeline->canvasInterface.backgroundColor << canvasInterface.backgroundColor;
Expand All @@ -31,7 +31,7 @@ DemoMultiFrameAggregationPipeline::DemoMultiFrameAggregationPipeline(gloperate::
m_multiFramePipeline->multiFrameCount << multiFrameCount;

// Outputs
*createOutput<gloperate::ColorRenderTarget *>("ColorOut") << *m_multiFramePipeline->canvasInterface.colorRenderTargetOutput(0);
*createOutput<gloperate::ColorRenderTarget *>("ColorOut") << *m_multiFramePipeline->canvasInterface.colorRenderTargetOutputs()[0];
}

DemoMultiFrameAggregationPipeline::~DemoMultiFrameAggregationPipeline()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DemoSSAOAggregationPipeline::DemoSSAOAggregationPipeline(gloperate::Environment
//m_ssaoPipeline->multiFrameCount << multiFrameCount;

// Inputs
*m_multiFramePipeline->canvasInterface.colorRenderTargetInput(0) << *createInput<gloperate::ColorRenderTarget *>("Color");
*m_multiFramePipeline->canvasInterface.colorRenderTargetInputs()[0] << *createInput<gloperate::ColorRenderTarget *>("Color");

m_multiFramePipeline->canvasInterface.viewport << canvasInterface.viewport;
m_multiFramePipeline->canvasInterface.backgroundColor << canvasInterface.backgroundColor;
Expand All @@ -31,7 +31,7 @@ DemoSSAOAggregationPipeline::DemoSSAOAggregationPipeline(gloperate::Environment
m_multiFramePipeline->multiFrameCount << multiFrameCount;

// Outputs
*createOutput<gloperate::ColorRenderTarget *>("ColorOut") << *m_multiFramePipeline->canvasInterface.colorRenderTargetOutput(0);
*createOutput<gloperate::ColorRenderTarget *>("ColorOut") << *m_multiFramePipeline->canvasInterface.colorRenderTargetOutputs()[0];
}

DemoSSAOAggregationPipeline::~DemoSSAOAggregationPipeline()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ DemoTransparencyAggregationPipeline::DemoTransparencyAggregationPipeline(glopera
//m_transparencyPipeline->multiFrameCount << multiFrameCount;

// Inputs
// Inputs
*m_multiFramePipeline->canvasInterface.colorRenderTargetInput(0) << *createInput<gloperate::ColorRenderTarget *>("Color");
*m_multiFramePipeline->canvasInterface.colorRenderTargetInputs()[0] << *createInput<gloperate::ColorRenderTarget *>("Color");

m_multiFramePipeline->canvasInterface.viewport << canvasInterface.viewport;
m_multiFramePipeline->canvasInterface.backgroundColor << canvasInterface.backgroundColor;
Expand All @@ -32,7 +31,7 @@ DemoTransparencyAggregationPipeline::DemoTransparencyAggregationPipeline(glopera
m_multiFramePipeline->multiFrameCount << multiFrameCount;

// Outputs
*createOutput<gloperate::ColorRenderTarget *>("ColorOut") << *m_multiFramePipeline->canvasInterface.colorRenderTargetOutput(0);
*createOutput<gloperate::ColorRenderTarget *>("ColorOut") << *m_multiFramePipeline->canvasInterface.colorRenderTargetOutputs()[0];
}

DemoTransparencyAggregationPipeline::~DemoTransparencyAggregationPipeline()
Expand Down
9 changes: 5 additions & 4 deletions source/examples/demo-stages-plugins/ShapeDemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,13 @@ ShapeDemo::ShapeDemo(Environment * environment, const std::string & name)

auto shapeColorOutput = m_shapeRasterization->createOutput<gloperate::ColorRenderTarget *>("ColorAttachmentOut");

/* Hack Start */
// [TODO] Remove hack!
// Hack Start
shapeColorOutput->valueInvalidated.onFire([=]() {
m_clear->renderInterface.colorRenderTargetOutput(0)->invalidate();
m_clear->renderInterface.depthRenderTargetOutput(0)->invalidate();
m_clear->renderInterface.colorRenderTargetOutputs()[0]->invalidate();
m_clear->renderInterface.depthRenderTargetOutputs()[0]->invalidate();
});
/* Hack End */
// Hack End

addStage(m_textureExtractionStage.get());
m_textureExtractionStage->colorRenderTarget << *shapeColorOutput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void IntermediateFramePreparationStage::onContextDeinit(gloperate::AbstractGLCon

void IntermediateFramePreparationStage::onProcess()
{
if (!renderInterface.allRenderTargetsCompatible())
if (!renderInterface.renderTargetsAreCompatible())
{
cppassist::warning("gloperate") << "Framebuffer configuration not compatible";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ MultiFrameAggregationPipeline::MultiFrameAggregationPipeline(gloperate::Environm
m_framePreparationStage->intermediateFrameTexture << m_colorRenderTargetStage->texture;

addStage(m_aggregationStage.get());
(*m_aggregationStage->createInput<gloperate::ColorRenderTarget *>("ColorTarget")) << (*canvasInterface.colorRenderTargetInput(0));
(*canvasInterface.colorRenderTargetOutput(0)) << (*m_aggregationStage->createOutput<gloperate::ColorRenderTarget *>("ColorTargetOut"));
(*m_aggregationStage->createInput<gloperate::ColorRenderTarget *>("ColorTarget")) << (*canvasInterface.colorRenderTargetInputs()[0]);
(*canvasInterface.colorRenderTargetOutputs()[0]) << (*m_aggregationStage->createOutput<gloperate::ColorRenderTarget *>("ColorTargetOut"));
m_aggregationStage->intermediateFrame << m_framePreparationStage->intermediateFrameTextureOut; // set by setRenderStage
m_aggregationStage->renderInterface.viewport << canvasInterface.viewport;
m_aggregationStage->aggregationFactor << m_controlStage->aggregationFactor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void MultiFrameAggregationStage::onContextDeinit(gloperate::AbstractGLContext *

void MultiFrameAggregationStage::onProcess()
{
if (!renderInterface.allRenderTargetsCompatible())
if (!renderInterface.renderTargetsAreCompatible())
{
cppassist::warning("gloperate") << "Framebuffer configuration not compatible";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class GLOPERATE_API AbstractRenderTarget
* @return
* The attachment type
*/
virtual AttachmentType underlyingAttachmentType() const = 0;
virtual AttachmentType attachmentType() const = 0;

/**
* @brief
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class GLOPERATE_API ColorRenderTarget : public AbstractRenderTarget
// Virtual AbstractRenderTarget interface
virtual gl::GLint clearBufferDrawBuffer(size_t index) const override;
virtual gl::GLenum drawBufferAttachment(size_t index) const override;
virtual AttachmentType underlyingAttachmentType() const override;
virtual AttachmentType attachmentType() const override;
virtual gl::GLenum attachmentGLType() const override;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class GLOPERATE_API DepthRenderTarget : public AbstractRenderTarget
// Virtual AbstractRenderTarget interface
virtual gl::GLint clearBufferDrawBuffer(size_t index) const override;
virtual gl::GLenum drawBufferAttachment(size_t index) const override;
virtual AttachmentType underlyingAttachmentType() const override;
virtual AttachmentType attachmentType() const override;
virtual gl::GLenum attachmentGLType() const override;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class GLOPERATE_API DepthStencilRenderTarget : public AbstractRenderTarget
// Virtual AbstractRenderTarget interface
virtual gl::GLint clearBufferDrawBuffer(size_t index) const override;
virtual gl::GLenum drawBufferAttachment(size_t index) const override;
virtual AttachmentType underlyingAttachmentType() const override;
virtual AttachmentType attachmentType() const override;
virtual gl::GLenum attachmentGLType() const override;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace gloperate

/**
* @brief
* Type of a render target
* Technical type of a render target
*/
enum class RenderTargetType : unsigned int
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GLOPERATE_API StencilRenderTarget : public AbstractRenderTarget
// Virtual AbstractRenderTarget interface
virtual gl::GLint clearBufferDrawBuffer(size_t index) const override;
virtual gl::GLenum drawBufferAttachment(size_t index) const override;
virtual AttachmentType underlyingAttachmentType() const override;
virtual AttachmentType attachmentType() const override;
virtual gl::GLenum attachmentGLType() const override;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ class GLOPERATE_API CanvasInterface : public RenderInterface
{
public:
// Inputs
Input<Color> backgroundColor; ///< Background color (RGBA)
Input<int> frameCounter; ///< Frame counter (number of frames)
Input<float> timeDelta; ///< Time delta since last frame (in seconds)
Input<Color> backgroundColor; ///< Background color (RGBA)
Input<int> frameCounter; ///< Frame counter (number of frames)
Input<float> timeDelta; ///< Time delta since last frame (in seconds)


public:
/**
Expand Down
Loading