file DTS Texture Options Format

  • whirligig
  • whirligig's Avatar Topic Author
  • Offline
  • Professional Marbler
  • Professional Marbler
  • Posts: 444
  • Thank you received: 261
13 Aug 2014 20:03 #1
This post by MadMarioSkills inspired me to take a closer look at how MBG's DTS format works for textures. Here's a compilation of my findings:

First of all, you can open any DTS file in a hex editor such as XVI32 to change these values. At the end of the file, you will find information on the various textures in the file. It should look something like this in the ASCII view:
Code:
...|texture1|texture2-texture3|texture4|texture5C c C C W ...

This area stores information on each of the textures in the file. First, there are the names of the textures, delimited by either character 0x05 or 0x06; I don't know if there's any pattern to which one is used where. Then, after the texture names, we have four bytes for each texture, the last three of which are usually 00 00 00. These determine the settings for each texture, in the same order that the texture names appear in (the order seems somewhat random). The "default" in Blender's DTS exporter is 0x43 00 00 00.

To describe what individual bits do, I'll write the four bytes of info as:
Code:
abcdefgh xx yy zz
where abcdefgh is the first byte in binary, and xx yy zz are the last three in hexadecimal.
Bit/ByteFunctionEffect in MBG
aDisable mipmappingThe texture will not be blurred at faraway distances like it normally is. In practice, makes the texture look badly aliased.
bDisable environment mappingIf this bit is 0, the texture will appear "shiny" and reflect the sky. The amount of reflection is stored elsewhere in the file (I was unable to figure out the format, but it seems to be at the very end). The environment mapping will be stronger in parts of the texture with a higher alpha value, contrary to what one would expect. (This is why base.marble.png has such a low alpha.)
cUse self-illuminationThe texture will appear bright from all sides, independent of the sun's direction, color, or ambient light. This is why you can always see gems clearly even in a dark area of the level.
dSubtractive translucencyIf translucency is enabled, the texture will be drawn by subtracting its colors from what's behind it, similar to the Subtract mode in Photoshop. This is not affected by the alpha channel.
eAdditive translucencyIf translucency is enabled, the texture will be drawn by adding its colors to what's behind it, similar to the Addition mode in Photoshop. This is affected by the alpha channel, with higher alpha indicating more addition.
fTranslucencyAllows the texture to use its alpha channel as opacity. This can cause the drawing order to function improperly.
gEnable TWrapAppears to prevent textures from wrapping vertically when disabled.
hEnable SWrapAppears to prevent textures from wrapping horizontally when disabled.
xxMipmap borderSet to 1 when the "Mipmap Zero Border" option is selected. This creates a black border that appears between textures when the texture is viewed from far away. I have no idea what this would be used for.
yyUnknownThis byte was never modified in my tests. I suspect it's part of either mipmap border (as above) or part of IFL animation (as below), i.e. one of those is stored in two bytes.
zzIFL sequence indexWhen nonzero, causes the texture to use an IFL animation instead (e.g. the start pad colors that change). I have no idea how this system works, but I can only assume that this byte is the index of the animation or similar information.
The following user(s) said Thank You: Derpky, Weather

Please Log in or Create an account to join the conversation.

  • brandondorf9999
  • brandondorf9999's Avatar
  • Offline
  • Beginner Marbler
  • Beginner Marbler
  • Posts: 69
  • Thank you received: 2
14 Aug 2014 05:12 #2
I have HxD hex editor, but that's hard work. You can overlay a layer of a marble by duplicating a model, using a seperate material with the same texture, scaling the shader model a little bit and using the additive translucency will give the marble or other shape some additive shaders.

Please Log in or Create an account to join the conversation.

  • MadMarioSkills
  • MadMarioSkills's Avatar
  • Offline
  • Experienced Marbler
  • Experienced Marbler
  • Posts: 198
  • Thank you received: 0
14 Aug 2014 17:28 - 14 Aug 2014 19:02 #3
Oh wow, this is awesome!

Edit
Also, making everything shiny is fun.
Last edit: 14 Aug 2014 19:02 by MadMarioSkills.

Please Log in or Create an account to join the conversation.

Moderators: Doomblah
Time to create page: 0.987 seconds