Migrate from Xml to custom or Json
Because Xml is hard to read and takes much time to load.
Idea #1:
Custom Script:
Like in Id tech or Cube 2
Example of Material:
Old Snow.xml
<material>
<technique name="Techniques/Diff.xml" />
<texture unit="diffuse" name="Textures/Snow.dds" />
<parameter name="MatSpecColor" value="0.25 0.25 0.25 16" />
</material>
New Snow.mtr (MaTeRial .mtr)
/*
Multiline Comment
*/
//Line Comment
Material Snow {
//Here add maps and types and def of map (collisions, twosided, impacts...)
Technique Techniques/Diff.tch
Diffusemap Textures/Snow.dds
Specularmap 0.25 0.25 0.25 16
}
Old MatBody.xml
<?xml version="1.0"?>
<material>
<technique name="Techniques/DiffNormalSpecAlphaMask.xml" quality="0" loddistance="0" />
<texture unit="diffuse" name="Textures/Nyra/body_d.png" />
<texture unit="normal" name="Textures/Nyra/body_n.png" />
<texture unit="specular" name="Textures/Nyra/head_s.png" />
<texture unit="environment" name="Textures/Nyra/reflect.png" />
<parameter name="UOffset" value="1 0 0 0" />
<parameter name="VOffset" value="0 1 0 0" />
<parameter name="MatDiffColor" value="0.4 0.4 0.4 1" />
<parameter name="MatEmissiveColor" value="0 0 0 1" />
<parameter name="MatEnvMapColor" value="1 1 1" />
<parameter name="MatSpecColor" value="0.5 0.5 0.5 384.314" />
<cull value="ccw" />
<shadowcull value="ccw" />
<depthbias constant="0" slopescaled="0" />
</material>
New MatBody.mtr
Material MatBody {
Technique Techniques/DiffNormalSpecAlphaMask.tch {
Quality 0
Loddistance 0
}
Diffusemap {
Map Textures/Nyra/body_d.png
Color 0.4 0.4 0.4 1
}
Normalmap Textures/Nyra/body_n.png
Specularmap {
Map Textures/Nyra/head_s.png
Color 0.5 0.5 0.5 384.314
}
Emissivemap 0 0 0 1
Environmentmap {
Map Textures/Nyra/reflect.png
Color 1 1 1
}
UOffset 1 0 0 0
VOffset 0 1 0 0
Cull_0
Shadowcull_0
Depthbias {
Constant 0
Slopescaled 0
}
}
Idea #2:
Use Json