I’m using the setlightoff command in a few places in my program to give the illusion of lights.

As I’m making models it would be a nice trick if I could specify certain polygons as lights on or not. Is there a way to do this either in the egg file itself or later once the model is loaded?

Hmm. You can’t explicitly disable lighting in an egg file, though you could do it after loading by flagging the groups you want, maybe with some identifying name, and iterating through the nodes in Python, calling setLightOff() on each key node.

But, you might be able to achieve a similar result by using materials. Materials control the effect of lighting, and you can set a material on a per-polygon basis in the egg file. Just define a material with 100% emission and 0% diffuse, and you should have something that looks flat-shaded, even in the presence of lighting.

Not sure if your modeling package (and converter) of choice supports materials, of course.


Thanks for the response. To be honest, I didn’t think it would work but I tried it out and after a little trial and error got it. Thanks.

I’m using blender so I had to assign the vertices I wanted to a group then change the material index to 2, one for the base and the other for the lights. Then I exported with Chicken. Even with all that it didn’t quite work.

I went into the egg file under the separate material for the vertex group and changed the lines to:

<Material> Material.001 {
  <Scalar> emitr {1.0}
  <Scalar> emitg {1.0}
  <Scalar> emitb {1.0}
  <Scalar> diffr {0.1}
  <Scalar> diffg {0.1}
  <Scalar> diffb {0.1}
  <Scalar> specr {0.25}
  <Scalar> specg {0.25}
  <Scalar> specb {0.25}
  <Scalar> shininess {12.5}

That did the trick.

Thanks again.