mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-28 07:45:40 +00:00
Merge pull request #2051 from lukaspj/correct-terrain-colors-linear
Fix for terrain detail color blending post-linearization
This commit is contained in:
commit
e15c4a7e62
2 changed files with 18 additions and 1 deletions
|
|
@ -615,9 +615,14 @@ void TerrainDetailMapFeatGLSL::processPix( Vector<ShaderComponent*> &component
|
||||||
meta->addStatement( new GenOp( " @ *= @.y * @.w;\r\n",
|
meta->addStatement( new GenOp( " @ *= @.y * @.w;\r\n",
|
||||||
detailColor, detailInfo, inDet ) );
|
detailColor, detailInfo, inDet ) );
|
||||||
|
|
||||||
meta->addStatement( new GenOp( " @ += @ * @;\r\n",
|
|
||||||
|
meta->addStatement(new GenOp(" @.rgb = toGamma(@.rgb);\r\n", outColor, outColor));
|
||||||
|
|
||||||
|
meta->addStatement(new GenOp(" @ += @ * @;\r\n",
|
||||||
outColor, detailColor, detailBlend));
|
outColor, detailColor, detailBlend));
|
||||||
|
|
||||||
|
meta->addStatement(new GenOp(" @.rgb = toLinear(clamp(@.rgb, 0, 1));\r\n", outColor, outColor));
|
||||||
|
|
||||||
meta->addStatement( new GenOp( " }\r\n" ) );
|
meta->addStatement( new GenOp( " }\r\n" ) );
|
||||||
|
|
||||||
output = meta;
|
output = meta;
|
||||||
|
|
@ -867,9 +872,13 @@ void TerrainMacroMapFeatGLSL::processPix( Vector<ShaderComponent*> &componentL
|
||||||
|
|
||||||
Var *outColor = (Var*)LangElement::find( getOutputTargetVarName(target) );
|
Var *outColor = (Var*)LangElement::find( getOutputTargetVarName(target) );
|
||||||
|
|
||||||
|
meta->addStatement(new GenOp(" @.rgb = toGamma(@.rgb);\r\n", outColor, outColor));
|
||||||
|
|
||||||
meta->addStatement(new GenOp(" @ += @ * @;\r\n",
|
meta->addStatement(new GenOp(" @ += @ * @;\r\n",
|
||||||
outColor, detailColor, detailBlend));
|
outColor, detailColor, detailBlend));
|
||||||
|
|
||||||
|
meta->addStatement(new GenOp(" @.rgb = toLinear(clamp(@.rgb, 0, 1));\r\n", outColor, outColor));
|
||||||
|
|
||||||
meta->addStatement( new GenOp( " }\r\n" ) );
|
meta->addStatement( new GenOp( " }\r\n" ) );
|
||||||
|
|
||||||
output = meta;
|
output = meta;
|
||||||
|
|
|
||||||
|
|
@ -582,9 +582,13 @@ void TerrainDetailMapFeatHLSL::processPix( Vector<ShaderComponent*> &component
|
||||||
|
|
||||||
Var *outColor = (Var*)LangElement::find( getOutputTargetVarName(target) );
|
Var *outColor = (Var*)LangElement::find( getOutputTargetVarName(target) );
|
||||||
|
|
||||||
|
meta->addStatement(new GenOp(" @.rgb = toGamma(@.rgb);\r\n", outColor, outColor));
|
||||||
|
|
||||||
meta->addStatement( new GenOp( " @ += @ * @;\r\n",
|
meta->addStatement( new GenOp( " @ += @ * @;\r\n",
|
||||||
outColor, detailColor, detailBlend));
|
outColor, detailColor, detailBlend));
|
||||||
|
|
||||||
|
meta->addStatement(new GenOp(" @.rgb = toLinear(clamp(@.rgb, 0, 1));\r\n", outColor, outColor));
|
||||||
|
|
||||||
meta->addStatement( new GenOp( " }\r\n" ) );
|
meta->addStatement( new GenOp( " }\r\n" ) );
|
||||||
|
|
||||||
output = meta;
|
output = meta;
|
||||||
|
|
@ -848,9 +852,13 @@ void TerrainMacroMapFeatHLSL::processPix( Vector<ShaderComponent*> &componentL
|
||||||
|
|
||||||
Var *outColor = (Var*)LangElement::find( getOutputTargetVarName(target) );
|
Var *outColor = (Var*)LangElement::find( getOutputTargetVarName(target) );
|
||||||
|
|
||||||
|
meta->addStatement(new GenOp(" @.rgb = toGamma(@.rgb);\r\n", outColor, outColor));
|
||||||
|
|
||||||
meta->addStatement(new GenOp(" @ += @ * @;\r\n",
|
meta->addStatement(new GenOp(" @ += @ * @;\r\n",
|
||||||
outColor, detailColor, detailBlend));
|
outColor, detailColor, detailBlend));
|
||||||
|
|
||||||
|
meta->addStatement(new GenOp(" @.rgb = toLinear(clamp(@.rgb, 0, 1));\r\n", outColor, outColor));
|
||||||
|
|
||||||
meta->addStatement( new GenOp( " }\r\n" ) );
|
meta->addStatement( new GenOp( " }\r\n" ) );
|
||||||
|
|
||||||
output = meta;
|
output = meta;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue