Material QML Type

Abstract base type providing functionality common to materials. More...

Import Statement: import QtQuick3D
Inherits:

Object3D

Inherited By:

CustomMaterial, DefaultMaterial, and PrincipledMaterial

Properties

Detailed Description

Property Documentation

cullMode : enumeration

This property defines whether primitive culling is enabled, and, when enabled, which primitives are discarded.

The default value is Material.BackFaceCulling.

A triangle is considered front-facing if it has a counter-clockwise winding, meaning its vertices in framebuffer coordinates are in counter-clockwise order.

ConstantDescription
Material.BackFaceCullingBack-facing triangles are discarded.
Material.FrontFaceCullingFront-facing triangles are discarded.
Material.NoCullingNo triangles are discarded.

depthDrawMode : enumeration

This property determines if and when depth rendering takes place for this material. The default behavior when SceneEnvironment::depthTestEnabled is set to true is that during the main render pass only opaque materials will write to the depth buffer. This property makes it possible to change this behavior to fine tune the rendering of a material.

The default value is Material.OqaqueOnlyDepthDraw

ConstantDescription
Material.OpaqueOnlyDepthDrawDepth rendering is only performed if the material is opaque.
Material.AlwaysDepthDrawDepth rendering is always performed regardless of the material type.
Material.NeverDepthDrawDepth rendering is never performed.
Material.OpaquePrePassDepthDrawDepth rendering is performed in a separate depth pass, but only opaque values are written. This mode also enables transparent materials to be used in combination with shadows.

Note: If SceneEnvironment::depthPrePassEnabled is set to true then all depth writes will take place as a result of the depth prepass, but it is still necessary to explicitly set Material.OpaquePrePassDepthDraw to only write the opaque fragments in the depth and shadow passes.


lightProbe : Texture

This property defines a Texture for overriding or setting an image based lighting Texture for use with this material only.

Note: Setting a light probe on the material will override the scene's light probe for models using this material.

See also SceneEnvironment::lightProbe.