> The runway effect parameters override any parameters it has in common > with the terrain-default effect (since it inherits from it), it is not a bug, > > that's how the system is supposed to work.
I don't know, it doesn't strike me as consistent. There are two control structures here: Inheritance allows to replace a generic effect with a particular effect given terrain type, for instance it allows to use some shader for terrain, but a special shader for forest. Technique allows to control overall detail level - earlier (more detailed) techniques take precedence before later (usually less detailed) techniques. The problem at hand is that the parsing creates an inconsistent state - the rule what shader is to be run is determined by technique, but the texture it gets to use is determined by inheritance even if the technique numbering says inheritance doesn't play a role. A higher number technique which is correctly recognized as 'not to be used' still gets to set parameters of the technique which actually is used. Needless to say, this is hellishly difficult to figure out (it took me four hours to understand) because there is nothing wrong at all with the structure of terrain-default.eff and yet things don't work. So, for me the expected behaviour would be that technique beats inheritance - special effects can override generic effects for certain landclasses if their technique is lower, but all their information is discarded if the technique is not lower. > Forgot to mention the fact that runways have the runway effect applied > to them from materials.xml, hence they obey that one and not terrain-default. That's where you are wrong - technique actually beats inheritance for everything except texture unit number (which is what causes the problems) - runways are shaded with what is specified in terrain-default.eff when it comes with a lower technique number than what is specified in runway.eff (that is the case here). The system correctly uses terrain-haze-detailed.* to shade the runway, just the snow texture gets overrideen by what is specified in runway.eff. > This is fixable by changing the snow texture unit number in the terrain > default, so it doesn't get overridden by the runway settings, or by > changing the runway effect itself, and adding another texture unit there for > the > snow, and an altered technique 4 that caters for the differing texture unit > numbers. I know how to fix it, but I don't know how to prevent the next person adding effects to screw it up all over again. The problem is finding an unused texture unit which nobody will overwrite anywhere in any effect file down the line. My favoured solution would be to make the parsing consistent so that shader to be used and texture to be used are taken from the same technique, but if that can't be done or should not be done for some reason I don't yet understand, maybe we can come up with general guidelines about what texture units are assigned for what (basic texture, noise, normal map, alternative textures, snow,...) so that, say, texture unit 5 is always snow and then there's no problem either. * Thorsten ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel