Blinn-Phong Specular Changes

Based on the work done here:
http://www.garagegames.com/community/blogs/view/21032
This commit is contained in:
DavidWyand-GG 2013-10-29 15:10:23 -04:00
parent f5246bb809
commit 17113d3ba5
25 changed files with 167 additions and 26 deletions

View file

@ -465,6 +465,12 @@ void DeferredPixelSpecularHLSL::processPix( Vector<ShaderComponent*> &component
specPow->constSortPos = cspPotentialPrimitive;
}
Var *specStrength = new Var;
specStrength->setType( "float" );
specStrength->setName( "specularStrength" );
specStrength->uniform = true;
specStrength->constSortPos = cspPotentialPrimitive;
Var *lightInfoSamp = (Var *)LangElement::find( "lightInfoSample" );
Var *d_specular = (Var*)LangElement::find( "d_specular" );
Var *d_NL_Att = (Var*)LangElement::find( "d_NL_Att" );
@ -474,7 +480,7 @@ void DeferredPixelSpecularHLSL::processPix( Vector<ShaderComponent*> &component
// (a^m)^n = a^(m*n)
meta->addStatement( new GenOp( " @ = pow( @, ceil(@ / AL_ConstantSpecularPower)) * @;\r\n",
specDecl, d_specular, specPow, d_NL_Att ) );
specDecl, d_specular, specPow, specStrength ) );
LangElement *specMul = new GenOp( "float4( @.rgb, 0 ) * @", specCol, specular );
LangElement *final = specMul;