mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 19:53:48 +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
|
|
@ -51,7 +51,7 @@ Var *AdvancedLightBufferConditioner::_conditionOutput( Var *unconditionedOutput,
|
|||
if(getBufferFormat() == GFXFormatR16G16B16A16)
|
||||
meta->addStatement( new GenOp( " @ = max(4.0, (float4(lightColor, specular) * NL_att + float4(bufferSample.rgb, 0.0)) / 4.0);\r\n", outputDecl ) );
|
||||
else
|
||||
meta->addStatement( new GenOp( " @ = float4(lightColor, specular) * NL_att + float4(bufferSample.rgb, 0.0);\r\n", outputDecl ) );
|
||||
meta->addStatement( new GenOp( " @ = float4(lightColor, 0) * NL_att + float4(bufferSample.rgb, specular);\r\n", outputDecl ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -80,7 +80,7 @@ Var *AdvancedLightBufferConditioner::_unconditionInput( Var *conditionedInput, M
|
|||
meta->addStatement( new GenOp( " NL_att = @.b;\r\n", conditionedInput ) );
|
||||
meta->addStatement( new GenOp( " lightColor = DecodeLuv(float3(saturate(NL_att), @.rg * 0.62));\r\n", conditionedInput ) );
|
||||
}
|
||||
meta->addStatement( new GenOp( " specular = max(@.a / NL_att, 0.00001f);\r\n", conditionedInput ) );
|
||||
meta->addStatement( new GenOp( " specular = @.a;\r\n", conditionedInput ) );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue