DIF/LOD
From TDN
Contents |
Primer on Level of Detail for DIF Interiors
DIF Files work in the same principle as DTS files when it comes to Level of Detail (LOD) actually. A minimum pixel value and detail number is set in for each level of detail in the DIF and when the DIF object is on screen in Torque and "hits" that minimum pixel size, it will pop into the next sequential DIF shape in the series.
Unfortunately though, LOD for DIF Shapes has to be done by hand and there's no easy shortcut like a Multires modifier or anything like there is in 3DS Max!
Each level of detail must to have it's own map, and the maps have to follow the proper naming convention. The proper naming convention just requires a "_#.map" at the end of name, starting at zero. So for example, the proper naming for an DIF object with three levels of detail would be this:
anyobject_0.map
anyobject_1.map
anyobject_2.map
With the one with _0 at the end being the most complicated shape and the file with _2 being the least complicated.
Note: It's easier and important to keep these files in the same directory as each other.
Now when you want to compile all these .maps into one .DIF shape file, you simply run map2dif on anyobject_0.map and since it has the _0 at the end, map2dif will automatically look for any following maps (_1,_2, etc) during the compilation stage of the DIF building and add them in.
Before you make your maps however, you need to know how to set up the .MAP files to export correctly for LOD. This usually requires just a few simple edits to the map properties sections of the .MAP. The two important values are "detail_number" and "min_pixels". These two values must be set correctly in order for the .map to work correctly.
Detail number
"Detail_Number" is simply the number in the detail levels that the .map is. This should correspond to what you number the file extension (_#) when saving the .map. So for example if your file is called "mymap_0.map", your detail_number value in the map properties sections should also be "0". If it was _1, then the value for "detail_number" would be "1", and so forth.
Minimum Pixel
The "popping" to the next level of detailed is determined by the minimum pixel size. Minimum pixel size is the minimum amount of pixels wide the shape has to be on-screen before switching to the next detail level. This is a value set in each map file separately and the more complicated and closer a shape is, the higher the minimum pixel size should be, so the number values vary depending on the actual size of the structure your making really. It usually takes a few times to tweak these values but you get a feel for it eventually.
Resources
Here are some links also for you to check out on DIF map making:
A good basic introduction to advanced DIF features. Uses the Quark editor as a reference.
The DIF Exporter Tools Matrix for reference if you guys are shopping around for a tool



