diff options
author | Wieland Hagen <wieland.hagen@kdab.com> | 2016-02-26 18:21:20 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-03-09 13:19:47 +0000 |
commit | a5ee671f47464cc687fab86b868dfc8197e3a3fd (patch) | |
tree | 9b32fe4521ed8fa2436e6b3aeb132801bdb7af84 /examples/qt3d/shadow-map-qml | |
parent | f34ec1fff6c2c62864a86c346e1ecd1364c83293 (diff) |
Some fixes for examples.
Mostly insertion of RenderSurfaceSelector, FrameGraph->RendererSettings,
remove parameter bindings
Change-Id: I182092d43b0842da07e995387c0fe174d45345df
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/qt3d/shadow-map-qml')
-rw-r--r-- | examples/qt3d/shadow-map-qml/AdsEffect.qml | 17 | ||||
-rw-r--r-- | examples/qt3d/shadow-map-qml/ShadowMapFrameGraph.qml | 74 | ||||
-rw-r--r-- | examples/qt3d/shadow-map-qml/doc/src/shadow-map-qml.qdoc | 2 |
3 files changed, 39 insertions, 54 deletions
diff --git a/examples/qt3d/shadow-map-qml/AdsEffect.qml b/examples/qt3d/shadow-map-qml/AdsEffect.qml index 4f6910f63..01ca38639 100644 --- a/examples/qt3d/shadow-map-qml/AdsEffect.qml +++ b/examples/qt3d/shadow-map-qml/AdsEffect.qml @@ -100,17 +100,6 @@ Effect { RenderPass { annotations: [ Annotation { name : "pass"; value : "forward" } ] - // The bindings property allows us to map from names of parameters (uniforms or vertex attributes) - // within a shader to more friendly names in QML. By default the parameter names are exposed from - // the shader so we only need to add add mappings where the names differ. E.g. here we map from the - // ka uniform name in the shader to a property called ambient - bindings: [ - // Uniforms (those provided by the user) - ParameterMapping { parameterName: "ambient"; shaderVariableName: "ka"; bindingType: ParameterMapping.Uniform }, - ParameterMapping { parameterName: "diffuse"; shaderVariableName: "kd"; bindingType: ParameterMapping.Uniform }, - ParameterMapping { parameterName: "specular"; shaderVariableName: "ks"; bindingType: ParameterMapping.Uniform } - ] - shaderProgram: ShaderProgram { vertexShaderCode: loadSource("qrc:/shaders/ads.vert") fragmentShaderCode: loadSource("qrc:/shaders/ads.frag") @@ -145,12 +134,6 @@ Effect { RenderPass { annotations: [ Annotation { name : "pass"; value : "forward" } ] - bindings: [ - ParameterMapping { parameterName: "ambient"; shaderVariableName: "ka"; bindingType: ParameterMapping.Uniform }, - ParameterMapping { parameterName: "diffuse"; shaderVariableName: "kd"; bindingType: ParameterMapping.Uniform }, - ParameterMapping { parameterName: "specular"; shaderVariableName: "ks"; bindingType: ParameterMapping.Uniform } - ] - shaderProgram: ShaderProgram { vertexShaderCode: loadSource("qrc:/shaders/es3/ads.vert") fragmentShaderCode: loadSource("qrc:/shaders/es3/ads.frag") diff --git a/examples/qt3d/shadow-map-qml/ShadowMapFrameGraph.qml b/examples/qt3d/shadow-map-qml/ShadowMapFrameGraph.qml index 7183b4e3b..956f19ef6 100644 --- a/examples/qt3d/shadow-map-qml/ShadowMapFrameGraph.qml +++ b/examples/qt3d/shadow-map-qml/ShadowMapFrameGraph.qml @@ -52,7 +52,7 @@ import QtQuick 2.2 as QQ2 import Qt3D.Core 2.0 import Qt3D.Render 2.0 -FrameGraph { +RenderSettings { id: root property alias viewCamera: viewCameraSelector.camera @@ -63,52 +63,54 @@ FrameGraph { normalizedRect: Qt.rect(0.0, 0.0, 1.0, 1.0) clearColor: Qt.rgba(0.0, 0.4, 0.7, 1.0) - RenderPassFilter { - includes: [ Annotation { name: "pass"; value: "shadowmap" } ] + RenderSurfaceSelector { + RenderPassFilter { + includes: [ Annotation { name: "pass"; value: "shadowmap" } ] - RenderTargetSelector { - target: RenderTarget { - outputs: [ - RenderTargetOutput { - objectName: "depth" - attachmentPoint: RenderTargetOutput.Depth - texture: Texture2D { - id: depthTexture - width: 1024 - height: 1024 - format: Texture.DepthFormat - generateMipMaps: false - magnificationFilter: Texture.Linear - minificationFilter: Texture.Linear - wrapMode { - x: WrapMode.ClampToEdge - y: WrapMode.ClampToEdge + RenderTargetSelector { + target: RenderTarget { + outputs: [ + RenderTargetOutput { + objectName: "depth" + attachmentPoint: RenderTargetOutput.Depth + texture: Texture2D { + id: depthTexture + width: 1024 + height: 1024 + format: Texture.DepthFormat + generateMipMaps: false + magnificationFilter: Texture.Linear + minificationFilter: Texture.Linear + wrapMode { + x: WrapMode.ClampToEdge + y: WrapMode.ClampToEdge + } + comparisonFunction: Texture.CompareLessEqual + comparisonMode: Texture.CompareRefToTexture } - comparisonFunction: Texture.CompareLessEqual - comparisonMode: Texture.CompareRefToTexture } - } - ] - } + ] + } - ClearBuffer { - buffers: ClearBuffer.DepthBuffer + ClearBuffer { + buffers: ClearBuffer.DepthBuffer - CameraSelector { - id: lightCameraSelector + CameraSelector { + id: lightCameraSelector + } } } } - } - RenderPassFilter { - includes: [ Annotation { name: "pass"; value: "forward" } ] + RenderPassFilter { + includes: [ Annotation { name: "pass"; value: "forward" } ] - ClearBuffer { - buffers: ClearBuffer.ColorDepthBuffer + ClearBuffer { + buffers: ClearBuffer.ColorDepthBuffer - CameraSelector { - id: viewCameraSelector + CameraSelector { + id: viewCameraSelector + } } } } diff --git a/examples/qt3d/shadow-map-qml/doc/src/shadow-map-qml.qdoc b/examples/qt3d/shadow-map-qml/doc/src/shadow-map-qml.qdoc index d9076e0f0..df0966b24 100644 --- a/examples/qt3d/shadow-map-qml/doc/src/shadow-map-qml.qdoc +++ b/examples/qt3d/shadow-map-qml/doc/src/shadow-map-qml.qdoc @@ -121,7 +121,7 @@ \skipto import QtQuick \printuntil Render 2.0 - The code defines a \l FrameGraph entity that has a tree of entities as the + The code defines a \l RendererSettings entity that has a tree of entities as the active framegraph: \printuntil clearColor |