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";
94 std::vector<double> emissiveFactor = {0, 0, 0};
105 std::string alphaMode = AlphaMode::OPAQUE;
117 double alphaCutoff = 0.5;
127 bool doubleSided =
false;
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.
The material appearance of a primitive.
std::optional< CesiumGltf::MaterialNormalTextureInfo > normalTexture
The tangent space normal texture.
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
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,...