mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Merge pull request #1115 from Lopuska/patch-14
Jeff Faust's terrain fix also in OpenGL
This commit is contained in:
commit
68d3e84c08
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "materials/materialFeatureTypes.h"
|
||||
#include "materials/materialFeatureData.h"
|
||||
|
||||
#include "terrain/terrFeatureTypes.h"
|
||||
|
||||
void EyeSpaceDepthOutGLSL::processVert( Vector<ShaderComponent*> &componentList,
|
||||
const MaterialFeatureData &fd )
|
||||
|
|
@ -85,7 +85,12 @@ void EyeSpaceDepthOutGLSL::processPix( Vector<ShaderComponent*> &componentList,
|
|||
LangElement *depthOutDecl = new DecOp( depthOut );
|
||||
|
||||
meta->addStatement( new GenOp( "#ifndef CUBE_SHADOW_MAP\r\n" ) );
|
||||
meta->addStatement( new GenOp( " @ = dot(@, (@.xyz / @.w));\r\n", depthOutDecl, vEye, wsEyeVec, wsEyeVec ) );
|
||||
|
||||
if (fd.features.hasFeature(MFT_TerrainBaseMap))
|
||||
meta->addStatement(new GenOp(" @ =min(0.9999, dot(@, (@.xyz / @.w)));\r\n", depthOutDecl, vEye, wsEyeVec, wsEyeVec));
|
||||
else
|
||||
meta->addStatement(new GenOp(" @ = dot(@, (@.xyz / @.w));\r\n", depthOutDecl, vEye, wsEyeVec, wsEyeVec));
|
||||
|
||||
meta->addStatement( new GenOp( "#else\r\n" ) );
|
||||
|
||||
Var *farDist = (Var*)Var::find( "oneOverFarplane" );
|
||||
|
|
|
|||
Loading…
Reference in a new issue