- SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "ignoring unknown material `" << u << '\'');
- unlighted_state = lighted_state;
+ material = m;
+ // set material states (lighted & unlighted)
+ lighted_state = material->get_effect();
+ newmat.append(".unlighted");
+
+ m = matlib->find(newmat);
+ if (m) {
+ unlighted_state = m->get_effect();
+ } else {
+ SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "ignoring unknown material `" << newmat << '\'');
+ unlighted_state = lighted_state;
+ }