Browse Source

Merge branch 'master' of https://github.com/MarcoROG/BansheeEngine into MarcoROG-master

BearishSun 8 years ago
parent
commit
9f1f8ebd63

+ 1 - 1
Data/Raw/Editor/Includes/PickingCull.bslinc

@@ -30,7 +30,7 @@ mixin PickingCull
 			out float4 oNorm : SV_Target1
 			out float4 oNorm : SV_Target1
 		) : SV_Target0
 		) : SV_Target0
 		{
 		{
-			oNorm = (inNorm + float4(1,1,1,0)) / 2;
+			oNorm = inNorm;
 			return gColorIndex;
 			return gColorIndex;
 		}
 		}
 	};
 	};

+ 5 - 2
Source/BansheeCore/Source/BsPixelUtil.cpp

@@ -1837,6 +1837,7 @@ namespace bs
 		}
 		}
 		
 		
 		UINT32* color = (UINT32 *)src;
 		UINT32* color = (UINT32 *)src;
+		UINT32 masked = 0;
 		switch (format) 
 		switch (format) 
 		{
 		{
 		case PF_D24S8:
 		case PF_D24S8:
@@ -1846,10 +1847,12 @@ namespace bs
 			return static_cast<float>(*color & 0xFFFF) / (float)65536;
 			return static_cast<float>(*color & 0xFFFF) / (float)65536;
 			break;
 			break;
 		case PF_D32:
 		case PF_D32:
-			return static_cast<float>(*color & 0xFFFFFFFF) / (float)4294967296;
+			masked = *color & 0xFFFFFFFF;
+			return *((float*)&masked);
 			break;
 			break;
 		case PF_D32_S8X24:
 		case PF_D32_S8X24:
-			return static_cast<float>(*color & 0xFFFFFFFF) / (float)4294967296;
+			masked = *color & 0xFFFFFFFF;
+			return *( (float*) &masked );
 			break;
 			break;
 		default:
 		default:
 			LOGERR("Cannot unpack from " + getFormatName(format));
 			LOGERR("Cannot unpack from " + getFormatName(format));

+ 1 - 1
Source/BansheeEditor/Source/BsScenePicking.cpp

@@ -261,7 +261,7 @@ namespace bs
 		normalTexDesc.type = TEX_TYPE_2D;
 		normalTexDesc.type = TEX_TYPE_2D;
 		normalTexDesc.width = outputTextureProperties.getWidth();
 		normalTexDesc.width = outputTextureProperties.getWidth();
 		normalTexDesc.height = outputTextureProperties.getHeight();
 		normalTexDesc.height = outputTextureProperties.getHeight();
-		normalTexDesc.format = PF_RGBA8;
+		normalTexDesc.format = PF_FLOAT_R11G11B10;
 		normalTexDesc.usage = TU_RENDERTARGET;
 		normalTexDesc.usage = TU_RENDERTARGET;
 
 
 		SPtr<Texture> normalsTexture = Texture::create(normalTexDesc);
 		SPtr<Texture> normalsTexture = Texture::create(normalTexDesc);

+ 1 - 1
Source/BansheeEngine/Source/BsShapeMeshes3D.cpp

@@ -534,7 +534,7 @@ namespace bs
 		if (outNormals != nullptr)
 		if (outNormals != nullptr)
 		{
 		{
 			outNormals += (vertexOffset * vertexStride);
 			outNormals += (vertexOffset * vertexStride);
-			for (UINT32 face = 0; face < 4; face++)
+			for (UINT32 face = 0; face < 6; face++)
 			{
 			{
 				outNormals = writeVector3(outNormals, vertexStride, faceNormals[face]);
 				outNormals = writeVector3(outNormals, vertexStride, faceNormals[face]);
 				outNormals = writeVector3(outNormals, vertexStride, faceNormals[face]);
 				outNormals = writeVector3(outNormals, vertexStride, faceNormals[face]);

+ 1 - 1
Source/Examples/ExampleGettingStarted/Source/Main.cpp

@@ -190,7 +190,7 @@ namespace bs
 				importOptions->setCPUCached(true);
 				importOptions->setCPUCached(true);
 			}
 			}
 
 
-			model = gImporter().import<Mesh>(exampleModelPath);
+			model = gImporter().import<Mesh>(exampleModelPath, meshImportOptions);
 
 
 			// Save for later use, so we don't have to import on the next run.
 			// Save for later use, so we don't have to import on the next run.
 			gResources().save(model, exampleModelAssetPath, true);
 			gResources().save(model, exampleModelAssetPath, true);