5#include <CesiumGltf/Library.h>
6#include <CesiumGltf/MaterialNormalTextureInfo.h>
7#include <CesiumGltf/MaterialOcclusionTextureInfo.h>
8#include <CesiumGltf/MaterialPBRMetallicRoughness.h>
9#include <CesiumGltf/NamedObject.h>
10#include <CesiumGltf/TextureInfo.h>
24 static constexpr const char*
TypeName =
"Material";
32 inline static const std::string
OPAQUE =
"OPAQUE";
38 inline static const std::string
MASK =
"MASK";
43 inline static const std::string
BLEND =
"BLEND";
140 if (this->pbrMetallicRoughness) {
141 accum += this->pbrMetallicRoughness->getSizeBytes() -
144 if (this->normalTexture) {
145 accum += this->normalTexture->getSizeBytes() -
148 if (this->occlusionTexture) {
149 accum += this->occlusionTexture->getSizeBytes() -
152 if (this->emissiveTexture) {
153 accum += this->emissiveTexture->getSizeBytes() -
156 accum += int64_t(
sizeof(
double) * this->emissiveFactor.capacity());
Classes for working with glTF models.
Material Normal Texture Info.
Material Occlusion Texture Info.
Known values for The alpha rendering mode of the material.
static const std::string OPAQUE
The alpha value is ignored, and the rendered output is fully opaque.
static const std::string BLEND
The alpha value is used to composite the source and destination areas. The rendered output is combine...
static const std::string MASK
The rendered output is either fully opaque or fully transparent depending on the alpha value and the ...
The material appearance of a primitive.
static constexpr const char * TypeName
The original name of this type.
double alphaCutoff
The alpha cutoff value of the material.
std::optional< CesiumGltf::MaterialNormalTextureInfo > normalTexture
The tangent space normal texture.
std::vector< double > emissiveFactor
The factors for the emissive color of the material.
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
bool doubleSided
Specifies whether the material is double sided.
std::string alphaMode
The alpha rendering mode of the material.
std::optional< CesiumGltf::MaterialOcclusionTextureInfo > occlusionTexture
The occlusion texture.
std::optional< CesiumGltf::MaterialPBRMetallicRoughness > pbrMetallicRoughness
A set of parameter values that are used to define the metallic-roughness material model from Physical...
std::optional< CesiumGltf::TextureInfo > emissiveTexture
The emissive texture.
The base class for objects in a glTF that have a name.
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...