Well, I downloaded the OpenEq Sources from the Subversion Repository, and I looked them over. Using them, I was able to decode the entirety of the MOD and TER format files. It appears, from the ter.hpp/cpp and mod.hpp/cpp files, the loaders do not fully understand the material segment. I manage to decode it.
I wrote a new version of the Loader for the TER format files based upon the interfaces and data structures already defined in the OpenEQ Header Files. This Loader at least compiles, thought I cannot test it currently as I don't have SDL on my machine. I compiled it with g++ on cygwin. The Header and Implementation files should be found at the bottom of this message (so long as I don't forget to attach them, hehe).
For those of you not familiar with C++ code, here's how the Material Segment Works:
The Material Segment looks like this:
[ long mat0_index ]
[ long mat0_name0_offset ]
[ long mat0_name1_offset ]
[ long mat0_parameter_count ]
[ long param0_name_offset ] [ long param0_value_type ] [ (long|float) param0_value ]
[ long param1_name_offset ] [ long param1_value_type ] [ (long|float) param1_value ]
...
[ long paramN_name_offset ] [ long paramN_value_type ] [ (long|float) paramN_value ]
[ long mat1_index ]
[ long mat1_name0_offset ]
[ long mat1_name1_offset ]
[ long mat1_parameter_count ]
[ long param0_name_offset ] [ long param0_value_type ] [ (long|float) param0_value ]
[ long param1_name_offset ] [ long param1_value_type ] [ (long|float) param1_value ]
...
[ long paramN_name_offset ] [ long paramN_value_type ] [ (long|float) paramN_value ]
...
- long index : 32-bit integer material index.
- long name_offset0 : 32-bit integer offset. Reading from this location in the string table gives the material name.
- long name_offset1 : 32-bit integer offset. Reading from this location in the string table gives another name string, which I'm not really sure what this second string is for.
- long parameter_count : 32-bit integer number of 12-byte parameters belonging to this material.
- long param0_name_offset : 32-bit integer offset. Reading from this location in the string table gives the parameter name. (Example: "e_TextureDiffuse0")
- long param0_value_type : 32-bit enumeration of what type the param0_value will be. (These values are always the same size of 4 bytes, just interpreted differently).
- (long | float) param0_value : If param0_value_type is '0', this value is a 32-bit float. If param0_value_type is '2', this value is a 32-bit integer offset into the string table.
EQG TER Format and EQG MOD Format use the same structure for their material segments. The Material records specify a number of different parameters, including texture names, shinyness values, and normal map textures. The current structures inside the openeq sources written didn't provide locations to store them, so I just stored the same information the original loader did with respect to the textures.
I hope you guys find this information helpful.