Goes and replaces the references/names that use Prepass to be Deferred, since we're actually using deferred.

This commit is contained in:
Areloch 2017-04-11 00:23:14 -05:00
parent b052a1f970
commit af8fbf0e3a
122 changed files with 641 additions and 641 deletions

View file

@ -27,7 +27,7 @@
#include "shaderGen/langElement.h"
#include "shaderGen/shaderOp.h"
#include "shaderGen/conditionerFeature.h"
#include "renderInstance/renderPrePassMgr.h"
#include "renderInstance/renderDeferredMgr.h"
#include "materials/processedMaterial.h"
#include "materials/materialFeatureTypes.h"
@ -144,7 +144,7 @@ void DeferredRTLightingFeatGLSL::processPix( Vector<ShaderComponent*> &component
unconditionLightInfo.c_str() ), lightInfoBuffer, uvScene, d_lightcolor, d_NL_Att, d_specular ) );
// If this has an interlaced pre-pass, do averaging here
if( fd.features[MFT_InterlacedPrePass] )
if( fd.features[MFT_InterlacedDeferred] )
{
Var *oneOverTargetSize = (Var*) LangElement::find( "oneOverTargetSize" );
if( !oneOverTargetSize )
@ -216,7 +216,7 @@ void DeferredRTLightingFeatGLSL::setTexData( Material::StageData &stageDat,
void DeferredBumpFeatGLSL::processVert( Vector<ShaderComponent*> &componentList,
const MaterialFeatureData &fd )
{
if( fd.features[MFT_PrePassConditioner] )
if( fd.features[MFT_DeferredConditioner] )
{
// There is an output conditioner active, so we need to supply a transform
// to the pixel shader.
@ -264,7 +264,7 @@ void DeferredBumpFeatGLSL::processPix( Vector<ShaderComponent*> &componentList,
// NULL output in case nothing gets handled
output = NULL;
if( fd.features[MFT_PrePassConditioner] )
if( fd.features[MFT_DeferredConditioner] )
{
MultiLine *meta = new MultiLine;
@ -312,7 +312,7 @@ void DeferredBumpFeatGLSL::processPix( Vector<ShaderComponent*> &componentList,
}
// This var is read from GBufferConditionerGLSL and
// used in the prepass output.
// used in the deferred output.
//
// By using the 'half' type here we get a bunch of partial
// precision optimized code on further operations on the normal
@ -425,7 +425,7 @@ ShaderFeature::Resources DeferredBumpFeatGLSL::getResources( const MaterialFeatu
res.numTex = 1;
res.numTexReg = 1;
if ( fd.features[MFT_PrePassConditioner] &&
if ( fd.features[MFT_DeferredConditioner] &&
fd.features.hasFeature( MFT_DetailNormalMap ) )
{
res.numTex += 1;
@ -450,7 +450,7 @@ void DeferredBumpFeatGLSL::setTexData( Material::StageData &stageDat,
return;
}
if (!fd.features[MFT_PrePassConditioner] && fd.features[MFT_AccuMap])
if (!fd.features[MFT_DeferredConditioner] && fd.features[MFT_AccuMap])
{
passData.mTexType[texIndex] = Material::Bump;
passData.mSamplerNames[texIndex] = "bumpMap";
@ -464,14 +464,14 @@ void DeferredBumpFeatGLSL::setTexData( Material::StageData &stageDat,
}
}
else if (!fd.features[MFT_Parallax] && !fd.features[MFT_SpecularMap] &&
( fd.features[MFT_PrePassConditioner] ||
( fd.features[MFT_DeferredConditioner] ||
fd.features[MFT_PixSpecular] ) )
{
passData.mTexType[ texIndex ] = Material::Bump;
passData.mSamplerNames[ texIndex ] = "bumpMap";
passData.mTexSlot[ texIndex++ ].texObject = stageDat.getTex( MFT_NormalMap );
if ( fd.features[MFT_PrePassConditioner] &&
if ( fd.features[MFT_DeferredConditioner] &&
fd.features.hasFeature( MFT_DetailNormalMap ) )
{
passData.mTexType[ texIndex ] = Material::DetailBump;
@ -604,11 +604,11 @@ void DeferredMinnaertGLSL::setTexData( Material::StageData &stageDat,
{
if( !fd.features[MFT_ForwardShading] && fd.features[MFT_RTLighting] )
{
NamedTexTarget *texTarget = NamedTexTarget::find(RenderPrePassMgr::BufferName);
NamedTexTarget *texTarget = NamedTexTarget::find(RenderDeferredMgr::BufferName);
if ( texTarget )
{
passData.mTexType[texIndex] = Material::TexTarget;
passData.mSamplerNames[texIndex] = "prepassBuffer";
passData.mSamplerNames[texIndex] = "deferredBuffer";
passData.mTexSlot[ texIndex++ ].texTarget = texTarget;
}
}
@ -620,11 +620,11 @@ void DeferredMinnaertGLSL::processPixMacros( Vector<GFXShaderMacro> &macros,
if( !fd.features[MFT_ForwardShading] && fd.features[MFT_RTLighting] )
{
// Pull in the uncondition method for the g buffer
NamedTexTarget *texTarget = NamedTexTarget::find( RenderPrePassMgr::BufferName );
NamedTexTarget *texTarget = NamedTexTarget::find( RenderDeferredMgr::BufferName );
if ( texTarget && texTarget->getConditioner() )
{
ConditionerMethodDependency *unconditionMethod = texTarget->getConditioner()->getConditionerMethodDependency(ConditionerFeature::UnconditionMethod);
unconditionMethod->createMethodMacro( String::ToLower(RenderPrePassMgr::BufferName) + "Uncondition", macros );
unconditionMethod->createMethodMacro( String::ToLower(RenderDeferredMgr::BufferName) + "Uncondition", macros );
addDependency(unconditionMethod);
}
}
@ -664,12 +664,12 @@ void DeferredMinnaertGLSL::processPix( Vector<ShaderComponent*> &componentList,
minnaertConstant->constSortPos = cspPotentialPrimitive;
// create texture var
Var *prepassBuffer = new Var;
prepassBuffer->setType( "sampler2D" );
prepassBuffer->setName( "prepassBuffer" );
prepassBuffer->uniform = true;
prepassBuffer->sampler = true;
prepassBuffer->constNum = Var::getTexUnitNum(); // used as texture unit num here
Var *deferredBuffer = new Var;
deferredBuffer->setType( "sampler2D" );
deferredBuffer->setName( "deferredBuffer" );
deferredBuffer->uniform = true;
deferredBuffer->sampler = true;
deferredBuffer->constNum = Var::getTexUnitNum(); // used as texture unit num here
// Texture coord
Var *uvScene = (Var*) LangElement::find( "uvScene" );
@ -680,11 +680,11 @@ void DeferredMinnaertGLSL::processPix( Vector<ShaderComponent*> &componentList,
// Get the world space view vector.
Var *wsViewVec = getWsView( getInWsPosition( componentList ), meta );
String unconditionPrePassMethod = String::ToLower(RenderPrePassMgr::BufferName) + "Uncondition";
String unconditionDeferredMethod = String::ToLower(RenderDeferredMgr::BufferName) + "Uncondition";
Var *d_NL_Att = (Var*)LangElement::find( "d_NL_Att" );
meta->addStatement( new GenOp( avar( " vec4 normalDepth = %s(@, @);\r\n", unconditionPrePassMethod.c_str() ), prepassBuffer, uvScene ) );
meta->addStatement( new GenOp( avar( " vec4 normalDepth = %s(@, @);\r\n", unconditionDeferredMethod.c_str() ), deferredBuffer, uvScene ) );
meta->addStatement( new GenOp( " float vDotN = dot(normalDepth.xyz, @);\r\n", wsViewVec ) );
meta->addStatement( new GenOp( " float Minnaert = pow( @, @) * pow(vDotN, 1.0 - @);\r\n", d_NL_Att, minnaertConstant, minnaertConstant ) );
meta->addStatement( new GenOp( " @;\r\n", assignColor( new GenOp( "vec4(Minnaert, Minnaert, Minnaert, 1.0)" ), Material::Mul ) ) );

View file

@ -30,13 +30,13 @@
class ConditionerMethodDependency;
/// Lights the pixel by sampling from the light prepass
/// Lights the pixel by sampling from the light deferred
/// buffer. It will fall back to forward lighting
/// functionality for non-deferred rendered surfaces.
///
/// Also note that this feature is only used in the
/// forward rendering pass. It is not used during the
/// prepass step.
/// deferred step.
///
class DeferredRTLightingFeatGLSL : public RTLightingFeatGLSL
{
@ -103,7 +103,7 @@ public:
/// Generates specular highlights in the forward pass
/// from the light prepass buffer.
/// from the light deferred buffer.
class DeferredPixelSpecularGLSL : public PixelSpecularGLSL
{
typedef PixelSpecularGLSL Parent;

View file

@ -27,7 +27,7 @@
#include "shaderGen/langElement.h"
#include "shaderGen/shaderOp.h"
#include "shaderGen/conditionerFeature.h"
#include "renderInstance/renderPrePassMgr.h"
#include "renderInstance/renderDeferredMgr.h"
#include "materials/processedMaterial.h"
#include "materials/materialFeatureTypes.h"

View file

@ -163,7 +163,7 @@ void GBufferConditionerGLSL::processPix( Vector<ShaderComponent*> &componentLis
LangElement *outputDecl = new DecOp( unconditionedOut );
// If we're doing prepass blending then we need
// If we're doing deferred blending then we need
// to steal away the alpha channel before the
// conditioner stomps on it.
Var *alphaVal = NULL;
@ -174,7 +174,7 @@ void GBufferConditionerGLSL::processPix( Vector<ShaderComponent*> &componentLis
}
// If using interlaced normals, invert the normal
if(fd.features[MFT_InterlacedPrePass])
if(fd.features[MFT_InterlacedDeferred])
{
// NOTE: Its safe to not call ShaderFeatureGLSL::addOutVpos() in the vertex
// shader as for SM 3.0 nothing is needed there.
@ -190,7 +190,7 @@ void GBufferConditionerGLSL::processPix( Vector<ShaderComponent*> &componentLis
meta->addStatement( new GenOp(" @ = @;", outputDecl, new GenOp( "float4(normalize(@), @)", gbNormal, depth ) ) );
meta->addStatement( assignOutput( unconditionedOut ) );
// If we have an alpha var then we're doing prepass lerp blending.
// If we have an alpha var then we're doing deferred lerp blending.
if ( alphaVal )
{
Var *outColor = (Var*)LangElement::find( getOutputTargetVarName( DefaultTarget ) );
@ -227,10 +227,10 @@ Var* GBufferConditionerGLSL::printMethodHeader( MethodType methodType, const Str
methodVar->setType("float4");
DecOp *methodDecl = new DecOp(methodVar);
Var *prepassSampler = new Var;
prepassSampler->setName("prepassSamplerVar");
prepassSampler->setType("sampler2D");
DecOp *prepassSamplerDecl = new DecOp(prepassSampler);
Var *deferredSampler = new Var;
deferredSampler->setName("deferredSamplerVar");
deferredSampler->setType("sampler2D");
DecOp *deferredSamplerDecl = new DecOp(deferredSampler);
Var *screenUV = new Var;
screenUV->setName("screenUVVar");
@ -242,7 +242,7 @@ Var* GBufferConditionerGLSL::printMethodHeader( MethodType methodType, const Str
bufferSample->setType("float4");
DecOp *bufferSampleDecl = new DecOp(bufferSample);
meta->addStatement( new GenOp( "@(@, @)\r\n", methodDecl, prepassSamplerDecl, screenUVDecl ) );
meta->addStatement( new GenOp( "@(@, @)\r\n", methodDecl, deferredSamplerDecl, screenUVDecl ) );
meta->addStatement( new GenOp( "{\r\n" ) );
@ -250,14 +250,14 @@ Var* GBufferConditionerGLSL::printMethodHeader( MethodType methodType, const Str
#ifdef TORQUE_OS_XENON
meta->addStatement( new GenOp( " @;\r\n", bufferSampleDecl ) );
meta->addStatement( new GenOp( " asm { tfetch2D @, @, @, MagFilter = point, MinFilter = point, MipFilter = point };\r\n", bufferSample, screenUV, prepassSampler ) );
meta->addStatement( new GenOp( " asm { tfetch2D @, @, @, MagFilter = point, MinFilter = point, MipFilter = point };\r\n", bufferSample, screenUV, deferredSampler ) );
#else
// The gbuffer has no mipmaps, so use tex2dlod when
// possible so that the shader compiler can optimize.
meta->addStatement( new GenOp( " #if TORQUE_SM >= 30\r\n" ) );
meta->addStatement( new GenOp( " @ = tex2Dlod(@, float4(@,0,0));\r\n", bufferSampleDecl, prepassSampler, screenUV ) );
meta->addStatement( new GenOp( " @ = tex2Dlod(@, float4(@,0,0));\r\n", bufferSampleDecl, deferredSampler, screenUV ) );
meta->addStatement( new GenOp( " #else\r\n" ) );
meta->addStatement( new GenOp( " @ = tex2D(@, @);\r\n", bufferSampleDecl, prepassSampler, screenUV ) );
meta->addStatement( new GenOp( " @ = tex2D(@, @);\r\n", bufferSampleDecl, deferredSampler, screenUV ) );
meta->addStatement( new GenOp( " #endif\r\n\r\n" ) );
#endif