mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-03 20:40:35 +00:00
emissive fix: return the surface.basecolor in place of zeros emissive is at minimum non-shadowed. TODO: consult folks on if they want a multiplier, mask, or mix for further customization there.
This commit is contained in:
parent
17d3531206
commit
d74055619f
3 changed files with 20 additions and 2 deletions
|
|
@ -173,7 +173,11 @@ LightTargetOutput main( ConvexConnectP IN )
|
|||
uvScene, eyePosWorld, eyeRay, cameraToWorld);
|
||||
//early out if emissive
|
||||
if (getFlag(surface.matFlag, 0))
|
||||
{
|
||||
Output.diffuse = surface.baseColor;
|
||||
Output.spec = surface.baseColor;
|
||||
return Output;
|
||||
}
|
||||
|
||||
// If we can do dynamic branching then avoid wasting
|
||||
// fillrate on pixels that are backfacing to the light.
|
||||
|
|
|
|||
|
|
@ -110,8 +110,12 @@ LightTargetOutput main( ConvexConnectP IN )
|
|||
uvScene, eyePosWorld, eyeRay, cameraToWorld);
|
||||
//early out if emissive
|
||||
if (getFlag(surface.matFlag, 0))
|
||||
{
|
||||
Output.diffuse = surface.baseColor;
|
||||
Output.spec = surface.baseColor;
|
||||
return Output;
|
||||
|
||||
}
|
||||
|
||||
//create surface to light
|
||||
float3 wsLightDir = mul(cameraToWorld, float4(lightDirection,0)).xyz;
|
||||
SurfaceToLight surfaceToLight = CreateSurfaceToLight(surface, -wsLightDir);
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ float4 AL_VectorLightShadowCast( TORQUE_SAMPLER2D(sourceShadowMap),
|
|||
#ifdef NO_SHADOW
|
||||
debugColor = float3(1.0,1.0,1.0);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PSSM_DEBUG_RENDER
|
||||
if ( finalMask.x > 0 )
|
||||
debugColor += float3( 1, 0, 0 );
|
||||
|
|
@ -194,6 +194,15 @@ LightTargetOutput main(FarFrustumQuadConnectP IN)
|
|||
//create surface
|
||||
Surface surface = CreateSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
||||
IN.uv0, eyePosWorld, IN.wsEyeRay, cameraToWorld);
|
||||
|
||||
//early out if emissive
|
||||
if (getFlag(surface.matFlag, 0))
|
||||
{
|
||||
Output.diffuse = surface.baseColor;
|
||||
Output.spec = surface.baseColor;
|
||||
return Output;
|
||||
}
|
||||
|
||||
//create surface to light
|
||||
float3 wsLightDir = mul(cameraToWorld, float4(lightDirection,0)).xyz;
|
||||
SurfaceToLight surfaceToLight = CreateSurfaceToLight(surface, -wsLightDir);
|
||||
|
|
@ -215,6 +224,7 @@ LightTargetOutput main(FarFrustumQuadConnectP IN)
|
|||
|
||||
float4 dynamic_shadowed_colors = AL_VectorLightShadowCast( TORQUE_SAMPLER2D_MAKEARG(dynamicShadowMap), IN.uv0.xy, dynamicWorldToLightProj, surface.P, dynamicScaleX,
|
||||
dynamicScaleY, dynamicOffsetX, dynamicOffsetY, dynamicFarPlaneScalePSSM, surfaceToLight.NdotL);
|
||||
|
||||
float static_shadowed = static_shadowed_colors.a;
|
||||
float dynamic_shadowed = dynamic_shadowed_colors.a;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue