Browse Source

put sphereical influence back via the new spherical attenuation methods, shifted the stateblock for probes specifically to max of either source or desitination alpha (though not entirely convinced that is in fact the case)

Azaezel 6 years ago
parent
commit
4ef1a25610

+ 1 - 1
Engine/source/lighting/probeManager.cpp

@@ -780,7 +780,7 @@ bool ReflectProbeMatInstance::setupPass(SceneRenderState *state, const SceneData
 		desc.setZReadWrite(false);
 		desc.setZReadWrite(false);
 		desc.zWriteEnable = false;
 		desc.zWriteEnable = false;
 		desc.setCullMode(GFXCullNone);
 		desc.setCullMode(GFXCullNone);
-		desc.setBlend(true, GFXBlendSrcAlpha, GFXBlendInvDestAlpha, GFXBlendOpAdd);
+		desc.setBlend(true, GFXBlendSrcAlpha, GFXBlendDestAlpha, GFXBlendOpMax);
 		mProjectionState = GFX->createStateBlock(desc);
 		mProjectionState = GFX->createStateBlock(desc);
 	}
 	}
 	// Now override stateblock with our own
 	// Now override stateblock with our own

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

@@ -111,10 +111,21 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
    //create surface
    //create surface
    Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
    Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
                                     uvScene, eyePosWorld, wsEyeRay, cameraToWorld);		  
                                     uvScene, eyePosWorld, wsEyeRay, cameraToWorld);		  
-
-   float tempAttenVal = 3.5;
-   float blendVal = defineBoxSpaceInfluence(surface.P, probeWSPos, radius, tempAttenVal);
-	clip(blendVal);
+	float blendVal = 1.0;
+	if(useSphereMode)
+	{
+		float3 L = probeWSPos - surface.P;
+		blendVal = getDistanceAtt(L, radius);
+		if (length(L)>radius)
+			blendVal = -1;
+		
+	}
+	else
+	{
+		float tempAttenVal = 3.5;
+		blendVal = defineBoxSpaceInfluence(surface.P, probeWSPos, radius, tempAttenVal);
+	}
+   clip(blendVal);
 	
 	
 
 
 	//render into the bound space defined above
 	//render into the bound space defined above