mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
add an ignoreLighting entry to materials
by request:, flag to utterly ignore lighting in favor of the base texture
This commit is contained in:
parent
f903140d22
commit
57037080b2
15 changed files with 78 additions and 9 deletions
|
|
@ -276,6 +276,10 @@ vec4 compute4Lights( Surface surface,
|
|||
vec4 vectorLightingColor,
|
||||
float vectorLightBrightness )
|
||||
{
|
||||
if (getFlag(surface.matFlag, 2))
|
||||
{
|
||||
return surface.baseColor;
|
||||
}
|
||||
vec3 finalLighting = vec3(0.0f);
|
||||
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -277,8 +277,11 @@ float4 compute4Lights( Surface surface,
|
|||
float4 vectorLightingColor,
|
||||
float vectorLightBrightness )
|
||||
{
|
||||
if (getFlag(surface.matFlag, 2))
|
||||
{
|
||||
return surface.baseColor;
|
||||
}
|
||||
float3 finalLighting = 0.0.xxx;
|
||||
|
||||
int i;
|
||||
for(i = 0; i < MAX_FORWARD_LIGHT; i++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -147,6 +147,11 @@ void main()
|
|||
Surface surface = createSurface( normDepth, colorBuffer, matInfoBuffer,
|
||||
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
||||
|
||||
if (getFlag(surface.matFlag, 2))
|
||||
{
|
||||
OUT_col = surface.baseColor;
|
||||
return;
|
||||
}
|
||||
vec3 L = lightPosition - surface.P;
|
||||
float dist = length(L);
|
||||
vec3 lighting = vec3(0.0);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,11 @@ void main()
|
|||
|
||||
//create surface
|
||||
Surface surface = createSurface(normDepth, colorBuffer, matInfoBuffer, IN_uv0.xy, eyePosWorld, IN_wsEyeRay, cameraToWorld);
|
||||
|
||||
if (getFlag(surface.matFlag, 2))
|
||||
{
|
||||
OUT_col = surface.baseColor;
|
||||
return;
|
||||
}
|
||||
#ifdef USE_SSAO_MASK
|
||||
float ssao = 1.0 - texture( ssaoMask, viewportCoordToRenderTarget( IN_uv0.xy, rtParams7 ) ).r;
|
||||
surface.ao = min(surface.ao, ssao);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,11 @@ void main()
|
|||
//create surface
|
||||
Surface surface = createSurface( normDepth, colorBuffer,matInfoBuffer,
|
||||
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
||||
|
||||
if (getFlag(surface.matFlag, 2))
|
||||
{
|
||||
OUT_col = surface.baseColor;
|
||||
return;
|
||||
}
|
||||
vec3 L = lightPosition - surface.P;
|
||||
float dist = length(L);
|
||||
vec3 lighting = vec3(0.0);
|
||||
|
|
|
|||
|
|
@ -186,7 +186,11 @@ void main()
|
|||
//create surface
|
||||
Surface surface = createSurface( normDepth, colorBuffer, matInfoBuffer,
|
||||
uv0, eyePosWorld, wsEyeRay, cameraToWorld);
|
||||
|
||||
if (getFlag(surface.matFlag, 2))
|
||||
{
|
||||
OUT_col = surface.baseColor;
|
||||
return;
|
||||
}
|
||||
//create surface to light
|
||||
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, -lightDirection);
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,10 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
|
|||
//create surface
|
||||
Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
||||
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
||||
|
||||
if (getFlag(surface.matFlag, 2))
|
||||
{
|
||||
return surface.baseColor;
|
||||
}
|
||||
float3 L = lightPosition - surface.P;
|
||||
float dist = length(L);
|
||||
float3 lighting = 0.0.xxx;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,12 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
//create surface
|
||||
Surface surface = createSurface(normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
||||
IN.uv0.xy, eyePosWorld, IN.wsEyeRay, cameraToWorld);
|
||||
|
||||
|
||||
if (getFlag(surface.matFlag, 2))
|
||||
{
|
||||
return surface.baseColor;
|
||||
}
|
||||
|
||||
#ifdef USE_SSAO_MASK
|
||||
float ssao = 1.0 - TORQUE_TEX2D( ssaoMask, viewportCoordToRenderTarget( IN.uv0.xy, rtParams7 ) ).r;
|
||||
surface.ao = min(surface.ao, ssao);
|
||||
|
|
|
|||
|
|
@ -85,7 +85,10 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
|
|||
//create surface
|
||||
Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
||||
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
||||
|
||||
if (getFlag(surface.matFlag, 2))
|
||||
{
|
||||
return surface.baseColor;
|
||||
}
|
||||
float3 L = lightPosition - surface.P;
|
||||
float dist = length(L);
|
||||
float3 lighting = 0.0.xxx;
|
||||
|
|
|
|||
|
|
@ -176,7 +176,10 @@ float4 main(FarFrustumQuadConnectP IN) : SV_TARGET
|
|||
//create surface
|
||||
Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
||||
IN.uv0, eyePosWorld, IN.wsEyeRay, cameraToWorld);
|
||||
|
||||
if (getFlag(surface.matFlag, 2))
|
||||
{
|
||||
return surface.baseColor;
|
||||
}
|
||||
//create surface to light
|
||||
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, -lightDirection);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue