Trp. Jed
03-09-2007, 09:41 AM
Thought some of you might find this trick useful if you have a model with normal maps.
Normal maps are great close up, but often when the model is far away, the normal map becomes ineffective if its only showing very small details. A good example would be trees where the bark normal can be quite intricate close up, but at 500 metres away, you'll never notice it.
So why would you want to turn normals off with LOD? Well apart from the fact their not doing much to the visual appearance of the tree, it can have a very *slight* effect on improving performance.
For a single model it's probably negligable but if theres a lot of normal mapped models in view it can help a bit.
So how do you do it?
First of all you need to make 2 versions of your material VMT, one with the normal map, one without. e.g.
bark01.vmt
"VertexlitGeneric"
{
"$basetexture" "models/props_trees/bark01"
"$bumpmap" "models/props_trees/bark01_normal"
"$model" 1
"$surfaceprop" "wood"
}
bark01_nonorm.vmt
"VertexlitGeneric"
{
"$basetexture" "models/props_trees/bark01"
"$model" 1
"$surfaceprop" "wood"
}
Next, in your QC where you define your LOD levels, add the replacematerial command as so:
$lod 125
{
replacemodel "tree_01_ref.smd" "tree_01_ref_LOD2.smd"
replacematerial "bark01" "bark01_nonorm"
}
What it will do is not only swap the model on the LOD change, but also swap the material VMT. As both VMTs use the same texture, no extra texture memory is being used.
As I said, the gains are probably negligable but every little helps!
Normal maps are great close up, but often when the model is far away, the normal map becomes ineffective if its only showing very small details. A good example would be trees where the bark normal can be quite intricate close up, but at 500 metres away, you'll never notice it.
So why would you want to turn normals off with LOD? Well apart from the fact their not doing much to the visual appearance of the tree, it can have a very *slight* effect on improving performance.
For a single model it's probably negligable but if theres a lot of normal mapped models in view it can help a bit.
So how do you do it?
First of all you need to make 2 versions of your material VMT, one with the normal map, one without. e.g.
bark01.vmt
"VertexlitGeneric"
{
"$basetexture" "models/props_trees/bark01"
"$bumpmap" "models/props_trees/bark01_normal"
"$model" 1
"$surfaceprop" "wood"
}
bark01_nonorm.vmt
"VertexlitGeneric"
{
"$basetexture" "models/props_trees/bark01"
"$model" 1
"$surfaceprop" "wood"
}
Next, in your QC where you define your LOD levels, add the replacematerial command as so:
$lod 125
{
replacemodel "tree_01_ref.smd" "tree_01_ref_LOD2.smd"
replacematerial "bark01" "bark01_nonorm"
}
What it will do is not only swap the model on the LOD change, but also swap the material VMT. As both VMTs use the same texture, no extra texture memory is being used.
As I said, the gains are probably negligable but every little helps!