diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/deferred-renderer-cpp/gbuffer.cpp | 5 | ||||
-rw-r--r-- | examples/deferred-renderer-qml/GBuffer.qml | 32 | ||||
-rw-r--r-- | examples/playground-qml/main.qml | 11 | ||||
-rw-r--r-- | examples/shadow-map-qml/AdsEffect.qml | 2 | ||||
-rw-r--r-- | examples/shadow-map-qml/ShadowMapFrameGraph.qml | 10 |
5 files changed, 35 insertions, 25 deletions
diff --git a/examples/deferred-renderer-cpp/gbuffer.cpp b/examples/deferred-renderer-cpp/gbuffer.cpp index 7ecaedd07..4ed1a627f 100644 --- a/examples/deferred-renderer-cpp/gbuffer.cpp +++ b/examples/deferred-renderer-cpp/gbuffer.cpp @@ -68,13 +68,12 @@ GBuffer::GBuffer(Qt3D::QNode *parent) for (int i = 0; i < AttachmentsCount; i++) { Qt3D::QRenderAttachment *attachment = new Qt3D::QRenderAttachment(this); - m_textures[i] = new Qt3D::QTexture(); - m_textures[i]->setTarget(Qt3D::QTexture::Target2D); + m_textures[i] = new Qt3D::QTexture(Qt3D::QTexture::Target2D); m_textures[i]->setFormat(formats[i]); m_textures[i]->setWidth(1024); m_textures[i]->setHeight(1024); m_textures[i]->setGenerateMipMaps(false); - m_textures[i]->setWrapMode(Qt3D::QTexture::ClampToEdge); + m_textures[i]->setWrapMode(Qt3D::QTextureWrapMode(Qt3D::QTextureWrapMode::ClampToEdge)); m_textures[i]->setMinificationFilter(Qt3D::QTexture::Linear); m_textures[i]->setMagnificationFilter(Qt3D::QTexture::Linear); diff --git a/examples/deferred-renderer-qml/GBuffer.qml b/examples/deferred-renderer-qml/GBuffer.qml index 1384485fd..5d90208e7 100644 --- a/examples/deferred-renderer-qml/GBuffer.qml +++ b/examples/deferred-renderer-qml/GBuffer.qml @@ -54,24 +54,25 @@ RenderTarget { RenderAttachment { name : "color" type : RenderAttachment.ColorAttachment0 - texture : Texture { + texture : Texture2D { id : colorAttachment - target : Texture.Target2D width : 1024 height : 1024 format : Texture.RGBA32F generateMipMaps : false magnificationFilter : Texture.Linear minificationFilter : Texture.Linear - wrapMode : Texture.ClampToEdge + wrapMode { + x: WrapMode.ClampToEdge + y: WrapMode.ClampToEdge + } } }, RenderAttachment { name : "position" type : RenderAttachment.ColorAttachment1 - texture : Texture { + texture : Texture2D { id : positionAttachment - target : Texture.Target2D width : 1024 height : 1024 // This texture format may not be supported by @@ -80,15 +81,17 @@ RenderTarget { generateMipMaps : false magnificationFilter : Texture.Linear minificationFilter : Texture.Linear - wrapMode : Texture.ClampToEdge + wrapMode { + x: WrapMode.ClampToEdge + y: WrapMode.ClampToEdge + } } }, RenderAttachment { name : "normal" type : RenderAttachment.ColorAttachment2 - texture : Texture { + texture : Texture2D { id : normalAttachment - target : Texture.Target2D width : 1024 height : 1024 // This texture format may not be supported by @@ -97,22 +100,27 @@ RenderTarget { generateMipMaps : false magnificationFilter : Texture.Linear minificationFilter : Texture.Linear - wrapMode : Texture.ClampToEdge + wrapMode { + x: WrapMode.ClampToEdge + y: WrapMode.ClampToEdge + } } }, RenderAttachment { name : "depth" type : RenderAttachment.DepthAttachment - texture : Texture { + texture : Texture2D { id : depthAttachment - target : Texture.Target2D width : 1024 height : 1024 format : Texture.D32F generateMipMaps : false magnificationFilter : Texture.Linear minificationFilter : Texture.Linear - wrapMode : Texture.ClampToEdge + wrapMode { + x: WrapMode.ClampToEdge + y: WrapMode.ClampToEdge + } } } ] // attachments diff --git a/examples/playground-qml/main.qml b/examples/playground-qml/main.qml index e56ca0f80..23312f732 100644 --- a/examples/playground-qml/main.qml +++ b/examples/playground-qml/main.qml @@ -117,17 +117,18 @@ Entity { } } - Texture - { + Texture2D { id : colorAttachment - target : Texture.Target2D width : 512 height : 512 format : Texture.RGBA32F generateMipMaps : false magnificationFilter : Texture.Linear minificationFilter : Texture.Linear - wrapMode : Texture.ClampToEdge + wrapMode { + x: WrapMode.ClampToEdge + y: WrapMode.ClampToEdge + } } components: [external_forward_renderer] @@ -249,7 +250,7 @@ Entity { Material { id : ballTexturedMaterial - parameters : [Parameter { name : "tex"; value : Texture { source : "assets/gltf/wine/Wood_Cherry_Original_.jpg" } }, + parameters : [Parameter { name : "tex"; value : Texture2D { source : "assets/gltf/wine/Wood_Cherry_Original_.jpg" } }, Parameter { name : "gBuffer"; value : colorAttachment } ] diff --git a/examples/shadow-map-qml/AdsEffect.qml b/examples/shadow-map-qml/AdsEffect.qml index 342deafe4..88d38294d 100644 --- a/examples/shadow-map-qml/AdsEffect.qml +++ b/examples/shadow-map-qml/AdsEffect.qml @@ -52,7 +52,7 @@ import QtQuick 2.1 Effect { id: root - property Texture shadowTexture + property Texture2D shadowTexture property Light light // These parameters act as default values for the effect. They take diff --git a/examples/shadow-map-qml/ShadowMapFrameGraph.qml b/examples/shadow-map-qml/ShadowMapFrameGraph.qml index 592412bc1..04cc97cbe 100644 --- a/examples/shadow-map-qml/ShadowMapFrameGraph.qml +++ b/examples/shadow-map-qml/ShadowMapFrameGraph.qml @@ -55,7 +55,7 @@ FrameGraph { property alias viewCamera: viewCameraSelector.camera property alias lightCamera: lightCameraSelector.camera - readonly property Texture shadowTexture: depthTexture + readonly property Texture2D shadowTexture: depthTexture activeFrameGraph: Viewport { rect: Qt.rect(0.0, 0.0, 1.0, 1.0) @@ -70,16 +70,18 @@ FrameGraph { RenderAttachment { name: "depth" type: RenderAttachment.DepthAttachment - texture: Texture { + texture: Texture2D { id: depthTexture - target: Texture.Target2D width: 1024 height: 1024 format: Texture.D32 generateMipMaps: false magnificationFilter: Texture.Nearest minificationFilter: Texture.Nearest - wrapMode: Texture.ClampToEdge + wrapMode { + x: WrapMode.ClampToEdge + y: WrapMode.ClampToEdge + } } } ] |