Smivs wrote:I've got emission maps OK (and have successfully used them) but my problem now is that I want to use an emission map and an illumination map on the same model (I am trying to give ships lit cockpits and portholes (emission map) and hull spotlighting (illumination map).
While this works and is fully supported, it’s not recommended unless you have a strong reason (such as wanting to make one of the maps a higher resolution than the other).
The suggested approach is to convert the maps into a single emission map. This can be done in two ways:
- Oolite does all the necessary processing when you use illumination and emission maps in non-shader mode, but to make it save the new emission map you need to build it yourself and change “#define DUMP_COMBINER 0” to “#define DUMP_COMBINER 1” in OOCombinedEmissionMapGenerator.m. I appreciate that this is a tad inconvenient.
- In a layer-based editor such as Photoshop, Acorn or GIMP: put the diffuse map in the bottommost layer, then the illumination map in Multiply mode, then the emission map in Lighten mode.
Smivs wrote:I've got both working independently, but when I try to use both, only the emission map seems to work, or just the illumination map if I reverse the order they appear in the code.
This is highly unlikely. The order things appear in a dictionary should have no effect whatsoever. It’s more likely that you’re seeing a pattern that isn’t there. (are you holding down shift while restarting Oolite?)
The only reason I can think of for something like that would be if you were using a graphics card with only two texture image units. You can get your texture image unit count by running the
material test suite, or with
console.glFragmentShaderTextureUnitCount in the debug console.
Smivs wrote:Code: Select all
materials =
{
"python_redux.png" =
{
diffuse_map = "python_SS.png";
emission_map = "python_em-map_SS.png";
illumination_map = "python_illum-map_SS.png";
};
};
There’s nothing obviously wrong with that (except the lack of a namespace prefix on the texture names), but I can’t really say more without the files.
Smivs wrote:The illumination map (white ellipses on a black background) also seems very bright, even when the ship is facing the sun. How do I reduce the effect? Do I just make the White Grey or is it not that simple.
That’s generally the best way. Using a modulate colour as Eric alluded to might preserve subtle detail better on some hardware in shader mode, at a very small performance penalty.
The material documentation is currently outdated. The modulate colour for emission maps is now
emission_modulate_color, and for illumination maps
illumination_modulate_color.
The best, most up-to-date example of this stuff is the
material test suite.