mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-03 20:40:35 +00:00
Blinn-Phong Specular Changes
Based on the work done here: http://www.garagegames.com/community/blogs/view/21032
This commit is contained in:
parent
f5246bb809
commit
17113d3ba5
25 changed files with 167 additions and 26 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue