mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-22 12:55:34 +00:00
Removes Direct3D9 functionality.
This commit is contained in:
parent
5e288e79d2
commit
7e5e3b5105
86 changed files with 382 additions and 10445 deletions
|
|
@ -38,7 +38,7 @@ namespace
|
|||
{
|
||||
void register_hlsl_shader_features_for_terrain(GFXAdapterType type)
|
||||
{
|
||||
if (type != Direct3D9 && type != Direct3D9_360 && type != Direct3D11)
|
||||
if (type != Direct3D11)
|
||||
return;
|
||||
|
||||
FEATUREMGR->registerFeature( MFT_TerrainBaseMap, new TerrainBaseMapFeatHLSL );
|
||||
|
|
@ -102,7 +102,6 @@ Var* TerrainFeatHLSL::_getInDetailCoord( Vector<ShaderComponent*> &componentList
|
|||
inDet->setName( name );
|
||||
inDet->setStructName( "IN" );
|
||||
inDet->setType( "float4" );
|
||||
inDet->mapsToSampler = true;
|
||||
}
|
||||
|
||||
return inDet;
|
||||
|
|
@ -121,7 +120,6 @@ Var* TerrainFeatHLSL::_getInMacroCoord( Vector<ShaderComponent*> &componentList
|
|||
inDet->setName( name );
|
||||
inDet->setStructName( "IN" );
|
||||
inDet->setType( "float4" );
|
||||
inDet->mapsToSampler = true;
|
||||
}
|
||||
|
||||
return inDet;
|
||||
|
|
@ -135,11 +133,7 @@ Var* TerrainFeatHLSL::_getNormalMapTex()
|
|||
if (!normalMap)
|
||||
{
|
||||
normalMap = new Var;
|
||||
if (mIsDirect3D11)
|
||||
normalMap->setType("SamplerState");
|
||||
else
|
||||
normalMap->setType("sampler2D");
|
||||
|
||||
normalMap->setType("SamplerState");
|
||||
normalMap->setName(name);
|
||||
normalMap->uniform = true;
|
||||
normalMap->sampler = true;
|
||||
|
|
@ -222,7 +216,6 @@ void TerrainBaseMapFeatHLSL::processVert( Vector<ShaderComponent*> &componentLis
|
|||
outTex->setName( "outTexCoord" );
|
||||
outTex->setStructName( "OUT" );
|
||||
outTex->setType( "float3" );
|
||||
outTex->mapsToSampler = true;
|
||||
meta->addStatement( new GenOp( " @.xy = @.xy;\r\n", outTex, inTex ) );
|
||||
|
||||
// If this shader has a side projected layer then we
|
||||
|
|
@ -256,11 +249,11 @@ void TerrainBaseMapFeatHLSL::processPix( Vector<ShaderComponent*> &componentLis
|
|||
const MaterialFeatureData &fd )
|
||||
{
|
||||
// grab connector texcoord register
|
||||
Var *texCoord = getInTexCoord( "texCoord", "float3", true, componentList );
|
||||
Var *texCoord = getInTexCoord( "texCoord", "float3", componentList );
|
||||
|
||||
// create texture var
|
||||
Var *diffuseMap = new Var;
|
||||
diffuseMap->setType( "sampler2D" );
|
||||
diffuseMap->setType( "SamplerState" );
|
||||
diffuseMap->setName( "baseTexMap" );
|
||||
diffuseMap->uniform = true;
|
||||
diffuseMap->sampler = true;
|
||||
|
|
@ -271,21 +264,14 @@ void TerrainBaseMapFeatHLSL::processPix( Vector<ShaderComponent*> &componentLis
|
|||
Var *baseColor = new Var;
|
||||
baseColor->setType( "float4" );
|
||||
baseColor->setName( "baseColor" );
|
||||
if (mIsDirect3D11)
|
||||
{
|
||||
diffuseMap->setType("SamplerState");
|
||||
Var *diffuseTex = new Var;
|
||||
diffuseTex->setType("Texture2D");
|
||||
diffuseTex->setName("baseTexture");
|
||||
diffuseTex->uniform = true;
|
||||
diffuseTex->texture = true;
|
||||
diffuseTex->constNum = diffuseMap->constNum;
|
||||
meta->addStatement(new GenOp(" @ = @.Sample( @, @.xy );\r\n", new DecOp(baseColor), diffuseTex, diffuseMap, texCoord));
|
||||
}
|
||||
else
|
||||
{
|
||||
meta->addStatement(new GenOp(" @ = tex2D( @, @.xy );\r\n", new DecOp(baseColor), diffuseMap, texCoord));
|
||||
}
|
||||
|
||||
Var *diffuseTex = new Var;
|
||||
diffuseTex->setType("Texture2D");
|
||||
diffuseTex->setName("baseTexture");
|
||||
diffuseTex->uniform = true;
|
||||
diffuseTex->texture = true;
|
||||
diffuseTex->constNum = diffuseMap->constNum;
|
||||
meta->addStatement(new GenOp(" @ = @.Sample( @, @.xy );\r\n", new DecOp(baseColor), diffuseTex, diffuseMap, texCoord));
|
||||
|
||||
meta->addStatement(new GenOp(" @ = toLinear(@);\r\n", baseColor, baseColor));
|
||||
|
||||
|
|
@ -381,7 +367,6 @@ void TerrainDetailMapFeatHLSL::processVert( Vector<ShaderComponent*> &component
|
|||
outTex->setName( String::ToString( "detCoord%d", detailIndex ) );
|
||||
outTex->setStructName( "OUT" );
|
||||
outTex->setType( "float4" );
|
||||
outTex->mapsToSampler = true;
|
||||
|
||||
// Get the detail scale and fade info.
|
||||
Var *detScaleAndFade = new Var;
|
||||
|
|
@ -446,31 +431,21 @@ void TerrainDetailMapFeatHLSL::processPix( Vector<ShaderComponent*> &component
|
|||
|
||||
// Get the layer texture var
|
||||
Var *layerTex = new Var;
|
||||
layerTex->setType( "sampler2D" );
|
||||
layerTex->setType( "SamplerState" );
|
||||
layerTex->setName( "layerTex" );
|
||||
layerTex->uniform = true;
|
||||
layerTex->sampler = true;
|
||||
layerTex->constNum = Var::getTexUnitNum();
|
||||
|
||||
if (mIsDirect3D11)
|
||||
{
|
||||
layerTex->setType("SamplerState");
|
||||
Var* layerTexObj = new Var;
|
||||
layerTexObj->setName("layerTexObj");
|
||||
layerTexObj->setType("Texture2D");
|
||||
layerTexObj->uniform = true;
|
||||
layerTexObj->texture = true;
|
||||
layerTexObj->constNum = layerTex->constNum;
|
||||
// Read the layer texture to get the samples.
|
||||
meta->addStatement(new GenOp(" @ = round( @.Sample( @, @.xy ) * 255.0f );\r\n",
|
||||
new DecOp(layerSample), layerTexObj, layerTex, inTex));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Read the layer texture to get the samples.
|
||||
meta->addStatement(new GenOp(" @ = round( tex2D( @, @.xy ) * 255.0f );\r\n",
|
||||
new DecOp(layerSample), layerTex, inTex));
|
||||
}
|
||||
Var* layerTexObj = new Var;
|
||||
layerTexObj->setName("layerTexObj");
|
||||
layerTexObj->setType("Texture2D");
|
||||
layerTexObj->uniform = true;
|
||||
layerTexObj->texture = true;
|
||||
layerTexObj->constNum = layerTex->constNum;
|
||||
// Read the layer texture to get the samples.
|
||||
meta->addStatement(new GenOp(" @ = round( @.Sample( @, @.xy ) * 255.0f );\r\n",
|
||||
new DecOp(layerSample), layerTexObj, layerTex, inTex));
|
||||
}
|
||||
|
||||
Var *layerSize = (Var*)LangElement::find( "layerSize" );
|
||||
|
|
@ -519,47 +494,29 @@ void TerrainDetailMapFeatHLSL::processPix( Vector<ShaderComponent*> &component
|
|||
// Get the rest of our inputs.
|
||||
Var *normalMap = _getNormalMapTex();
|
||||
|
||||
if (mIsDirect3D11)
|
||||
String name(String::ToString("normalMapTex%d", getProcessIndex()));
|
||||
Var *normalMapTex = (Var*)LangElement::find(name);
|
||||
|
||||
if (!normalMapTex)
|
||||
{
|
||||
String name(String::ToString("normalMapTex%d", getProcessIndex()));
|
||||
Var *normalMapTex = (Var*)LangElement::find(name);
|
||||
|
||||
if (!normalMapTex)
|
||||
{
|
||||
normalMapTex = new Var;
|
||||
normalMapTex->setName(String::ToString("normalMapTex%d", getProcessIndex()));
|
||||
normalMapTex->setType("Texture2D");
|
||||
normalMapTex->uniform = true;
|
||||
normalMapTex->texture = true;
|
||||
normalMapTex->constNum = normalMap->constNum;
|
||||
}
|
||||
|
||||
// Call the library function to do the rest.
|
||||
if (fd.features.hasFeature(MFT_IsDXTnm, detailIndex))
|
||||
{
|
||||
meta->addStatement(new GenOp(" @.xy += parallaxOffsetDxtnm( @, @, @.xy, @, @.z * @ );\r\n",
|
||||
inDet, normalMapTex, normalMap, inDet, negViewTS, detailInfo, detailBlend));
|
||||
}
|
||||
else
|
||||
{
|
||||
meta->addStatement(new GenOp(" @.xy += parallaxOffset( @, @, @.xy, @, @.z * @ );\r\n",
|
||||
inDet, normalMapTex, normalMap, inDet, negViewTS, detailInfo, detailBlend));
|
||||
}
|
||||
normalMapTex = new Var;
|
||||
normalMapTex->setName(String::ToString("normalMapTex%d", getProcessIndex()));
|
||||
normalMapTex->setType("Texture2D");
|
||||
normalMapTex->uniform = true;
|
||||
normalMapTex->texture = true;
|
||||
normalMapTex->constNum = normalMap->constNum;
|
||||
}
|
||||
|
||||
// Call the library function to do the rest.
|
||||
if (fd.features.hasFeature(MFT_IsDXTnm, detailIndex))
|
||||
{
|
||||
meta->addStatement(new GenOp(" @.xy += parallaxOffsetDxtnm( @, @, @.xy, @, @.z * @ );\r\n",
|
||||
inDet, normalMapTex, normalMap, inDet, negViewTS, detailInfo, detailBlend));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Call the library function to do the rest.
|
||||
if (fd.features.hasFeature(MFT_IsDXTnm, detailIndex))
|
||||
{
|
||||
meta->addStatement(new GenOp(" @.xy += parallaxOffsetDxtnm( @, @.xy, @, @.z * @ );\r\n",
|
||||
inDet, normalMap, inDet, negViewTS, detailInfo, detailBlend));
|
||||
}
|
||||
else
|
||||
{
|
||||
meta->addStatement(new GenOp(" @.xy += parallaxOffset( @, @.xy, @, @.z * @ );\r\n",
|
||||
inDet, normalMap, inDet, negViewTS, detailInfo, detailBlend));
|
||||
}
|
||||
meta->addStatement(new GenOp(" @.xy += parallaxOffset( @, @, @.xy, @, @.z * @ );\r\n",
|
||||
inDet, normalMapTex, normalMap, inDet, negViewTS, detailInfo, detailBlend));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -574,7 +531,7 @@ void TerrainDetailMapFeatHLSL::processPix( Vector<ShaderComponent*> &component
|
|||
|
||||
// Get the detail texture.
|
||||
Var *detailMap = new Var;
|
||||
detailMap->setType( "sampler2D" );
|
||||
detailMap->setType( "SamplerState" );
|
||||
detailMap->setName( String::ToString( "detailMap%d", detailIndex ) );
|
||||
detailMap->uniform = true;
|
||||
detailMap->sampler = true;
|
||||
|
|
@ -598,41 +555,23 @@ void TerrainDetailMapFeatHLSL::processPix( Vector<ShaderComponent*> &component
|
|||
//
|
||||
|
||||
//Sampled detail texture that is not expanded
|
||||
if (mIsDirect3D11)
|
||||
Var* detailTex = new Var;
|
||||
detailTex->setName(String::ToString("detailTex%d", detailIndex));
|
||||
detailTex->setType("Texture2D");
|
||||
detailTex->uniform = true;
|
||||
detailTex->texture = true;
|
||||
detailTex->constNum = detailMap->constNum;
|
||||
|
||||
if (fd.features.hasFeature(MFT_TerrainSideProject, detailIndex))
|
||||
{
|
||||
detailMap->setType("SamplerState");
|
||||
Var* detailTex = new Var;
|
||||
detailTex->setName(String::ToString("detailTex%d", detailIndex));
|
||||
detailTex->setType("Texture2D");
|
||||
detailTex->uniform = true;
|
||||
detailTex->texture = true;
|
||||
detailTex->constNum = detailMap->constNum;
|
||||
|
||||
if (fd.features.hasFeature(MFT_TerrainSideProject, detailIndex))
|
||||
{
|
||||
|
||||
meta->addStatement(new GenOp(" @ = ( lerp( @.Sample( @, @.yz ), @.Sample( @, @.xz ), @.z ) * 2.0 ) - 1.0;\r\n",
|
||||
detailColor, detailTex, detailMap, inDet, detailTex, detailMap, inDet, inTex));
|
||||
}
|
||||
else
|
||||
{
|
||||
meta->addStatement(new GenOp(" @ = ( @.Sample( @, @.xy ) * 2.0 ) - 1.0;\r\n",
|
||||
detailColor, detailTex, detailMap, inDet));
|
||||
}
|
||||
meta->addStatement(new GenOp(" @ = ( lerp( @.Sample( @, @.yz ), @.Sample( @, @.xz ), @.z ) * 2.0 ) - 1.0;\r\n",
|
||||
detailColor, detailTex, detailMap, inDet, detailTex, detailMap, inDet, inTex));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fd.features.hasFeature(MFT_TerrainSideProject, detailIndex))
|
||||
{
|
||||
|
||||
meta->addStatement(new GenOp(" @ = ( lerp( tex2D( @, @.yz ), tex2D( @, @.xz ), @.z ) * 2.0 ) - 1.0;\r\n",
|
||||
detailColor, detailMap, inDet, detailMap, inDet, inTex));
|
||||
}
|
||||
else
|
||||
{
|
||||
meta->addStatement(new GenOp(" @ = ( tex2D( @, @.xy ) * 2.0 ) - 1.0;\r\n",
|
||||
detailColor, detailMap, inDet));
|
||||
}
|
||||
meta->addStatement(new GenOp(" @ = ( @.Sample( @, @.xy ) * 2.0 ) - 1.0;\r\n",
|
||||
detailColor, detailTex, detailMap, inDet));
|
||||
}
|
||||
|
||||
meta->addStatement( new GenOp( " @ *= @.y * @.w;\r\n",
|
||||
|
|
@ -739,7 +678,6 @@ void TerrainMacroMapFeatHLSL::processVert( Vector<ShaderComponent*> &componentL
|
|||
outTex->setName( String::ToString( "macroCoord%d", detailIndex ) );
|
||||
outTex->setStructName( "OUT" );
|
||||
outTex->setType( "float4" );
|
||||
outTex->mapsToSampler = true;
|
||||
|
||||
// Get the detail scale and fade info.
|
||||
Var *detScaleAndFade = new Var;
|
||||
|
|
@ -797,28 +735,21 @@ void TerrainMacroMapFeatHLSL::processPix( Vector<ShaderComponent*> &componentL
|
|||
|
||||
// Get the layer texture var
|
||||
Var *layerTex = new Var;
|
||||
layerTex->setType( "sampler2D" );
|
||||
layerTex->setType( "SamplerState" );
|
||||
layerTex->setName( "macrolayerTex" );
|
||||
layerTex->uniform = true;
|
||||
layerTex->sampler = true;
|
||||
layerTex->constNum = Var::getTexUnitNum();
|
||||
|
||||
// Read the layer texture to get the samples.
|
||||
if (mIsDirect3D11)
|
||||
{
|
||||
layerTex->setType("SamplerState");
|
||||
Var *layerTexObj = new Var;
|
||||
layerTexObj->setType("Texture2D");
|
||||
layerTexObj->setName("macroLayerTexObj");
|
||||
layerTexObj->uniform = true;
|
||||
layerTexObj->texture = true;
|
||||
layerTexObj->constNum = layerTex->constNum;
|
||||
meta->addStatement(new GenOp(" @ = round( @.Sample( @, @.xy ) * 255.0f );\r\n",
|
||||
new DecOp(layerSample), layerTexObj, layerTex, inTex));
|
||||
}
|
||||
else
|
||||
meta->addStatement(new GenOp(" @ = round( tex2D( @, @.xy ) * 255.0f );\r\n",
|
||||
new DecOp(layerSample), layerTex, inTex));
|
||||
Var *layerTexObj = new Var;
|
||||
layerTexObj->setType("Texture2D");
|
||||
layerTexObj->setName("macroLayerTexObj");
|
||||
layerTexObj->uniform = true;
|
||||
layerTexObj->texture = true;
|
||||
layerTexObj->constNum = layerTex->constNum;
|
||||
meta->addStatement(new GenOp(" @ = round( @.Sample( @, @.xy ) * 255.0f );\r\n",
|
||||
new DecOp(layerSample), layerTexObj, layerTex, inTex));
|
||||
}
|
||||
|
||||
Var *layerSize = (Var*)LangElement::find( "layerSize" );
|
||||
|
|
@ -870,25 +801,19 @@ void TerrainMacroMapFeatHLSL::processPix( Vector<ShaderComponent*> &componentL
|
|||
|
||||
// Get the detail texture.
|
||||
Var *detailMap = new Var;
|
||||
detailMap->setType( "sampler2D" );
|
||||
detailMap->setType( "SamplerState" );
|
||||
detailMap->setName( String::ToString( "macroMap%d", detailIndex ) );
|
||||
detailMap->uniform = true;
|
||||
detailMap->sampler = true;
|
||||
detailMap->constNum = Var::getTexUnitNum(); // used as texture unit num here
|
||||
|
||||
//Create texture object for directx 11
|
||||
Var *detailTex = NULL;
|
||||
if (mIsDirect3D11)
|
||||
{
|
||||
detailMap->setType("SamplerState");
|
||||
detailTex = new Var;
|
||||
detailTex->setName(String::ToString("macroMapTex%d", detailIndex));
|
||||
detailTex->setType("Texture2D");
|
||||
detailTex->uniform = true;
|
||||
detailTex->texture = true;
|
||||
detailTex->constNum = detailMap->constNum;
|
||||
|
||||
}
|
||||
Var *detailTex = new Var;
|
||||
detailTex->setName(String::ToString("macroMapTex%d", detailIndex));
|
||||
detailTex->setType("Texture2D");
|
||||
detailTex->uniform = true;
|
||||
detailTex->texture = true;
|
||||
detailTex->constNum = detailMap->constNum;
|
||||
|
||||
// If we're using SM 3.0 then take advantage of
|
||||
// dynamic branching to skip layers per-pixel.
|
||||
|
|
@ -906,23 +831,13 @@ void TerrainMacroMapFeatHLSL::processPix( Vector<ShaderComponent*> &componentL
|
|||
//
|
||||
if (fd.features.hasFeature(MFT_TerrainSideProject, detailIndex))
|
||||
{
|
||||
if (mIsDirect3D11)
|
||||
{
|
||||
meta->addStatement(new GenOp(" @ = ( lerp( @.Sample( @, @.yz ), @.Sample( @, @.xz ), @.z ) * 2.0 ) - 1.0;\r\n",
|
||||
detailColor, detailTex, detailMap, inDet, detailTex, detailMap, inDet, inTex));
|
||||
}
|
||||
else
|
||||
meta->addStatement(new GenOp(" @ = ( lerp( tex2D( @, @.yz ), tex2D( @, @.xz ), @.z ) * 2.0 ) - 1.0;\r\n",
|
||||
detailColor, detailMap, inDet, detailMap, inDet, inTex));
|
||||
meta->addStatement(new GenOp(" @ = ( lerp( @.Sample( @, @.yz ), @.Sample( @, @.xz ), @.z ) * 2.0 ) - 1.0;\r\n",
|
||||
detailColor, detailTex, detailMap, inDet, detailTex, detailMap, inDet, inTex));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mIsDirect3D11)
|
||||
meta->addStatement(new GenOp(" @ = ( @.Sample( @, @.xy ) * 2.0 ) - 1.0;\r\n",
|
||||
meta->addStatement(new GenOp(" @ = ( @.Sample( @, @.xy ) * 2.0 ) - 1.0;\r\n",
|
||||
detailColor, detailTex, detailMap, inDet));
|
||||
else
|
||||
meta->addStatement(new GenOp(" @ = ( tex2D( @, @.xy ) * 2.0 ) - 1.0;\r\n",
|
||||
detailColor, detailMap, inDet));
|
||||
}
|
||||
|
||||
meta->addStatement( new GenOp( " @ *= @.y * @.w;\r\n",
|
||||
|
|
@ -1027,39 +942,26 @@ void TerrainNormalMapFeatHLSL::processPix( Vector<ShaderComponent*> &component
|
|||
// We take two normal samples and lerp between them for
|
||||
// side projection layers... else a single sample.
|
||||
LangElement *texOp;
|
||||
if (mIsDirect3D11)
|
||||
|
||||
String name(String::ToString("normalMapTex%d", getProcessIndex()));
|
||||
Var *normalMapTex = (Var*)LangElement::find(name);
|
||||
if (!normalMapTex)
|
||||
{
|
||||
String name(String::ToString("normalMapTex%d", getProcessIndex()));
|
||||
Var *normalMapTex = (Var*)LangElement::find(name);
|
||||
if (!normalMapTex)
|
||||
{
|
||||
normalMapTex = new Var;
|
||||
normalMapTex->setName(String::ToString("normalMapTex%d", getProcessIndex()));
|
||||
normalMapTex->setType("Texture2D");
|
||||
normalMapTex->uniform = true;
|
||||
normalMapTex->texture = true;
|
||||
normalMapTex->constNum = normalMap->constNum;
|
||||
}
|
||||
if (fd.features.hasFeature(MFT_TerrainSideProject, normalIndex))
|
||||
{
|
||||
texOp = new GenOp("lerp( @.Sample( @, @.yz ), @.Sample( @, @.xz ), @.z )",
|
||||
normalMapTex, normalMap, inDet, normalMapTex, normalMap, inDet, inTex);
|
||||
}
|
||||
else
|
||||
texOp = new GenOp("@.Sample(@, @.xy)", normalMapTex, normalMap, inDet);
|
||||
|
||||
normalMapTex = new Var;
|
||||
normalMapTex->setName(String::ToString("normalMapTex%d", getProcessIndex()));
|
||||
normalMapTex->setType("Texture2D");
|
||||
normalMapTex->uniform = true;
|
||||
normalMapTex->texture = true;
|
||||
normalMapTex->constNum = normalMap->constNum;
|
||||
}
|
||||
|
||||
if (fd.features.hasFeature(MFT_TerrainSideProject, normalIndex))
|
||||
{
|
||||
texOp = new GenOp("lerp( @.Sample( @, @.yz ), @.Sample( @, @.xz ), @.z )",
|
||||
normalMapTex, normalMap, inDet, normalMapTex, normalMap, inDet, inTex);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fd.features.hasFeature(MFT_TerrainSideProject, normalIndex))
|
||||
{
|
||||
texOp = new GenOp("lerp( tex2D( @, @.yz ), tex2D( @, @.xz ), @.z )",
|
||||
normalMap, inDet, normalMap, inDet, inTex);
|
||||
}
|
||||
else
|
||||
texOp = new GenOp("tex2D(@, @.xy)", normalMap, inDet);
|
||||
}
|
||||
texOp = new GenOp("@.Sample(@, @.xy)", normalMapTex, normalMap, inDet);
|
||||
|
||||
// create bump normal
|
||||
Var *bumpNorm = new Var;
|
||||
|
|
@ -1116,7 +1018,7 @@ void TerrainLightMapFeatHLSL::processPix( Vector<ShaderComponent*> &componentLis
|
|||
|
||||
// Get the lightmap texture.
|
||||
Var *lightMap = new Var;
|
||||
lightMap->setType( "sampler2D" );
|
||||
lightMap->setType( "SamplerState" );
|
||||
lightMap->setName( "lightMapTex" );
|
||||
lightMap->uniform = true;
|
||||
lightMap->sampler = true;
|
||||
|
|
@ -1137,19 +1039,13 @@ void TerrainLightMapFeatHLSL::processPix( Vector<ShaderComponent*> &componentLis
|
|||
meta->addStatement( new GenOp( " @ = 1;\r\n", new DecOp( lightMask ) ) );
|
||||
}
|
||||
|
||||
if (mIsDirect3D11)
|
||||
{
|
||||
lightMap->setType("SamplerState");
|
||||
Var* lightMapTex = new Var;
|
||||
lightMapTex->setName("lightMapTexObj");
|
||||
lightMapTex->setType("Texture2D");
|
||||
lightMapTex->uniform = true;
|
||||
lightMapTex->texture = true;
|
||||
lightMapTex->constNum = lightMap->constNum;
|
||||
meta->addStatement(new GenOp(" @[0] = @.Sample( @, @.xy ).r;\r\n", lightMask, lightMapTex, lightMap, inTex));
|
||||
}
|
||||
else
|
||||
meta->addStatement(new GenOp(" @[0] = tex2D( @, @.xy ).r;\r\n", lightMask, lightMap, inTex));
|
||||
Var* lightMapTex = new Var;
|
||||
lightMapTex->setName("lightMapTexObj");
|
||||
lightMapTex->setType("Texture2D");
|
||||
lightMapTex->uniform = true;
|
||||
lightMapTex->texture = true;
|
||||
lightMapTex->constNum = lightMap->constNum;
|
||||
meta->addStatement(new GenOp(" @[0] = @.Sample( @, @.xy ).r;\r\n", lightMask, lightMapTex, lightMap, inTex));
|
||||
|
||||
output = meta;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue