浏览代码

Fixing transparent shaders

BearishSun 8 年之前
父节点
当前提交
585e0a6e67
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      Data/Raw/Engine/Shaders/Transparent.bsl
  2. 2 2
      Source/RenderBeast/Source/BsObjectRendering.cpp

+ 1 - 1
Data/Raw/Engine/Shaders/Transparent.bsl

@@ -73,7 +73,7 @@ Technique
 				SurfaceData surfaceData;
 				SurfaceData surfaceData;
 				surfaceData.albedo = gAlbedoTex.Sample(gAlbedoSamp, input.uv0);
 				surfaceData.albedo = gAlbedoTex.Sample(gAlbedoSamp, input.uv0);
 				surfaceData.worldNormal.xyz = worldNormal;
 				surfaceData.worldNormal.xyz = worldNormal;
-				surfaceData.worldNormal.w = 0.0f;
+				surfaceData.worldNormal.w = 1.0f;
 				surfaceData.roughness = gRoughnessTex.Sample(gRoughnessSamp, input.uv0).x;
 				surfaceData.roughness = gRoughnessTex.Sample(gRoughnessSamp, input.uv0).x;
 				surfaceData.metalness = gMetalnessTex.Sample(gMetalnessSamp, input.uv0).x;
 				surfaceData.metalness = gMetalnessTex.Sample(gMetalnessSamp, input.uv0).x;
 				
 				

+ 2 - 2
Source/RenderBeast/Source/BsObjectRendering.cpp

@@ -66,8 +66,8 @@ namespace bs { namespace ct
 		if(gpuParams->hasBuffer(GPT_FRAGMENT_PROGRAM, "gGridLightOffsetsAndSize"))
 		if(gpuParams->hasBuffer(GPT_FRAGMENT_PROGRAM, "gGridLightOffsetsAndSize"))
 			gpuParams->getBufferParam(GPT_FRAGMENT_PROGRAM, "gGridLightOffsetsAndSize", element.gridLightOffsetsAndSizeParam);
 			gpuParams->getBufferParam(GPT_FRAGMENT_PROGRAM, "gGridLightOffsetsAndSize", element.gridLightOffsetsAndSizeParam);
 
 
-		if (gpuParams->hasBuffer(GPT_FRAGMENT_PROGRAM, "gGridLightIndices"))
-			gpuParams->getBufferParam(GPT_FRAGMENT_PROGRAM, "gGridLightIndices", element.gridLightIndicesParam);
+		if (gpuParams->hasBuffer(GPT_FRAGMENT_PROGRAM, "gLightIndices"))
+			gpuParams->getBufferParam(GPT_FRAGMENT_PROGRAM, "gLightIndices", element.gridLightIndicesParam);
 
 
 		if (gpuParams->hasBuffer(GPT_FRAGMENT_PROGRAM, "gGridProbeOffsetsAndSize"))
 		if (gpuParams->hasBuffer(GPT_FRAGMENT_PROGRAM, "gGridProbeOffsetsAndSize"))
 			gpuParams->getBufferParam(GPT_FRAGMENT_PROGRAM, "gGridProbeOffsetsAndSize", element.gridProbeOffsetsAndSizeParam);
 			gpuParams->getBufferParam(GPT_FRAGMENT_PROGRAM, "gGridProbeOffsetsAndSize", element.gridProbeOffsetsAndSizeParam);