mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-29 03:26:38 +00:00 
			
		
		
		
	fixed the terrain normals - they had to be adjusted because we use Morrowind's coordinate system
This commit is contained in:
		
							parent
							
								
									abcf25ead2
								
							
						
					
					
						commit
						f55905609f
					
				
					 2 changed files with 5 additions and 3 deletions
				
			
		|  | @ -31,7 +31,7 @@ namespace MWRender | ||||||
|         TerrainMaterialGeneratorB::SM2Profile* matProfile = |         TerrainMaterialGeneratorB::SM2Profile* matProfile = | ||||||
|             static_cast<TerrainMaterialGeneratorB::SM2Profile*>(activeProfile); |             static_cast<TerrainMaterialGeneratorB::SM2Profile*>(activeProfile); | ||||||
| 
 | 
 | ||||||
|         matProfile->setLightmapEnabled(false); // this doesn't disable the lightmap, although it should ??
 |         matProfile->setLightmapEnabled(false); | ||||||
|         matProfile->setReceiveDynamicShadowsEnabled(false); |         matProfile->setReceiveDynamicShadowsEnabled(false); | ||||||
|         matProfile->setLayerNormalMappingEnabled(false); |         matProfile->setLayerNormalMappingEnabled(false); | ||||||
|         matProfile->setLayerParallaxMappingEnabled(false); |         matProfile->setLayerParallaxMappingEnabled(false); | ||||||
|  |  | ||||||
|  | @ -196,6 +196,7 @@ namespace Ogre | ||||||
| 		// count the texture units free
 | 		// count the texture units free
 | ||||||
| 		uint8 freeTextureUnits = 16; | 		uint8 freeTextureUnits = 16; | ||||||
| 		// lightmap
 | 		// lightmap
 | ||||||
|  |                 if (mLightmapEnabled) | ||||||
|                         --freeTextureUnits; |                         --freeTextureUnits; | ||||||
| 		// normalmap
 | 		// normalmap
 | ||||||
| 		--freeTextureUnits; | 		--freeTextureUnits; | ||||||
|  | @ -1019,7 +1020,8 @@ namespace Ogre | ||||||
| 		{ | 		{ | ||||||
| 			outStream <<  | 			outStream <<  | ||||||
| 				// global normal
 | 				// global normal
 | ||||||
| 				"	float3 normal = expand(tex2D(globalNormal, uv)).rgb;\n"; | 				"	float3 normal = expand(tex2D(globalNormal, uv)).rgb;\n" | ||||||
|  |                                 "       normal = float3(normal.x, normal.z, -normal.y); \n"; // convert Ogre to MW coordinate system
 | ||||||
| 
 | 
 | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue