瀏覽代碼

'better' (read here less completely craptacular) blending for boxes

Azaezel 6 年之前
父節點
當前提交
6248b427bf
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      Templates/Full/game/shaders/common/lighting/advanced/reflectionProbeP.hlsl

+ 5 - 4
Templates/Full/game/shaders/common/lighting/advanced/reflectionProbeP.hlsl

@@ -115,16 +115,17 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
 	if(useSphereMode)
 	{
 		float3 L = probeWSPos - surface.P;
-		blendVal = 1.0-length(L)/radius;		
+		blendVal = 1.0-length(L)/radius;
+		clip(blendVal);		
 	}
 	else
 	{
 		float tempAttenVal = 3.5;
 		blendVal = defineBoxSpaceInfluence(surface.P, probeWSPos, radius, tempAttenVal);
+		clip(blendVal);
+		float compression = 0.05;
+		blendVal=(1.0-compression)+blendVal*compression;
 	}
-   clip(blendVal);
-	
-
 	//render into the bound space defined above
 	float3 surfToEye = normalize(surface.P - eyePosWorld);
 	float3 irradiance = TORQUE_TEXCUBELOD(irradianceCubemap, float4(surface.N,0)).xyz;