summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Treat <adam.treat@qt.io>2018-02-22 10:57:34 -0500
committerAdam Treat <adam.treat@qt.io>2018-02-22 16:45:07 +0000
commit2b20e5e02d3266725dbbb3cb3b534d1c3658c19c (patch)
tree559b7ee9fe27205ff1276dedd0dc4107b803a170
parente813fb36e782c5e0ab7c25b9c069cee709692506 (diff)
Add a warning to texture loading mirrored property
The default behavior for texture loading of uncompressed or CPU compressed images results in a performance price at runtime. Add a warning to the documentation describing this behavior and how to avoid it. Ideally, in the future we'll have an asset conditioning pipeline that will handle this in an optimal manner for the user of the 3D framework. Change-Id: I795d011adfedcbcf8d80224a36adbf9465140066 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/render/texture/qtexture.cpp14
-rw-r--r--src/render/texture/qtextureimage.cpp14
2 files changed, 24 insertions, 4 deletions
diff --git a/src/render/texture/qtexture.cpp b/src/render/texture/qtexture.cpp
index 4254a977f..1ccf48b5d 100644
--- a/src/render/texture/qtexture.cpp
+++ b/src/render/texture/qtexture.cpp
@@ -1321,7 +1321,12 @@ void QTextureLoader::setSource(const QUrl& source)
This property specifies whether the texture should be mirrored when loaded. This
is a convenience to avoid having to manipulate images to match the origin of
the texture coordinates used by the rendering API. By default this property
- is set to true. This has no effect when using compressed texture formats.
+ is set to true. This has no effect when using GPU compressed texture formats.
+
+ \warning This property results in a performance price payed at runtime when
+ loading uncompressed or CPU compressed image formats such as PNG. To avoid this
+ performance price it is better to set this property to false and load texture
+ assets that have been pre-mirrored.
\note OpenGL specifies the origin of texture coordinates from the lower left
hand corner whereas DirectX uses the the upper left hand corner.
@@ -1337,7 +1342,12 @@ void QTextureLoader::setSource(const QUrl& source)
This property specifies whether the texture should be mirrored when loaded. This
is a convenience to avoid having to manipulate images to match the origin of
the texture coordinates used by the rendering API. By default this property
- is set to true. This has no effect when using compressed texture formats.
+ is set to true. This has no effect when using GPU compressed texture formats.
+
+ \warning This property results in a performance price payed at runtime when
+ loading uncompressed or CPU compressed image formats such as PNG. To avoid this
+ performance price it is better to set this property to false and load texture
+ assets that have been pre-mirrored.
\note OpenGL specifies the origin of texture coordinates from the lower left
hand corner whereas DirectX uses the the upper left hand corner.
diff --git a/src/render/texture/qtextureimage.cpp b/src/render/texture/qtextureimage.cpp
index 9834a4e0a..57c320a82 100644
--- a/src/render/texture/qtextureimage.cpp
+++ b/src/render/texture/qtextureimage.cpp
@@ -185,7 +185,12 @@ void QTextureImage::setSource(const QUrl &source)
This property specifies whether the image should be mirrored when loaded. This
is a convenience to avoid having to manipulate images to match the origin of
the texture coordinates used by the rendering API. By default this property
- is set to true. This has no effect when using compressed texture formats.
+ is set to true. This has no effect when using GPU compressed texture formats.
+
+ \warning This property results in a performance price payed at runtime when
+ loading uncompressed or CPU compressed image formats such as PNG. To avoid this
+ performance price it is better to set this property to false and load texture
+ assets that have been pre-mirrored.
\note OpenGL specifies the origin of texture coordinates from the lower left
hand corner whereas DirectX uses the the upper left hand corner.
@@ -201,7 +206,12 @@ void QTextureImage::setSource(const QUrl &source)
This property specifies whether the image should be mirrored when loaded. This
is a convenience to avoid having to manipulate images to match the origin of
the texture coordinates used by the rendering API. By default this property
- is set to true. This has no effect when using compressed texture formats.
+ is set to true. This has no effect when using GPU compressed texture formats.
+
+ \warning This property results in a performance price payed at runtime when
+ loading uncompressed or CPU compressed image formats such as PNG. To avoid this
+ performance price it is better to set this property to false and load texture
+ assets that have been pre-mirrored.
\note OpenGL specifies the origin of texture coordinates from the lower left
hand corner whereas DirectX uses the the upper left hand corner.