mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
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)
This commit is contained in:
parent
8dad81e494
commit
d3eb2f7784
2 changed files with 16 additions and 5 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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 blendVal = 1.0;
|
||||||
float tempAttenVal = 3.5;
|
if(useSphereMode)
|
||||||
float blendVal = defineBoxSpaceInfluence(surface.P, probeWSPos, radius, tempAttenVal);
|
{
|
||||||
clip(blendVal);
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue