Permalink
Browse files

qmlui: 3D code cleanup

In RenderShadowMapFilter, inverted LayerFilter with CameraSelector
  • Loading branch information...
mcallegari committed Nov 27, 2018
1 parent 79b5d57 commit f8c8bbbcdedc02401daea90f3db14858bec28aa9
Showing with 134 additions and 190 deletions.
  1. +1 −9 qmlui/mainview3d.cpp
  2. +0 −1 qmlui/mainview3d.h
  3. +0 −1 qmlui/qml/CustomComboBox.qml
  4. +33 −33 qmlui/qml/fixturesfunctions/3DView/3DView.qml
  5. +2 −2 qmlui/qml/fixturesfunctions/3DView/BlitEffect.qml
  6. +0 −2 qmlui/qml/fixturesfunctions/3DView/BlitFilter.qml
  7. +18 −22 qmlui/qml/fixturesfunctions/3DView/DepthTarget.qml
  8. +0 −4 qmlui/qml/fixturesfunctions/3DView/DirectionalLightFilter.qml
  9. +3 −4 qmlui/qml/fixturesfunctions/3DView/DownsampleEffect.qml
  10. +2 −5 qmlui/qml/fixturesfunctions/3DView/DownsampleFilter.qml
  11. +3 −3 qmlui/qml/fixturesfunctions/3DView/FXAAEffect.qml
  12. +3 −4 qmlui/qml/fixturesfunctions/3DView/FXAAFilter.qml
  13. +2 −6 qmlui/qml/fixturesfunctions/3DView/FillGBufferFilter.qml
  14. +2 −6 qmlui/qml/fixturesfunctions/3DView/GBuffer.qml
  15. +3 −4 qmlui/qml/fixturesfunctions/3DView/GammaCorrectEffect.qml
  16. +4 −8 qmlui/qml/fixturesfunctions/3DView/GammaCorrectFilter.qml
  17. +1 −2 qmlui/qml/fixturesfunctions/3DView/GenericScreenQuadEntity.qml
  18. +2 −4 qmlui/qml/fixturesfunctions/3DView/GeometryPassEffect.qml
  19. +3 −4 qmlui/qml/fixturesfunctions/3DView/GrabBrightEffect.qml
  20. +6 −6 qmlui/qml/fixturesfunctions/3DView/GrabBrightFilter.qml
  21. +1 −1 qmlui/qml/fixturesfunctions/3DView/LightEntity.qml
  22. +2 −3 qmlui/qml/fixturesfunctions/3DView/LightPassEffect.qml
  23. +2 −3 qmlui/qml/fixturesfunctions/3DView/OutputFrontDepthEffect.qml
  24. +10 −10 qmlui/qml/fixturesfunctions/3DView/OutputFrontDepthFilter.qml
  25. +1 −5 qmlui/qml/fixturesfunctions/3DView/RenderSelectionBoxesFilter.qml
  26. +6 −11 qmlui/qml/fixturesfunctions/3DView/RenderShadowMapFilter.qml
  27. +0 −1 qmlui/qml/fixturesfunctions/3DView/ScreenQuadEntity.qml
  28. +1 −2 qmlui/qml/fixturesfunctions/3DView/ScreenQuadGammaCorrectEntity.qml
  29. +2 −3 qmlui/qml/fixturesfunctions/3DView/SpotlightScatteringEffect.qml
  30. +6 −5 qmlui/qml/fixturesfunctions/3DView/SpotlightScatteringFilter.qml
  31. +2 −3 qmlui/qml/fixturesfunctions/3DView/SpotlightShadingEffect.qml
  32. +6 −4 qmlui/qml/fixturesfunctions/3DView/SpotlightShadingFilter.qml
  33. +2 −3 qmlui/qml/fixturesfunctions/3DView/UpsampleEffect.qml
  34. +5 −6 qmlui/qml/fixturesfunctions/3DView/UpsampleFilter.qml
@@ -64,7 +64,6 @@ MainView3D::MainView3D(QQuickView *view, Doc *doc, QObject *parent)
, m_sceneRootEntity(nullptr)
, m_quadEntity(nullptr)
, m_gBuffer(nullptr)
, m_frontDepthTarget(nullptr)
, m_latestGenericID(0)
, m_renderQuality(HighQuality)
, m_stageEntity(nullptr)
@@ -357,17 +356,10 @@ void MainView3D::initialize3DProperties()
return;
}
m_frontDepthTarget = m_scene3D->findChild<QRenderTarget *>("depthTarget");
if (m_frontDepthTarget == nullptr)
{
qDebug() << "frontDepth not found!";
return;
}
if (m_frameAction)
m_sceneRootEntity->addComponent(m_frameAction);
qDebug() << m_sceneRootEntity << m_quadEntity << m_gBuffer << m_frontDepthTarget;
qDebug() << m_sceneRootEntity << m_quadEntity << m_gBuffer;
if (m_stageEntity == nullptr)
createStage();
@@ -260,7 +260,6 @@ protected slots:
/** Reference to the render targets used for scattering */
QRenderTarget *m_gBuffer;
QRenderTarget *m_frontDepthTarget;
/** Map of QLC+ item IDs and SceneItem references */
QMap<quint32, SceneItem*> m_entitiesMap;
@@ -64,7 +64,6 @@ ComboBox
if (item.mIcon)
currentIcon = item.mIcon
currentIndex = i
console.log("Label: " + displayText)
return
}
}
@@ -2,7 +2,7 @@
Q Light Controller Plus
3DView.qml
Copyright (c) Massimo Callegari
Copyright (c) Massimo Callegari, Eric Arnebäck
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -115,8 +115,8 @@ Rectangle
sgNode = component.createObject(frameGraph.myShadowFrameGraphNode,
{
"sceneDeferredLayer": sceneEntity.deferredLayer,
"fixtureItem": headEntity
"fixtureItem": headEntity,
"layers": sceneEntity.deferredLayer
});
}
}
@@ -129,7 +129,7 @@ Rectangle
sgNode = component.createObject(frameGraph.myCameraSelector,
{
"gBuffer": gBufferTarget,
"sceneDeferredLayer": sceneEntity.deferredLayer,
"layers": sceneEntity.deferredLayer,
});
component = Qt.createComponent("RenderSelectionBoxesFilter.qml");
@@ -139,7 +139,7 @@ Rectangle
sgNode = component.createObject(frameGraph.myCameraSelector,
{
"gBuffer": gBufferTarget,
"layer": sceneEntity.selectionLayer,
"layers": sceneEntity.selectionLayer,
});
var texChainTargets = [texChainTarget0, texChainTarget1, texChainTarget2, texChainTarget3, texChainTarget4]
@@ -343,92 +343,92 @@ Rectangle
GenericScreenQuadEntity
{
id: screenQuadFXAAEntity
quadLayer : Layer { }
quadEffect : FXAAEffect { }
quadLayer: Layer { }
quadEffect: FXAAEffect { }
}
GenericScreenQuadEntity
{
id: screenQuadBlitEntity
quadLayer : Layer { }
quadEffect : BlitEffect { }
quadLayer: Layer { }
quadEffect: BlitEffect { }
}
GenericScreenQuadEntity
{
id: screenQuadGrabBrightEntity
quadLayer : Layer { }
quadEffect : GrabBrightEffect { }
quadLayer: Layer { }
quadEffect: GrabBrightEffect { }
}
GenericScreenQuadEntity
{
id: screenQuadDownsampleEntity0
quadLayer : Layer { }
quadEffect : DownsampleEffect { }
quadLayer: Layer { }
quadEffect: DownsampleEffect { }
}
GenericScreenQuadEntity
{
id: screenQuadDownsampleEntity1
quadLayer : Layer { }
quadEffect : DownsampleEffect { }
quadLayer: Layer { }
quadEffect: DownsampleEffect { }
}
GenericScreenQuadEntity
{
id: screenQuadDownsampleEntity2
quadLayer : Layer { }
quadEffect : DownsampleEffect { }
quadLayer: Layer { }
quadEffect: DownsampleEffect { }
}
GenericScreenQuadEntity
{
id: screenQuadDownsampleEntity3
quadLayer : Layer { }
quadEffect : DownsampleEffect { }
quadLayer: Layer { }
quadEffect: DownsampleEffect { }
}
GenericScreenQuadEntity
{
id: screenQuadDownsampleEntity4
quadLayer : Layer { }
quadEffect : DownsampleEffect { }
quadLayer: Layer { }
quadEffect: DownsampleEffect { }
}
GenericScreenQuadEntity
{
id: screenQuadUpsampleEntity0
quadLayer : Layer { }
quadEffect : UpsampleEffect { }
quadLayer: Layer { }
quadEffect: UpsampleEffect { }
}
GenericScreenQuadEntity
{
id: screenQuadUpsampleEntity1
quadLayer : Layer { }
quadEffect : UpsampleEffect { }
quadLayer: Layer { }
quadEffect: UpsampleEffect { }
}
GenericScreenQuadEntity
{
id: screenQuadUpsampleEntity2
quadLayer : Layer { }
quadEffect : UpsampleEffect { }
quadLayer: Layer { }
quadEffect: UpsampleEffect { }
}
GenericScreenQuadEntity
{
id: screenQuadUpsampleEntity3
quadLayer : Layer { }
quadEffect : UpsampleEffect { }
quadLayer: Layer { }
quadEffect: UpsampleEffect { }
}
GenericScreenQuadEntity
{
id: screenQuadUpsampleEntity4
quadLayer : Layer { }
quadEffect : UpsampleEffect { }
quadLayer: Layer { }
quadEffect: UpsampleEffect { }
}
ScreenQuadEntity { id: screenQuadEntity }
@@ -643,11 +643,11 @@ Rectangle
DepthTarget { id: depthTarget }
components : [
components: [
DeferredRenderer
{
id: frameGraph
camera : sceneEntity.camera
camera: sceneEntity.camera
},
InputSettings {}
]
@@ -33,7 +33,7 @@ Effect
// Lights pass
RenderPass
{
filterKeys: FilterKey { name : "pass"; value : "blit" }
filterKeys: FilterKey { name: "pass"; value: "blit" }
shaderProgram:
ShaderProgram
{
@@ -44,4 +44,4 @@ Effect
]
}
]
}
}
@@ -25,7 +25,6 @@ import QtQuick 2.0
TechniqueFilter
{
property Layer screenQuadBlitLayer
property Texture2D inTexture
parameters: [
@@ -55,7 +54,6 @@ TechniqueFilter
matchAny: FilterKey { name: "pass"; value: "blit" }
}
}
}
}
} // TechniqueFilter
@@ -22,34 +22,30 @@ import Qt3D.Render 2.0
RenderTarget
{
property alias position: positionAttachment
objectName: "depthTarget"
property Texture2D positionTex:
Texture2D
{
width: 1024
height: 1024
// We use RGBA32F here instead of a more fitting format because
// OpenGL vendors might not support other formats
format: Texture.RGBA32F
generateMipMaps: false
magnificationFilter: Texture.Nearest
minificationFilter: Texture.Nearest
wrapMode
{
x: WrapMode.ClampToEdge
y: WrapMode.ClampToEdge
}
}
attachments: [
RenderTargetOutput
{
objectName: "position"
attachmentPoint: RenderTargetOutput.Color0
texture:
Texture2D
{
id: positionAttachment
width: 1024
height: 1024
// We use RGBA32F here instead of a more fitting format because
// OpenGL vendors might not support other formats
format: Texture.RGBA32F
generateMipMaps: false
magnificationFilter: Texture.Nearest
minificationFilter: Texture.Nearest
wrapMode
{
x: WrapMode.ClampToEdge
y: WrapMode.ClampToEdge
}
}
texture: positionTex
}
] // outputs
}
@@ -27,7 +27,6 @@ TechniqueFilter
property GBuffer gBuffer
property Layer screenQuadLayer
property real ambientIntensity: View3D.ambientIntensity
property FrameTarget frameTarget
parameters: [
@@ -52,9 +51,6 @@ TechniqueFilter
]
LayerFilter
{
//id: screenQuadLayerFilter
layers: screenQuadLayer
RenderTargetSelector {
@@ -24,16 +24,15 @@ Effect
{
techniques:
[
// OpenGL 3.1
Technique
{
graphicsApiFilter { api: GraphicsApiFilter.OpenGL; profile: GraphicsApiFilter.CoreProfile; majorVersion: 3; minorVersion: 1 }
renderPasses:
[
// Lights pass
// Downsample pass
RenderPass
{
filterKeys: FilterKey { name : "pass"; value : "downsample" }
filterKeys: FilterKey { name: "pass"; value: "downsample" }
shaderProgram:
ShaderProgram
{
@@ -44,4 +43,4 @@ Effect
]
}
]
}
}
@@ -19,16 +19,13 @@
import Qt3D.Core 2.0
import Qt3D.Render 2.0
import QtQuick 2.0
TechniqueFilter
{
property Layer screenQuadLayer
property Texture2D inTex
property RenderTarget outRenderTarget
property vector4d pixelSize: Qt.vector4d(0, 0, 0, 0)
parameters: [
@@ -51,7 +48,8 @@ TechniqueFilter
{
layers: screenQuadLayer
RenderTargetSelector {
RenderTargetSelector
{
target: outRenderTarget
ClearBuffers
@@ -62,7 +60,6 @@ TechniqueFilter
matchAny: FilterKey { name: "pass"; value: "downsample" }
}
}
}
}
}
@@ -30,10 +30,10 @@ Effect
graphicsApiFilter { api: GraphicsApiFilter.OpenGL; profile: GraphicsApiFilter.CoreProfile; majorVersion: 3; minorVersion: 1 }
renderPasses:
[
// Lights pass
// FXAA pass
RenderPass
{
filterKeys: FilterKey { name : "pass"; value : "fxaa" }
filterKeys: FilterKey { name: "pass"; value: "fxaa" }
shaderProgram:
ShaderProgram
{
@@ -44,4 +44,4 @@ Effect
]
}
]
}
}
Oops, something went wrong.

0 comments on commit f8c8bbb

Please sign in to comment.