mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-27 02:23:47 +00:00
Goes and replaces the references/names that use Prepass to be Deferred, since we're actually using deferred.
This commit is contained in:
parent
b052a1f970
commit
af8fbf0e3a
122 changed files with 641 additions and 641 deletions
|
|
@ -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"
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ void DeferredRTLightingFeatHLSL::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 )
|
||||
|
|
@ -236,7 +236,7 @@ void DeferredRTLightingFeatHLSL::setTexData( Material::StageData &stageDat,
|
|||
void DeferredBumpFeatHLSL::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.
|
||||
|
|
@ -284,7 +284,7 @@ void DeferredBumpFeatHLSL::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;
|
||||
|
||||
|
|
@ -358,7 +358,7 @@ void DeferredBumpFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
|
|||
}
|
||||
|
||||
// This var is read from GBufferConditionerHLSL 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
|
||||
|
|
@ -500,7 +500,7 @@ ShaderFeature::Resources DeferredBumpFeatHLSL::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;
|
||||
|
|
@ -525,7 +525,7 @@ void DeferredBumpFeatHLSL::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";
|
||||
|
|
@ -539,14 +539,14 @@ void DeferredBumpFeatHLSL::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;
|
||||
|
|
@ -681,11 +681,11 @@ void DeferredMinnaertHLSL::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;
|
||||
}
|
||||
}
|
||||
|
|
@ -697,11 +697,11 @@ void DeferredMinnaertHLSL::processPixMacros( Vector<GFXShaderMacro> ¯os,
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -741,23 +741,23 @@ void DeferredMinnaertHLSL::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
|
||||
|
||||
Var* prePassTex = NULL;
|
||||
if (mIsDirect3D11)
|
||||
{
|
||||
prepassBuffer->setType("SamplerState");
|
||||
deferredBuffer->setType("SamplerState");
|
||||
prePassTex = new Var;
|
||||
prePassTex->setName("prePassTex");
|
||||
prePassTex->setType("Texture2D");
|
||||
prePassTex->uniform = true;
|
||||
prePassTex->texture = true;
|
||||
prePassTex->constNum = prepassBuffer->constNum;
|
||||
prePassTex->constNum = deferredBuffer->constNum;
|
||||
}
|
||||
|
||||
// Texture coord
|
||||
|
|
@ -769,14 +769,14 @@ void DeferredMinnaertHLSL::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" );
|
||||
|
||||
if (mIsDirect3D11)
|
||||
meta->addStatement(new GenOp(avar(" float4 normalDepth = %s(@, ,@, @);\r\n", unconditionPrePassMethod.c_str()), prepassBuffer, prePassTex, uvScene));
|
||||
meta->addStatement(new GenOp(avar(" float4 normalDepth = %s(@, ,@, @);\r\n", unconditionDeferredMethod.c_str()), deferredBuffer, prePassTex, uvScene));
|
||||
else
|
||||
meta->addStatement(new GenOp(avar(" float4 normalDepth = %s(@, @);\r\n", unconditionPrePassMethod.c_str()), prepassBuffer, uvScene));
|
||||
meta->addStatement(new GenOp(avar(" float4 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 ) );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue