mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +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
1 changed files with 7 additions and 2 deletions
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include "materials/materialFeatureTypes.h"
|
#include "materials/materialFeatureTypes.h"
|
||||||
#include "materials/materialFeatureData.h"
|
#include "materials/materialFeatureData.h"
|
||||||
|
#include "terrain/terrFeatureTypes.h"
|
||||||
|
|
||||||
void EyeSpaceDepthOutGLSL::processVert( Vector<ShaderComponent*> &componentList,
|
void EyeSpaceDepthOutGLSL::processVert( Vector<ShaderComponent*> &componentList,
|
||||||
const MaterialFeatureData &fd )
|
const MaterialFeatureData &fd )
|
||||||
|
|
@ -85,7 +85,12 @@ void EyeSpaceDepthOutGLSL::processPix( Vector<ShaderComponent*> &componentList,
|
||||||
LangElement *depthOutDecl = new DecOp( depthOut );
|
LangElement *depthOutDecl = new DecOp( depthOut );
|
||||||
|
|
||||||
meta->addStatement( new GenOp( "#ifndef CUBE_SHADOW_MAP\r\n" ) );
|
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" ) );
|
meta->addStatement( new GenOp( "#else\r\n" ) );
|
||||||
|
|
||||||
Var *farDist = (Var*)Var::find( "oneOverFarplane" );
|
Var *farDist = (Var*)Var::find( "oneOverFarplane" );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue