Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 336 vs 337 for /trunk/Source Code/Environment/Terrain/TerrainLoader.cpp

Diff revisions: vs.
  @@ -12,15 +12,15 @@
12 12 TerrainLoader::TerrainLoader() : Singleton()
13 13 {
14 14 _albedoSampler = MemoryManager_NEW SamplerDescriptor();
15 - _albedoSampler->setWrapMode(TEXTURE_REPEAT);
16 - _albedoSampler->setAnisotropy(8);
17 - _albedoSampler->toggleMipMaps(true);
18 - _albedoSampler->toggleSRGBColorSpace(true);
15 + _albedoSampler->setWrapMode(TEXTURE_REPEAT);
16 + _albedoSampler->setAnisotropy(8);
17 + _albedoSampler->toggleMipMaps(true);
18 + _albedoSampler->toggleSRGBColorSpace(true);
19 19
20 20 _normalSampler = MemoryManager_NEW SamplerDescriptor();
21 - _normalSampler->setWrapMode(TEXTURE_REPEAT);
22 - _normalSampler->setAnisotropy(8);
23 - _normalSampler->toggleMipMaps(true);
21 + _normalSampler->setWrapMode(TEXTURE_REPEAT);
22 + _normalSampler->setAnisotropy(8);
23 + _normalSampler->toggleMipMaps(true);
24 24 }
25 25
26 26 TerrainLoader::~TerrainLoader()
  @@ -97,45 +97,45 @@
97 97 textureTileMaps.setEnumValue(TEXTURE_2D_ARRAY);
98 98 textureTileMaps.setId(textureCountAlbedo);
99 99 textureTileMaps.setResourceLocation(arrayLocation);
100 - textureTileMaps.setPropertyDescriptor(*_albedoSampler);
100 + textureTileMaps.setPropertyDescriptor(*_albedoSampler);
101 101 textureLayer->setTileMaps(CreateResource<Texture>(textureTileMaps));
102 102
103 - arrayLocation.clear();
104 - currentTexture = terrainDescriptor->getVariable("redDetail" + layerOffsetStr);
105 - if (!currentTexture.empty()){
106 - arrayLocation += "," + currentTexture;
107 - textureCountDetail++;
108 - textureLayer->setDetailScale(TerrainTextureLayer::TEXTURE_RED_CHANNEL,
103 + arrayLocation.clear();
104 + currentTexture = terrainDescriptor->getVariable("redDetail" + layerOffsetStr);
105 + if (!currentTexture.empty()){
106 + arrayLocation += "," + currentTexture;
107 + textureCountDetail++;
108 + textureLayer->setDetailScale(TerrainTextureLayer::TEXTURE_RED_CHANNEL,
109 109 terrainDescriptor->getVariablef("detailScaleR" + layerOffsetStr));
110 - }
111 - currentTexture = terrainDescriptor->getVariable("greenDetail" + layerOffsetStr);
112 - if (!currentTexture.empty()){
113 - arrayLocation += "," + currentTexture;
114 - textureCountDetail++;
115 - textureLayer->setDetailScale(TerrainTextureLayer::TEXTURE_GREEN_CHANNEL,
110 + }
111 + currentTexture = terrainDescriptor->getVariable("greenDetail" + layerOffsetStr);
112 + if (!currentTexture.empty()){
113 + arrayLocation += "," + currentTexture;
114 + textureCountDetail++;
115 + textureLayer->setDetailScale(TerrainTextureLayer::TEXTURE_GREEN_CHANNEL,
116 116 terrainDescriptor->getVariablef("detailScaleG" + layerOffsetStr));
117 - }
118 - currentTexture = terrainDescriptor->getVariable("blueDetail" + layerOffsetStr);
119 - if (!currentTexture.empty()){
120 - arrayLocation += "," + currentTexture;
121 - textureCountDetail++;
122 - textureLayer->setDetailScale(TerrainTextureLayer::TEXTURE_BLUE_CHANNEL,
117 + }
118 + currentTexture = terrainDescriptor->getVariable("blueDetail" + layerOffsetStr);
119 + if (!currentTexture.empty()){
120 + arrayLocation += "," + currentTexture;
121 + textureCountDetail++;
122 + textureLayer->setDetailScale(TerrainTextureLayer::TEXTURE_BLUE_CHANNEL,
123 123 terrainDescriptor->getVariablef("detailScaleB" + layerOffsetStr));
124 - }
125 - currentTexture = terrainDescriptor->getVariable("alphaDetail" + layerOffsetStr);
126 - if (!currentTexture.empty()){
127 - arrayLocation += "," + currentTexture;
128 - textureCountDetail++;
129 - textureLayer->setDetailScale(TerrainTextureLayer::TEXTURE_ALPHA_CHANNEL,
124 + }
125 + currentTexture = terrainDescriptor->getVariable("alphaDetail" + layerOffsetStr);
126 + if (!currentTexture.empty()){
127 + arrayLocation += "," + currentTexture;
128 + textureCountDetail++;
129 + textureLayer->setDetailScale(TerrainTextureLayer::TEXTURE_ALPHA_CHANNEL,
130 130 terrainDescriptor->getVariablef("detailScaleA" + layerOffsetStr));
131 - }
131 + }
132 132
133 - ResourceDescriptor textureNormalMaps("Terrain Normal Maps_" + name + "_layer_" + layerOffsetStr);
134 - textureNormalMaps.setEnumValue(TEXTURE_2D_ARRAY);
135 - textureNormalMaps.setId(textureCountDetail);
136 - textureNormalMaps.setResourceLocation(arrayLocation);
137 - textureNormalMaps.setPropertyDescriptor(*_normalSampler);
138 - textureLayer->setNormalMaps(CreateResource<Texture>(textureTileMaps));
133 + ResourceDescriptor textureNormalMaps("Terrain Normal Maps_" + name + "_layer_" + layerOffsetStr);
134 + textureNormalMaps.setEnumValue(TEXTURE_2D_ARRAY);
135 + textureNormalMaps.setId(textureCountDetail);
136 + textureNormalMaps.setResourceLocation(arrayLocation);
137 + textureNormalMaps.setPropertyDescriptor(*_normalSampler);
138 + textureLayer->setNormalMaps(CreateResource<Texture>(textureTileMaps));
139 139
140 140 terrain->_terrainTextures.push_back(textureLayer);
141 141 }
  @@ -163,7 +163,7 @@
163 163
164 164 ResourceDescriptor underwaterAlbedoTexture("Terrain Underwater Albedo_" + name);
165 165 underwaterAlbedoTexture.setResourceLocation(terrainDescriptor->getVariable("underwaterAlbedoTexture"));
166 - underwaterAlbedoTexture.setPropertyDescriptor(*_albedoSampler);
166 + underwaterAlbedoTexture.setPropertyDescriptor(*_albedoSampler);
167 167 terrainMaterial->setTexture(ShaderProgram::TEXTURE_UNIT1, CreateResource<Texture>(underwaterAlbedoTexture));
168 168
169 169 ResourceDescriptor underwaterDetailTexture("Terrain Underwater Detail_" + name);