Texture QML Type

Defines a texture for use in 3D scenes. More...

Import Statement: import QtQuick3D 1.0
Inherits:

Object3D

Properties

Detailed Description

Texture defines an image and related settings, such as the minification and magnification filters, scaling, and UV transformations.

Texture objects can source image data from:

Property Documentation

flipV : bool

This property sets the use of the vertically flipped coordinates.


generateMipmaps : bool

This property determines if mipmaps are generated for textures that do not provide mipmap levels themselves. Using mipmaps along with mip filtering gives better visual quality when viewing textures at a distance compared rendering without them, but it may come at a performance cost (both when initializing the image and during rendering).

By default, this property is set to false.

Note: It is necessary to set a QQuick3D::Texture::mipFilter mode for the generated mipmaps to be be used.

See also mipFilter.


indexUV : int

This property sets the UV coordinate index used by this texture. Since QtQuick3D supports 2 UV sets(0 or 1) for now, the value will be saturated to the range.


magFilter : enumeration

This property determines how the texture is sampled when a texel covers more than one pixel.

The default value is Texture.Linear

ConstantDescription
Texture.Nonedefaults to Texture.Linear since it is not possible to disable
Texture.Nearestuses the value of the closest texel
Texture.Lineartakes the four closest texels and bilinearly interpolates them.

Note: Using Texture.None is not possible and will default to Texture.Linear

See also minFilter and mipFilter.


mappingMode : enumeration

This property defines which method of mapping to use when sampling this texture.

ConstantDescription
Texture.UVThe default for diffuse and opacity maps, this causes the image to be stuck to the mesh. The same portion of the image will always appear on the same vertex (unless the UV properties are animated).
Texture.EnvironmentThe default for specular reflection, this causes the image to be ‘projected’ onto the material as though it is being reflected. Using Environmental Mapping for diffuse maps provides a mirror effect.
Texture.LightProbeThe default for HDRI sphere maps used by light probes. Normally this does not need to be set when using a light probe, but may need to be set explicitly when using environment maps.

minFilter : enumeration

This property determines how the texture is sampled when a texel covers more than one pixel.

The default value is Texture.Linear

ConstantDescription
Texture.Nearestuses the value of the closest texel
Texture.Lineartakes the four closest texels and bilinearly interpolates them.

Note: Using Texture.None is not possible and will default to Texture.Linear

See also magFilter and mipFilter.


mipFilter : enumeration

This property determines how the texture mipmaps are sampled when a texel covers less than one pixel.

The default value is Texture.None

ConstantDescription
Texture.Nonedisables the usage of mipmap sampling
Texture.Nearestuses mipmapping and samples the value of the closest texel
Texture.Linearuses mipmapping and interpolates between multiple texel values.

Note: This property will have no effect on Textures that do not have mipmaps.

See also minFilter and magFilter.


pivotU : float

This property sets the pivot U position.

See also rotationUV.


pivotV : float

This property sets the pivot V position.

See also rotationUV.


positionU : float

This property offsets the U coordinate mapping from left to right.


positionV : float

This property offsets the V coordinate mapping from bottom to top.

Note: Qt Quick 3D uses OpenGL-style vertex data, regardless of the graphics API used at run time. The UV position (0, 0) is therefore referring to the bottom-left corner of the image data.


rotationUV : float

This property rotates the texture around the pivot point. This is defined using euler angles and for a positve value rotation is clockwise.

See also pivotU and pivotV.


scaleU : float

This property defines how to scale the U texture coordinate when mapping to a mesh's UV coordinates.

Scaling the U value when using horizontal tiling will define how many times the texture is repeated from left to right.

See also tilingModeHorizontal.


scaleV : float

This property defines how to scale the V texture coordinate when mapping to a mesh's UV coordinates.

Scaling the V value when using vertical tiling will define how many times a texture is repeated from bottom to top.

See also tilingModeVertical.


source : url

This property holds the location of an image file containing the data used by the texture.

The property is a URL, with the same rules as other source properties, such as Image.source. With Texture, only the qrc and file schemes are supported. When no scheme is present and the value is a relative path, it is assumed to be relative to the component's (i.e. the .qml file's) location.

A Texture should use one method to provide image data, and set only one of source, sourceItem, or textureData.

See also sourceItem and textureData.


sourceItem : Item

This property defines a Item to be used as the source of the texture. Using this property allows any 2D Qt Quick content to be used as a texture source by rendering that item as an offscreen layer.

If the item is a texture provider, no additional texture is used.

If this property is set, then the value of source will be ignored. A Texture should use one method to provide image data, and set only one of source, sourceItem, or textureData.

Note: Currently there is no way to forward input events to the Item used as a texture source.

See also source and textureData.


textureData : TextureData

This property holds a reference to a TextureData component which defines the contents and properties of raw texture data.

If this property is used, then the value of source will be ignored. A Texture should use one method to provide image data, and set only one of source, sourceItem, or textureData.

See also source and sourceItem.


tilingModeHorizontal : enumeration

Controls how the texture is mapped when the U scaling value is greater than 1.

By default, this property is set to Texture.Repeat

ConstantDescription
Texture.ClampToEdgeTexture is not tiled, but the value on the edge is used instead.
Texture.MirroredRepeatTexture is repeated and mirrored over the X axis.
Texture.RepeatTexture is repeated over the X axis.

See also scaleU.


tilingModeVertical : enumeration

This property controls how the texture is mapped when the V scaling value is greater than 1.

By default, this property is set to Texture.Repeat

ConstantDescription
Texture.ClampToEdgeTexture is not tiled, but the value on the edge is used instead.
Texture.MirroredRepeatTexture is repeated and mirrored over the Y axis.
Texture.RepeatTexture is repeated over the Y axis.

See also scaleV.