mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-23 17:09:42 +00:00
terrain material fixes:
- disable normal and parallax mapping - disable specular mapping and specular
This commit is contained in:
parent
f34b2c73c5
commit
dbd2d390fd
2 changed files with 26 additions and 20 deletions
|
@ -31,10 +31,10 @@ namespace MWRender
|
|||
TerrainMaterialGeneratorB::SM2Profile* matProfile =
|
||||
static_cast<TerrainMaterialGeneratorB::SM2Profile*>(activeProfile);
|
||||
|
||||
matProfile->setLightmapEnabled(false);
|
||||
matProfile->setLightmapEnabled(false); // this doesn't disable the lightmap, although it should ??
|
||||
matProfile->setReceiveDynamicShadowsEnabled(false);
|
||||
matProfile->setLayerNormalMappingEnabled(false);
|
||||
//matProfile->setLayerParallaxMappingEnabled(false);
|
||||
matProfile->setLayerParallaxMappingEnabled(false);
|
||||
matProfile->setLayerSpecularMappingEnabled(false);
|
||||
|
||||
mLandSize = ESM::Land::LAND_SIZE;
|
||||
|
@ -195,8 +195,8 @@ namespace MWRender
|
|||
//have a base texture for now, but this is probably not needed on most cells
|
||||
terrainData->layerList.resize(1);
|
||||
terrainData->layerList[0].worldSize = 256;
|
||||
terrainData->layerList[0].textureNames.push_back("textures\\_land_default.dds");
|
||||
terrainData->layerList[0].textureNames.push_back("textures\\_land_default.dds");
|
||||
terrainData->layerList[0].textureNames.push_back("textures\\_land_default.dds"); // diffuseSpec
|
||||
//terrainData->layerList[0].textureNames.push_back("textures\\_land_default.dds"); // normalHeight
|
||||
|
||||
for ( int y = fromY - 1; y < fromY + size + 1; y++ )
|
||||
{
|
||||
|
@ -230,7 +230,7 @@ namespace MWRender
|
|||
|
||||
//Normal map. This should be removed but it would require alterations to
|
||||
//the material generator. Another option would be to use a 1x1 blank texture
|
||||
terrainData->layerList[position].textureNames.push_back("textures\\" + texture);
|
||||
//terrainData->layerList[position].textureNames.push_back("textures\\" + texture);
|
||||
|
||||
indexes[ltexIndex] = position;
|
||||
}
|
||||
|
|
|
@ -46,16 +46,16 @@ namespace Ogre
|
|||
// in the albedo texture to store specular reflection
|
||||
// similarly we double-up the normal and height (for parallax)
|
||||
mLayerDecl.samplers.push_back(TerrainLayerSampler("albedo_specular", PF_BYTE_RGBA));
|
||||
mLayerDecl.samplers.push_back(TerrainLayerSampler("normal_height", PF_BYTE_RGBA));
|
||||
//mLayerDecl.samplers.push_back(TerrainLayerSampler("normal_height", PF_BYTE_RGBA));
|
||||
|
||||
mLayerDecl.elements.push_back(
|
||||
TerrainLayerSamplerElement(0, TLSS_ALBEDO, 0, 3));
|
||||
mLayerDecl.elements.push_back(
|
||||
TerrainLayerSamplerElement(0, TLSS_SPECULAR, 3, 1));
|
||||
mLayerDecl.elements.push_back(
|
||||
TerrainLayerSamplerElement(1, TLSS_NORMAL, 0, 3));
|
||||
mLayerDecl.elements.push_back(
|
||||
TerrainLayerSamplerElement(1, TLSS_HEIGHT, 3, 1));
|
||||
//mLayerDecl.elements.push_back(
|
||||
// TerrainLayerSamplerElement(0, TLSS_SPECULAR, 3, 1));
|
||||
//mLayerDecl.elements.push_back(
|
||||
// TerrainLayerSamplerElement(1, TLSS_NORMAL, 0, 3));
|
||||
//mLayerDecl.elements.push_back(
|
||||
// TerrainLayerSamplerElement(1, TLSS_HEIGHT, 3, 1));
|
||||
|
||||
|
||||
mProfiles.push_back(OGRE_NEW SM2Profile(this, "SM2", "Profile for rendering on Shader Model 2 capable cards"));
|
||||
|
@ -212,8 +212,8 @@ namespace Ogre
|
|||
freeTextureUnits -= numShadowTextures;
|
||||
}
|
||||
|
||||
// each layer needs 2.25 units (1xdiffusespec, 1xnormalheight, 0.25xblend)
|
||||
return static_cast<uint8>(freeTextureUnits / 2.25f);
|
||||
// each layer needs 2.25 units (1xdiffusespec, (1xnormalheight), 0.25xblend)
|
||||
return static_cast<uint8>(freeTextureUnits / (1.25f + (mLayerNormalMappingEnabled||mLayerParallaxMappingEnabled)));
|
||||
|
||||
|
||||
}
|
||||
|
@ -368,7 +368,9 @@ namespace Ogre
|
|||
{
|
||||
// diffuse / specular
|
||||
tu = pass->createTextureUnitState(terrain->getLayerTextureName(i, 0));
|
||||
|
||||
// normal / height
|
||||
if (mLayerNormalMappingEnabled || mLayerParallaxMappingEnabled)
|
||||
tu = pass->createTextureUnitState(terrain->getLayerTextureName(i, 1));
|
||||
}
|
||||
|
||||
|
@ -739,8 +741,10 @@ namespace Ogre
|
|||
|
||||
if(prof->isLayerNormalMappingEnabled() || prof->isLayerParallaxMappingEnabled())
|
||||
ret->setParameter("profiles", "ps_3_0 ps_2_x fp40 arbfp1");
|
||||
else
|
||||
ret->setParameter("profiles", "ps_3_0 ps_2_0 fp30 arbfp1");
|
||||
//else
|
||||
//ret->setParameter("profiles", "ps_3_0 ps_2_0 fp30 arbfp1");
|
||||
else // fp30 doesn't work (black terrain)
|
||||
ret->setParameter("profiles", "ps_3_0 ps_2_x fp40 arbfp1");
|
||||
ret->setParameter("entry_point", "main_fp");
|
||||
|
||||
return ret;
|
||||
|
@ -982,6 +986,8 @@ namespace Ogre
|
|||
{
|
||||
outStream << ", uniform sampler2D difftex" << i
|
||||
<< " : register(s" << currentSamplerIdx++ << ")\n";
|
||||
|
||||
if (prof->mLayerNormalMappingEnabled || prof->mLayerParallaxMappingEnabled)
|
||||
outStream << ", uniform sampler2D normtex" << i
|
||||
<< " : register(s" << currentSamplerIdx++ << ")\n";
|
||||
}
|
||||
|
@ -1238,7 +1244,7 @@ namespace Ogre
|
|||
|
||||
// specular default
|
||||
if (!prof->isLayerSpecularMappingEnabled())
|
||||
outStream << " specular = 1.0;\n";
|
||||
outStream << " specular = 0.0;\n";
|
||||
|
||||
if (tt == RENDER_COMPOSITE_MAP)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue