From 29f91753f7b624b094ef3e9f0f237d560832b514 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 14 Jul 2012 18:44:03 +0200 Subject: [PATCH] correction --- apps/openmw/mwrender/terrainmaterial.cpp | 2 +- files/materials/terrain.shader | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwrender/terrainmaterial.cpp b/apps/openmw/mwrender/terrainmaterial.cpp index d7c42efee..4c8f06030 100644 --- a/apps/openmw/mwrender/terrainmaterial.cpp +++ b/apps/openmw/mwrender/terrainmaterial.cpp @@ -87,7 +87,7 @@ namespace MWRender int TerrainMaterial::Profile::getLayersPerPass () const { - return 12; + return 11; } void TerrainMaterial::Profile::createPass (int index, const Ogre::Terrain* terrain) diff --git a/files/materials/terrain.shader b/files/materials/terrain.shader index 34b52caf6..47f81d05d 100644 --- a/files/materials/terrain.shader +++ b/files/materials/terrain.shader @@ -90,18 +90,17 @@ float4 blendValues@shIterator = shSample(blendMap@shIterator, UV); @shEndForeach - float blendAmount; float3 albedo; @shForeach(@shPropertyString(num_layers)) #if IS_FIRST_PASS == 1 && @shIterator == 0 // first layer of first pass doesn't need a blend map - albedo = shSample(diffuseMap0, UV * 5).rgb; + albedo = shSample(diffuseMap0, UV * 10).rgb; #else - blendAmount = blendValues@shPropertyString(blendmap_index_@shIterator).@shPropertyString(blendmap_component_@shIterator); + #define BLEND_AMOUNT blendValues@shPropertyString(blendmap_index_@shIterator).@shPropertyString(blendmap_component_@shIterator) - albedo += shSample(diffuseMap@shIterator, UV * 5).rgb * blendAmount; + albedo = shLerp(albedo, shSample(diffuseMap@shIterator, UV * 10).rgb, BLEND_AMOUNT); #endif @shEndForeach