diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-12-06 14:35:56 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-01-12 11:55:34 +0000 |
commit | 9ce6712c981c312f5c417c58b0d578d872af428a (patch) | |
tree | 601e84ae117f9f45acfe1b51d2bd9f0dcbb18cbd /src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | |
parent | 1cead4f316184489ff81e689611b91d3760ee5cf (diff) |
Fix projection matrix for DepthAware QSGRenderNodes
Unlike renderUnmergedBatches(), renderRenderNode() did not adjust the
projection matrix.
Change-Id: Ib5a7183a3623d35c85af47205cc22187bad89409
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 8d4c313056..d4324bc489 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -2803,8 +2803,13 @@ void Renderer::renderRenderNode(Batch *batch) updateClip(rd->m_clip_list, batch); - RenderNodeState state; QMatrix4x4 pm = projectionMatrix(); + if (m_useDepthBuffer) { + pm(2, 2) = m_zRange; + pm(2, 3) = 1.0f - e->order * m_zRange; + } + + RenderNodeState state; state.m_projectionMatrix = ± state.m_scissorEnabled = m_currentClipType & ScissorClip; state.m_stencilEnabled = m_currentClipType & StencilClip; |