Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/draw.cc')
-rw-r--r--src/render/draw.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index b956c18..d932739 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -736,21 +736,24 @@ void draw_model_fragments(model::Model *model,
for (model::FragmentGroup::Fragments::const_iterator fit = group->fragments().begin(); fit != group->fragments().end(); fit++) {
const model::Fragment *fragment = (*fit);
- State::use_material(fragment->material());
- draw_fragment(fragment, detail);
+
+ for (model::Material::Layers::const_iterator lit = fragment->material()->layers().begin(); lit != fragment->material()->layers().end(); ++lit) {
+ State::use_material_layer(fragment->material(), (*lit));
+ draw_fragment(fragment, detail);
+ State::reset();
+ }
if (r_normals->value()) {
// force reset of material settings for the next fragment
State::reset();
gl::color(0.75f, 0.0f, 0.0f);
draw_fragment_normals(fragment, detail);
+ State::reset();
}
}
gl::pop();
}
-
- State::reset();
}
// draw entity axis