Skip to content

Kuesa::Qt3D::GLTF2MaterialProperties

Module: Kuesa Qt 3D API

GLTF2MaterialProperties is a base class holding properties common to all glTF2 Materials. More...

#include <Kuesa/Qt3D/api/materials/gltf2materialproperties.h>

Inherits from Qt3DCore::QNode

Inherited by Kuesa::Qt3D::Iro2AlphaEquiRectProperties, Kuesa::Qt3D::Iro2AlphaSemProperties, Kuesa::Qt3D::Iro2DiffuseEquiRectProperties, Kuesa::Qt3D::Iro2DiffuseSemProperties, Kuesa::Qt3D::Iro2GlassEquiRectProperties, Kuesa::Qt3D::Iro2GlassSemProperties, Kuesa::Qt3D::Iro2MatteAlphaProperties, Kuesa::Qt3D::Iro2PlanarReflectionEquiRectProperties, Kuesa::Qt3D::Iro2PlanarReflectionSemProperties, Kuesa::Qt3D::IroDiffuseAlphaProperties, Kuesa::Qt3D::IroDiffuseHemiProperties, Kuesa::Qt3D::IroDiffuseProperties, Kuesa::Qt3D::IroGlassAddProperties, Kuesa::Qt3D::IroMatteAddProperties, Kuesa::Qt3D::IroMatteAlphaProperties, Kuesa::Qt3D::IroMatteBackgroundProperties, Kuesa::Qt3D::IroMatteMultProperties, Kuesa::Qt3D::IroMatteOpaqueProperties, Kuesa::Qt3D::IroMatteSkyboxProperties, Kuesa::Qt3D::MetallicRoughnessProperties, Kuesa::Qt3D::UnlitProperties

Public Types

Name
enum class ColorSpace { Linear, sRGB}

Public Slots

Name
void setBaseColorUsesTexCoord1(bool baseColorUsesTexCoord1)
void setBaseColorFactor(const QColor & baseColorFactor)
void setBaseColorMap(Qt3DRender::QAbstractTexture * baseColorMap)
void setAlphaCutoff(float alphaCutoff)
void setOutputColorSpace(ColorSpace colorSpace)
void setReceivesShadows(bool receivesShadows)
void setShadowMapDepthTexture(Qt3DRender::QAbstractTexture * depthTexture)
void setShadowMapCubeDepthTexture(Qt3DRender::QAbstractTexture * cubeMapDepthTexture)

Public Signals

Name
void baseColorUsesTexCoord1Changed(bool )
void baseColorFactorChanged(const QColor & baseColorFactor)
void baseColorMapChanged(Qt3DRender::QAbstractTexture * baseColorMap)
void alphaCutoffChanged(float alphaCutoff)
void receivesShadowsChanged(bool receivesShadows)
void shadowMapDepthTextureChanged(Qt3DRender::QAbstractTexture * depthTexture)
void shadowMapCubeDepthTextureChanged(Qt3DRender::QAbstractTexture * cubeMapDepthTexture)
void outputColorSpaceChanged(ColorSpace colorSpace)

Public Functions

Name
GLTF2MaterialProperties(Qt3DCore::QNode * parent =nullptr)
~GLTF2MaterialProperties()
bool isBaseColorUsingTexCoord1() const
QColor baseColorFactor() const
Qt3DRender::QAbstractTexture * baseColorMap() const
float alphaCutoff() const
ColorSpace outputColorSpace() const
void addClientMaterial(Qt3DRender::QMaterial * material)
QVector< Qt3DRender::QMaterial * > clientMaterials() const
virtual Qt3DRender::QShaderData * shaderData() const =0
bool receivesShadows() const
Qt3DRender::QAbstractTexture * shadowMapDepthTexture() const
Qt3DRender::QAbstractTexture * shadowMapCubeDepthTexture() const

Public Properties

Name
bool baseColorUsesTexCoord1
QColor baseColorFactor
Qt3DRender::QAbstractTexture * baseColorMap
float alphaCutoff
bool receivesShadows
ColorSpace outputColorSpace

Detailed Description

1
class Kuesa::Qt3D::GLTF2MaterialProperties;

GLTF2MaterialProperties is a base class holding properties common to all glTF2 Materials.

Since: Kuesa 2.0

A GLTF2MaterialProperties consists of the following base properties:

  • alphaCutOff: The alpha cut off threshold
  • baseColorUsesTexCoord1: Whether we use the first or second set of texture coordinates
  • baseColorFactor: Base color of the material
  • baseColorMap: A texture specifying the base color of the material
  • textureTransform: Allows to transform (scale, translate, rotate) a texture.

Public Types Documentation

enum ColorSpace

Enumerator Value Description
Linear
sRGB

Public Slots Documentation

slot setBaseColorUsesTexCoord1

1
2
3
void setBaseColorUsesTexCoord1(
    bool baseColorUsesTexCoord1
)

slot setBaseColorFactor

1
2
3
void setBaseColorFactor(
    const QColor & baseColorFactor
)

slot setBaseColorMap

1
2
3
void setBaseColorMap(
    Qt3DRender::QAbstractTexture * baseColorMap
)

slot setAlphaCutoff

1
2
3
void setAlphaCutoff(
    float alphaCutoff
)

slot setOutputColorSpace

1
2
3
void setOutputColorSpace(
    ColorSpace colorSpace
)

slot setReceivesShadows

1
2
3
void setReceivesShadows(
    bool receivesShadows
)

slot setShadowMapDepthTexture

1
2
3
void setShadowMapDepthTexture(
    Qt3DRender::QAbstractTexture * depthTexture
)

slot setShadowMapCubeDepthTexture

1
2
3
void setShadowMapCubeDepthTexture(
    Qt3DRender::QAbstractTexture * cubeMapDepthTexture
)

Public Signals Documentation

signal baseColorUsesTexCoord1Changed

1
2
3
void baseColorUsesTexCoord1Changed(
    bool 
)

signal baseColorFactorChanged

1
2
3
void baseColorFactorChanged(
    const QColor & baseColorFactor
)

signal baseColorMapChanged

1
2
3
void baseColorMapChanged(
    Qt3DRender::QAbstractTexture * baseColorMap
)

signal alphaCutoffChanged

1
2
3
void alphaCutoffChanged(
    float alphaCutoff
)

signal receivesShadowsChanged

1
2
3
void receivesShadowsChanged(
    bool receivesShadows
)

signal shadowMapDepthTextureChanged

1
2
3
void shadowMapDepthTextureChanged(
    Qt3DRender::QAbstractTexture * depthTexture
)

signal shadowMapCubeDepthTextureChanged

1
2
3
void shadowMapCubeDepthTextureChanged(
    Qt3DRender::QAbstractTexture * cubeMapDepthTexture
)

signal outputColorSpaceChanged

1
2
3
void outputColorSpaceChanged(
    ColorSpace colorSpace
)

Public Functions Documentation

function GLTF2MaterialProperties

1
2
3
explicit GLTF2MaterialProperties(
    Qt3DCore::QNode * parent =nullptr
)

function ~GLTF2MaterialProperties

1
~GLTF2MaterialProperties()

function isBaseColorUsingTexCoord1

1
bool isBaseColorUsingTexCoord1() const

function baseColorFactor

1
QColor baseColorFactor() const

function baseColorMap

1
Qt3DRender::QAbstractTexture * baseColorMap() const

function alphaCutoff

1
float alphaCutoff() const

function outputColorSpace

1
ColorSpace outputColorSpace() const

function addClientMaterial

1
2
3
void addClientMaterial(
    Qt3DRender::QMaterial * material
)

function clientMaterials

1
QVector< Qt3DRender::QMaterial * > clientMaterials() const

function shaderData

1
virtual Qt3DRender::QShaderData * shaderData() const =0

Reimplemented by: Kuesa::Qt3D::IroDiffuseProperties::shaderData, Kuesa::Qt3D::IroDiffuseAlphaProperties::shaderData, Kuesa::Qt3D::IroDiffuseHemiProperties::shaderData, Kuesa::Qt3D::IroGlassAddProperties::shaderData, Kuesa::Qt3D::IroMatteAddProperties::shaderData, Kuesa::Qt3D::IroMatteAlphaProperties::shaderData, Kuesa::Qt3D::IroMatteBackgroundProperties::shaderData, Kuesa::Qt3D::IroMatteMultProperties::shaderData, Kuesa::Qt3D::IroMatteOpaqueProperties::shaderData, Kuesa::Qt3D::IroMatteSkyboxProperties::shaderData, Kuesa::Qt3D::Iro2AlphaEquiRectProperties::shaderData, Kuesa::Qt3D::Iro2AlphaSemProperties::shaderData, Kuesa::Qt3D::Iro2DiffuseEquiRectProperties::shaderData, Kuesa::Qt3D::Iro2DiffuseSemProperties::shaderData, Kuesa::Qt3D::Iro2GlassEquiRectProperties::shaderData, Kuesa::Qt3D::Iro2GlassSemProperties::shaderData, Kuesa::Qt3D::Iro2MatteAlphaProperties::shaderData, Kuesa::Qt3D::Iro2PlanarReflectionEquiRectProperties::shaderData, Kuesa::Qt3D::Iro2PlanarReflectionSemProperties::shaderData, Kuesa::Qt3D::MetallicRoughnessProperties::shaderData, Kuesa::Qt3D::UnlitProperties::shaderData

function receivesShadows

1
bool receivesShadows() const

function shadowMapDepthTexture

1
Qt3DRender::QAbstractTexture * shadowMapDepthTexture() const

function shadowMapCubeDepthTexture

1
Qt3DRender::QAbstractTexture * shadowMapCubeDepthTexture() const

Public Property Documentation

property baseColorUsesTexCoord1

1
bool baseColorUsesTexCoord1;

property baseColorFactor

1
QColor baseColorFactor;

Specifies the baseColorFactor of the material

property baseColorMap

1
Qt3DRender::QAbstractTexture * baseColorMap;

Note: If this property is nullptr and was set to a non nullptr value, this will trigger a recompilation of the shader. If it was a non nullptr value and is set to nullptr, it will also trigger a recompilation of the shader.

Specifies a texture to be used as baseColorFactor. The content of the texture is expected to be in sRGB color space.

property alphaCutoff

1
float alphaCutoff;

Alpha cutoff threshold. Any fragment with an alpha value higher than this property will be considered opaque. Any fragment with an alpha value lower than this property will be discarded and wont have any effect on the final result. For alphaCutoff to have any effect, it must be activated.

property receivesShadows

1
bool receivesShadows;

Specifies whether a surface should show any shadows that are cast on it. This Default is true

property outputColorSpace

1
ColorSpace outputColorSpace;

Updated on 2023-07-03 at 11:02:09 +0000