Page MenuHome

Blender Internal: Add material properties "Emit Color" and "Ambient Color".

Authored by Shinsuke Irie (irie) on Feb 9 2014, 2:47 PM.



"Emit Color" specifies emission color not depending on the diffuse color. "Ambient Color" modifies a color of the global ambient light that each material receives, and is used for the environment lighting instead of the diffuse color. If the ambient color is enabled, material preview uses global ambient color=(0.7, 0.7, 0.7) to get better preview.

These properties should be quite useful for NPR. I tried some test renders and indeed got much nicer results:

Also, this allows several importers/exporters to provide better support for materials.

The following things need further modifications:

  • Game Engine
  • COLLADA support
  • Addons (importer/exporter and so on)
  • startup.blend (material of the default cube)

I'm not sure if BLENDER_SUBVERSION should be bumped up.

Diff Detail


Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Feb 10 2014, 3:09 PM

The options seems ok to me in general, some comments.


The UI convention is to avoid hiding these color properties if they are not used, rather they should show disabled ( = False).


I would expect the ambient color to be initialized to the same value as the diffuse color, as that is the somewhat more physically correct thing to do.


The amb parameter should be removed from all these functions if it is no longer used.


Why put this outside the if () {} when mode_l is inside it?


Again it's not clear to me why mode2_l is handled different than mode_l, seems like that makes things more confusing.


This optimization to skip the ambient light when the material does not use it got lost in the change?


This seems like an assumption that may not work well in general? It seems like it's kind of making the assumption that if you are using this option then you're using it for NPR like rendering or so.

Note, I added a patch for ambient color years ago, but Ton rejected (because he didn't think this was a good idea, IIRC code was OK).

The way I had it work was you could slide between world ambient and material's own ambient, which IMHO allows for more control integrating into the existing scene, rather then having a toggle. (sorry can't find patch, but this would be from ~2006 - at a guess)