Re: question about memory usage
Posted: Sun Apr 05, 2015 10:41 pm
thanks for your helpJohnWordsworth wrote:The textures are only loaded into the game engine once, so sharing textures (especially with those packaged with the game) is a very good idea where it looks good.
Edit: Obviously, you should only actually provide the texture once. If you bundle a copy of a game texture in your mod and load it in your own material, the engine won't know that it's the same texture - it only knows it's the same texture if the path is the same.
I'm not sure I understand all but if I understand what you say: whatever is the number of custom material which use log2 textures, if the texture are loaded from the asset pack, they wouldn't be loaded again?
e.g:
SpoilerShow
Code: Select all
defineMaterial{
name = "firezebra",
diffuseMap = "assets/textures/monsters/stone_elemental_emissive.tga",
specularMap = "assets/textures/env/mine_rock_tile_spec.tga",
normalMap = "assets/textures/env/mine_rock_tile_normal.tga",
doubleSided = false,
lighting = true,
alphaTest = false,
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 30,
depthBias = 0,
}this is loaded twice?
SpoilerShow
Code: Select all
defineMaterial{
name = "firezebra",
diffuseMap = "mod_assets/textures/stone_elemental_emissive.tga",
specularMap = "mod_assets/textures/mine_rock_tile_spec.tga",
normalMap = "mod_assets/textures/mine_rock_tile_normal.tga",
doubleSided = false,
lighting = true,
alphaTest = false,
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 30,
depthBias = 0,
Code: Select all
{
class = "Model",
model = "assets/models/env/mine_elevation_edge.fbx",
offset = vec(0, 3, 0),
material = "firezebra",
staticShadow = true,
},
e.g:
SpoilerShow
[codedefineObject{
name = "grotto_elevation_edge",
baseObject = "base_floor_decoration",
components = {
{
class = "Model",
model = "assets/models/env/mine_elevation_edge.fbx",
offset = vec(0, 3, 0),
material = "firezebra",
staticShadow = true,
},
{
class = "Occluder",
model = "assets/models/env/mine_elevation_edge_occluder.fbx",
},
},
minimalSaveState = true,
}
[/code]
name = "grotto_elevation_edge",
baseObject = "base_floor_decoration",
components = {
{
class = "Model",
model = "assets/models/env/mine_elevation_edge.fbx",
offset = vec(0, 3, 0),
material = "firezebra",
staticShadow = true,
},
{
class = "Occluder",
model = "assets/models/env/mine_elevation_edge_occluder.fbx",
},
},
minimalSaveState = true,
}
[/code]