Partager via


Class PbrMaterial

A material for Physically Based Rendering.

class Microsoft::Azure::RemoteRendering::PbrMaterial final : public Microsoft::Azure::RemoteRendering::Material

Properties

AlbedoColor

Constant albedo color.

This color is modulated with the color from the PbrMaterial.AlbedoTexture. The alpha channel represents the opacity, in case the material is flagged as transparent (PbrMaterialFeatures.TransparentMaterial).

auto GetAlbedoColor() const noexcept -> Microsoft::Azure::RemoteRendering::Color4;
auto SetAlbedoColor(Microsoft::Azure::RemoteRendering::Color4 const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

AlbedoTexture

The Texture used for the albedo color. Pass in null if no dedicated texture is needed.

A Result.InvalidType error occurs if a texture is set that is not a 2D texture.

auto GetAlbedoTexture() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::Texture>;
auto SetAlbedoTexture(ApiHandle<Microsoft::Azure::RemoteRendering::Texture> const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

AlphaClipThreshold

Threshold that is used for alpha cutouts.

If a pixel's final alpha value falls below this threshold, the pixel is clipped, creating a hard cutout. Note that the material's PbrMaterialFeatures.AlphaClipped flag has to be set, for this threshold to have an effect.

A Result.InvalidParam error occurs if the value is outside [0..1] range.

auto GetAlphaClipThreshold() const noexcept -> float;
auto SetAlphaClipThreshold(float value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

AOMap

The Texture used for ambient occlusion. Pass in null if no dedicated texture is needed.

A valid AO texture is a grayscale texture that defines which areas are occluded (dark/black) and which ones aren't (bright/white). The AO value from the texture will be modulated with the PbrMaterial.AOScale property.

A Result.InvalidType error occurs if a texture is set that is not a 2D texture.

auto GetAOMap() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::Texture>;
auto SetAOMap(ApiHandle<Microsoft::Azure::RemoteRendering::Texture> const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

AOScale

How strongly to apply ambient occlusion to this material. [0..1] range.

A Result.InvalidParam error occurs if the value is outside [0..1] range.

auto GetAOScale() const noexcept -> float;
auto SetAOScale(float value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

FadeOut

Fade-out value in the [0..1] range, where 0.0 means fully faded out and 1.0 means fully opaque.

This is very similar to changing the albedo's alpha on a transparent material, however, this function automatically manages the transparency flag for values of 1.0 (fully opaque) and smaller than 1.0 (semi-transparent).

A Result.InvalidParam error occurs if the value is outside [0..1] range.

auto GetFadeOut() const noexcept -> float;
auto SetFadeOut(float value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

FresnelEffectColor

The Fresnel effect color used when the effect is enabled (see the 'FresnelEffect' flag in PbrMaterialFeatures)

Only the rgb channels of the color are used for the Fresnel effect, while the alpha value will be ignored.

auto GetFresnelEffectColor() const noexcept -> Microsoft::Azure::RemoteRendering::Color4;
auto SetFresnelEffectColor(Microsoft::Azure::RemoteRendering::Color4 const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

FresnelEffectExponent

The Fresnel effect exponent used when the effect is enabled (see the 'FresnelEffect' flag in PbrMaterialFeatures)

The valid range for the exponent is [0.01, 10].

auto GetFresnelEffectExponent() const noexcept -> float;
auto SetFresnelEffectExponent(float value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

Metalness

A constant metalness value.

Metalness is a scalar in the [0..1] range, which in most of the use cases is either 0.0 (non-metallic) or 1.0 (metallic). The metalness constant is only used if no PbrMaterial.MetalnessMap is provided.

A Result.InvalidParam error occurs if the value is outside [0..1] range.

auto GetMetalness() const noexcept -> float;
auto SetMetalness(float value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

MetalnessMap

The Texture used for metalness. Pass in null if no dedicated texture is needed.

A valid metalness texture is a grayscale texture that defines which areas should be considered metal (1.0) and which areas are non-metals (0.0). Values in between are possible, but are not physically plausible.

A Result.InvalidType error occurs if a texture is set that is not a 2D texture.

auto GetMetalnessMap() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::Texture>;
auto SetMetalnessMap(ApiHandle<Microsoft::Azure::RemoteRendering::Texture> const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

NormalMap

The Texture used as the normal map. Pass in null if no dedicated texture is needed.

Although any texture can be used, note that a valid normalmap encodes the normal vector into RGB portions, rather than being a grayscale heightmap.

A Result.InvalidType error occurs if a texture is set that is not a 2D texture.

auto GetNormalMap() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::Texture>;
auto SetNormalMap(ApiHandle<Microsoft::Azure::RemoteRendering::Texture> const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

NormalMapScale

Scales the normal map strength.

The new normalmap scaling factor in [0..100] range. A value of 1.0 takes the normalmap's normal as-is, a value of 0 makes the surface appear flat. Values larger than 1.0 exaggerate the normalmap perturbation. This value has no effect if this material does not specify a normalmap texture. A Result.InvalidParam error occurs if the value is outside the valid range.

auto GetNormalMapScale() const noexcept -> float;
auto SetNormalMapScale(float value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

PbrFlags

The PBR material flags.

A Result.InvalidParam error occurs if an invalid flags bitmask is set.

auto GetPbrFlags() const noexcept -> Microsoft::Azure::RemoteRendering::PbrMaterialFeatures;
auto SetPbrFlags(Microsoft::Azure::RemoteRendering::PbrMaterialFeatures value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

PbrVertexAlphaMode

Determines how the alpha channel of vertex colors is used. See PbrVertexAlphaMode for details.

This mode has no effect if the mesh doesn't provide vertex colors or if the flag PbrMaterialFeatures.UseVertexColor is not set. The default value is PbrVertexAlphaMode.Occlusion.

A Result.InvalidParam error occurs if an unknown mode is passed in.

auto GetPbrVertexAlphaMode() const noexcept -> Microsoft::Azure::RemoteRendering::PbrVertexAlphaMode;
auto SetPbrVertexAlphaMode(Microsoft::Azure::RemoteRendering::PbrVertexAlphaMode value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

Roughness

A constant roughness value.

Roughness is a scalar in the [0..1] range. The roughness constant is only used if no PbrMaterial.RoughnessMap is provided.

A Result.InvalidParam error occurs if the value is outside [0..1] range.

auto GetRoughness() const noexcept -> float;
auto SetRoughness(float value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

RoughnessMap

The Texture used for roughness. Pass in null if no dedicated texture is needed.

A valid roughness texture is a grayscale texture that defines which areas are rough (values close to 1.0) and which are smooth (values close to 0.0).

A Result.InvalidType error occurs if a texture is set that is not a 2D texture.

auto GetRoughnessMap() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::Texture>;
auto SetRoughnessMap(ApiHandle<Microsoft::Azure::RemoteRendering::Texture> const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

TexCoordOffset

Constant offset added to texture coordinates.

An offset is normalized to [0..1] range, regardless of texture size, so (0.5, 0.5) always points to the middle of a texture. The offset can be changed over time to scroll the texture.

A Result.InvalidParam error occurs if the value is NaN or infinite.

auto GetTexCoordOffset() const noexcept -> Microsoft::Azure::RemoteRendering::Float2;
auto SetTexCoordOffset(Microsoft::Azure::RemoteRendering::Float2 const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

TexCoordScale

Scaling factors for texture coordinates.

Used to repeat/tile textures. For instance passing (4, 2) will repeat the texture 4 times along the U texture coordinate, and 2 times along V.

A Result.InvalidParam error occurs if the value is NaN or infinite.

auto GetTexCoordScale() const noexcept -> Microsoft::Azure::RemoteRendering::Float2;
auto SetTexCoordScale(Microsoft::Azure::RemoteRendering::Float2 const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

See also

See also