Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

ForwardRenderer: allow rendering into QRenderTarget #92

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

wheeland
Copy link

No description provided.

Copy link
Member

@mkrus mkrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A sample manual test would be great

src/core/framegraphes/forwardrenderer.cpp Outdated Show resolved Hide resolved
@wheeland wheeland force-pushed the render_into_qtexturetarget branch from ae62ecf to c6eee16 Compare March 21, 2019 09:13
@wheeland
Copy link
Author

will be used in the materials demo that I'm preparing to render ground reflections.

@wheeland wheeland force-pushed the render_into_qtexturetarget branch from c6eee16 to 40e463c Compare March 21, 2019 09:20
mkrus
mkrus previously approved these changes Mar 21, 2019
Copy link
Member

@mkrus mkrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well it builds and doesn't break the car scene or the forward renderer manual test, so gtg

Copy link
Collaborator

@lemirep lemirep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need the manual test forward_renderer to have a new tests that allows rendering into a render target, then back to the windows based on a checkbox being checked or something

@@ -189,6 +195,18 @@ using namespace Kuesa;
Holds the size of the external render target.
*/

/*!
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this indented with Ctrl+E,R in QtCreator ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied the formatting of the other property docs

*/
void ForwardRenderer::setRenderTarget(Qt3DRender::QRenderTarget *renderTarget)
{
m_renderTargetSelector->setTarget(renderTarget);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we rebuild the FrameGraph if we had previously set a window ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m_renderTargetSelector::targetChanged is connected to reconfigureFrameGraph() and handleSurfaceChange()

Copy link
Collaborator

@lemirep lemirep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also update tst_forwardRenderer to check that setRenderTarget sets and emits properly please?

tests/manual/forwardrenderer_scene/OffscreenEntity.qml Outdated Show resolved Hide resolved
Copy link
Member

@jalbamon jalbamon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK from a documentation standpoint.

else
qCWarning(kuesa) << Q_FUNC_INFO << "Unexpected surface type for surface " << surface;
if (renderTarget) {
Qt3DRender::QAbstractTexture *texture = findRenderTargetTexture(renderTarget, Qt3DRender::QRenderTargetOutput::Color0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the render target doesn't have the Color0 attachment?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the patch so that in that case it falls back to rendering to a surface (if any is given)

@wheeland wheeland force-pushed the render_into_qtexturetarget branch from c02f46d to 1b9eca9 Compare April 24, 2019 08:33
@wheeland
Copy link
Author

Added an auto test in addition the the manual test. This now tries to fall back to surface rendering and prints a warning.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants