mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
diffuse/albedo texture linearization
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html
This commit is contained in:
parent
51b6469922
commit
ce2964d2d0
31 changed files with 396 additions and 107 deletions
|
|
@ -64,6 +64,12 @@ MODULE_BEGIN( TerrainFeatHLSL )
|
|||
MODULE_END;
|
||||
|
||||
|
||||
TerrainFeatHLSL::TerrainFeatHLSL()
|
||||
: mTorqueDep( "shaders/common/torque.hlsl" )
|
||||
{
|
||||
addDependency( &mTorqueDep );
|
||||
}
|
||||
|
||||
Var* TerrainFeatHLSL::_getUniformVar( const char *name, const char *type, ConstantSortPosition csp )
|
||||
{
|
||||
Var *theVar = (Var*)LangElement::find( name );
|
||||
|
|
@ -262,6 +268,7 @@ void TerrainBaseMapFeatHLSL::processPix( Vector<ShaderComponent*> &componentLis
|
|||
baseColor->setType( "float4" );
|
||||
baseColor->setName( "baseColor" );
|
||||
meta->addStatement( new GenOp( " @ = tex2D( @, @.xy );\r\n", new DecOp( baseColor ), diffuseMap, texCoord ) );
|
||||
meta->addStatement(new GenOp(" @ = toLinear(@);\r\n", baseColor, baseColor));
|
||||
meta->addStatement( new GenOp( " @;\r\n", assignColor( baseColor, Material::Mul ) ) );
|
||||
|
||||
output = meta;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue