Skip to content

Commit 110de57

Browse files
committed
shading model - closes #106
1 parent 57b553f commit 110de57

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/ofbx.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,8 +1401,10 @@ struct MaterialImpl : Material
14011401
double getBumpFactor() const override { return bump_factor; };
14021402
double getEmissiveFactor() const override { return emissive_factor; };
14031403
double getOpacity() const override { return opacity; };
1404+
DataView getShadingModel() const override { return shading_model; }
14041405

14051406
const Texture* textures[Texture::TextureType::COUNT];
1407+
DataView shading_model;
14061408
Color diffuse_color = {1, 1, 1};
14071409
Color specular_color = {1, 1, 1};
14081410
Color reflection_color = {1, 1, 1};
@@ -2639,7 +2641,10 @@ static OptionalError<Object*> parseMaterial(const Scene& scene, const Element& e
26392641
{
26402642
if (prop->id == property_id && prop->first_property)
26412643
{
2642-
if (prop->first_property->value == "DiffuseColor")
2644+
if (prop->first_property->value == "ShadingModel") {
2645+
material->shading_model = prop->getProperty(property_offset)->getValue();
2646+
}
2647+
else if (prop->first_property->value == "DiffuseColor")
26432648
{
26442649
material->diffuse_color.r = (float)prop->getProperty(property_offset + 0)->getValue().toDouble();
26452650
material->diffuse_color.g = (float)prop->getProperty(property_offset + 1)->getValue().toDouble();

src/ofbx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ struct Material : Object
427427
virtual double getBumpFactor() const = 0;
428428
virtual double getEmissiveFactor() const = 0;
429429
virtual double getOpacity() const = 0;
430+
virtual DataView getShadingModel() const = 0;
430431

431432
virtual const Texture* getTexture(Texture::TextureType type) const = 0;
432433
};

0 commit comments

Comments
 (0)