mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-13 22:35:53 +08:00
parent
fd6c7855e7
commit
1f42c963e6
18
tiny_gltf.h
18
tiny_gltf.h
@ -735,7 +735,7 @@ struct OcclusionTextureInfo {
|
|||||||
|
|
||||||
// pbrMetallicRoughness class defined in glTF 2.0 spec.
|
// pbrMetallicRoughness class defined in glTF 2.0 spec.
|
||||||
struct PbrMetallicRoughness {
|
struct PbrMetallicRoughness {
|
||||||
std::vector<double> baseColorFactor; // len = 4. default [1,1,1,1]
|
std::vector<double> baseColorFactor{1.0, 1.0, 1.0, 1.0}; // len = 4. default [1,1,1,1]
|
||||||
TextureInfo baseColorTexture;
|
TextureInfo baseColorTexture;
|
||||||
double metallicFactor{1.0}; // default 1
|
double metallicFactor{1.0}; // default 1
|
||||||
double roughnessFactor{1.0}; // default 1
|
double roughnessFactor{1.0}; // default 1
|
||||||
@ -748,9 +748,9 @@ struct PbrMetallicRoughness {
|
|||||||
std::string extras_json_string;
|
std::string extras_json_string;
|
||||||
std::string extensions_json_string;
|
std::string extensions_json_string;
|
||||||
|
|
||||||
PbrMetallicRoughness()
|
PbrMetallicRoughness() = default;
|
||||||
: baseColorFactor(std::vector<double>{1.0, 1.0, 1.0, 1.0}) {}
|
|
||||||
DEFAULT_METHODS(PbrMetallicRoughness)
|
DEFAULT_METHODS(PbrMetallicRoughness)
|
||||||
|
|
||||||
bool operator==(const PbrMetallicRoughness &) const;
|
bool operator==(const PbrMetallicRoughness &) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -760,10 +760,10 @@ struct PbrMetallicRoughness {
|
|||||||
struct Material {
|
struct Material {
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
std::vector<double> emissiveFactor; // length 3. default [0, 0, 0]
|
std::vector<double> emissiveFactor{0.0, 0.0, 0.0}; // length 3. default [0, 0, 0]
|
||||||
std::string alphaMode; // default "OPAQUE"
|
std::string alphaMode{"OPAQUE"}; // default "OPAQUE"
|
||||||
double alphaCutoff{0.5}; // default 0.5
|
double alphaCutoff{0.5}; // default 0.5
|
||||||
bool doubleSided{false}; // default false;
|
bool doubleSided{false}; // default false
|
||||||
|
|
||||||
PbrMetallicRoughness pbrMetallicRoughness;
|
PbrMetallicRoughness pbrMetallicRoughness;
|
||||||
|
|
||||||
@ -783,9 +783,7 @@ struct Material {
|
|||||||
std::string extras_json_string;
|
std::string extras_json_string;
|
||||||
std::string extensions_json_string;
|
std::string extensions_json_string;
|
||||||
|
|
||||||
Material()
|
Material() = default;
|
||||||
: emissiveFactor(std::vector<double>{0.0, 0.0, 0.0}), alphaMode("OPAQUE")
|
|
||||||
{}
|
|
||||||
DEFAULT_METHODS(Material)
|
DEFAULT_METHODS(Material)
|
||||||
|
|
||||||
bool operator==(const Material &) const;
|
bool operator==(const Material &) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user