mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
Merge pull request #943 from Azaezel/alpha403/emissiveToReciveShadows
emissive to recivesShadows
This commit is contained in:
commit
95b8028e5a
23 changed files with 80 additions and 128 deletions
|
|
@ -41,6 +41,7 @@
|
||||||
#include "materials/baseMatInstance.h"
|
#include "materials/baseMatInstance.h"
|
||||||
#include "materials/sceneData.h"
|
#include "materials/sceneData.h"
|
||||||
#include "environment/timeOfDay.h"
|
#include "environment/timeOfDay.h"
|
||||||
|
#include "materials/materialFeatureTypes.h"
|
||||||
|
|
||||||
|
|
||||||
ConsoleDocClass( ScatterSky,
|
ConsoleDocClass( ScatterSky,
|
||||||
|
|
@ -913,7 +914,12 @@ void ScatterSky::_initMoon()
|
||||||
|
|
||||||
if (mMoonMatAsset.notNull())
|
if (mMoonMatAsset.notNull())
|
||||||
{
|
{
|
||||||
mMoonMatInst = MATMGR->createMatInstance(mMoonMatAsset->getMaterialDefinitionName(), MATMGR->getDefaultFeatures(), getGFXVertexFormat<GFXVertexPCT>());
|
FeatureSet features = MATMGR->getDefaultFeatures();
|
||||||
|
features.removeFeature(MFT_RTLighting);
|
||||||
|
features.removeFeature(MFT_Visibility);
|
||||||
|
features.removeFeature(MFT_ReflectionProbes);
|
||||||
|
features.addFeature(MFT_isBackground);
|
||||||
|
mMoonMatInst = MATMGR->createMatInstance(mMoonMatAsset->getMaterialDefinitionName(), features, getGFXVertexFormat<GFXVertexPCT>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -572,7 +572,7 @@ void SkyBox::_initRender()
|
||||||
mFogBandMat->mTranslucent = true;
|
mFogBandMat->mTranslucent = true;
|
||||||
mFogBandMat->mVertColor[0] = true;
|
mFogBandMat->mVertColor[0] = true;
|
||||||
mFogBandMat->mDoubleSided = true;
|
mFogBandMat->mDoubleSided = true;
|
||||||
mFogBandMat->mEmissive[0] = true;
|
mFogBandMat->mReceiveShadows[0] = false;
|
||||||
|
|
||||||
FeatureSet features = MATMGR->getDefaultFeatures();
|
FeatureSet features = MATMGR->getDefaultFeatures();
|
||||||
features.addFeature(MFT_isBackground);
|
features.addFeature(MFT_isBackground);
|
||||||
|
|
@ -610,6 +610,7 @@ void SkyBox::_initMaterial()
|
||||||
FeatureSet features = MATMGR->getDefaultFeatures();
|
FeatureSet features = MATMGR->getDefaultFeatures();
|
||||||
features.removeFeature( MFT_RTLighting );
|
features.removeFeature( MFT_RTLighting );
|
||||||
features.removeFeature( MFT_Visibility );
|
features.removeFeature( MFT_Visibility );
|
||||||
|
features.removeFeature(MFT_ReflectionProbes);
|
||||||
features.addFeature(MFT_isBackground);
|
features.addFeature(MFT_isBackground);
|
||||||
features.addFeature(MFT_SkyBox);
|
features.addFeature(MFT_SkyBox);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -570,7 +570,7 @@ void SkySphere::_initRender()
|
||||||
mFogBandMat->mTranslucent = true;
|
mFogBandMat->mTranslucent = true;
|
||||||
mFogBandMat->mVertColor[0] = true;
|
mFogBandMat->mVertColor[0] = true;
|
||||||
mFogBandMat->mDoubleSided = true;
|
mFogBandMat->mDoubleSided = true;
|
||||||
mFogBandMat->mEmissive[0] = true;
|
mFogBandMat->mReceiveShadows[0] = false;
|
||||||
|
|
||||||
FeatureSet features = MATMGR->getDefaultFeatures();
|
FeatureSet features = MATMGR->getDefaultFeatures();
|
||||||
features.addFeature(MFT_isBackground);
|
features.addFeature(MFT_isBackground);
|
||||||
|
|
@ -608,6 +608,7 @@ void SkySphere::_initMaterial()
|
||||||
FeatureSet features = MATMGR->getDefaultFeatures();
|
FeatureSet features = MATMGR->getDefaultFeatures();
|
||||||
features.removeFeature(MFT_RTLighting);
|
features.removeFeature(MFT_RTLighting);
|
||||||
features.removeFeature(MFT_Visibility);
|
features.removeFeature(MFT_Visibility);
|
||||||
|
features.removeFeature(MFT_ReflectionProbes);
|
||||||
features.addFeature(MFT_isBackground);
|
features.addFeature(MFT_isBackground);
|
||||||
|
|
||||||
// Now initialize the material.
|
// Now initialize the material.
|
||||||
|
|
|
||||||
|
|
@ -384,8 +384,7 @@ bool MatInstance::processMaterial()
|
||||||
mUsesHardwareSkinning = finalFeatures.hasFeature( MFT_HardwareSkinning );
|
mUsesHardwareSkinning = finalFeatures.hasFeature( MFT_HardwareSkinning );
|
||||||
|
|
||||||
mIsForwardLit = ( custMat && custMat->mForwardLit ) ||
|
mIsForwardLit = ( custMat && custMat->mForwardLit ) ||
|
||||||
( !finalFeatures.hasFeature( MFT_IsEmissive ) &&
|
( finalFeatures.hasFeature( MFT_ForwardShading ) );
|
||||||
finalFeatures.hasFeature( MFT_ForwardShading ) );
|
|
||||||
|
|
||||||
mIsHardwareSkinned = finalFeatures.hasFeature( MFT_HardwareSkinning );
|
mIsHardwareSkinned = finalFeatures.hasFeature( MFT_HardwareSkinning );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ Material::Material()
|
||||||
mVertColor[i] = false;
|
mVertColor[i] = false;
|
||||||
|
|
||||||
mGlow[i] = false;
|
mGlow[i] = false;
|
||||||
mEmissive[i] = false;
|
mReceiveShadows[i] = true;
|
||||||
|
|
||||||
mDetailScale[i].set(2.0f, 2.0f);
|
mDetailScale[i].set(2.0f, 2.0f);
|
||||||
|
|
||||||
|
|
@ -345,7 +345,7 @@ void Material::initPersistFields()
|
||||||
addField("subSurfaceRolloff", TypeF32, Offset(mSubSurfaceRolloff, Material), MAX_STAGES,
|
addField("subSurfaceRolloff", TypeF32, Offset(mSubSurfaceRolloff, Material), MAX_STAGES,
|
||||||
"The 0 to 1 rolloff factor used in the subsurface scattering approximation.");
|
"The 0 to 1 rolloff factor used in the subsurface scattering approximation.");
|
||||||
|
|
||||||
addField("emissive", TypeBool, Offset(mEmissive, Material), MAX_STAGES,
|
addField("receiveShadows", TypeBool, Offset(mReceiveShadows, Material), MAX_STAGES,
|
||||||
"Enables emissive lighting for the material.");
|
"Enables emissive lighting for the material.");
|
||||||
|
|
||||||
addField("doubleSided", TypeBool, Offset(mDoubleSided, Material),
|
addField("doubleSided", TypeBool, Offset(mDoubleSided, Material),
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ public:
|
||||||
F32 mSeqSegSize[MAX_STAGES];
|
F32 mSeqSegSize[MAX_STAGES];
|
||||||
|
|
||||||
bool mGlow[MAX_STAGES]; // entire stage glows
|
bool mGlow[MAX_STAGES]; // entire stage glows
|
||||||
bool mEmissive[MAX_STAGES];
|
bool mReceiveShadows[MAX_STAGES];
|
||||||
|
|
||||||
Point2I mCellIndex[MAX_STAGES];
|
Point2I mCellIndex[MAX_STAGES];
|
||||||
Point2I mCellLayout[MAX_STAGES];
|
Point2I mCellLayout[MAX_STAGES];
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,6 @@ ImplementFeatureType( MFT_IsBC3nm, U32(-1), -1, true );
|
||||||
ImplementFeatureType( MFT_IsBC5nm, U32(-1), -1, true);
|
ImplementFeatureType( MFT_IsBC5nm, U32(-1), -1, true);
|
||||||
ImplementFeatureType( MFT_IsTranslucent, U32(-1), -1, true );
|
ImplementFeatureType( MFT_IsTranslucent, U32(-1), -1, true );
|
||||||
ImplementFeatureType( MFT_IsTranslucentZWrite, U32(-1), -1, true );
|
ImplementFeatureType( MFT_IsTranslucentZWrite, U32(-1), -1, true );
|
||||||
ImplementFeatureType( MFT_IsEmissive, U32(-1), -1, true );
|
|
||||||
ImplementFeatureType( MFT_DiffuseMapAtlas, U32(-1), -1, true );
|
ImplementFeatureType( MFT_DiffuseMapAtlas, U32(-1), -1, true );
|
||||||
ImplementFeatureType( MFT_NormalMapAtlas, U32(-1), -1, true );
|
ImplementFeatureType( MFT_NormalMapAtlas, U32(-1), -1, true );
|
||||||
ImplementFeatureType( MFT_InterlacedDeferred, U32(-1), -1, true );
|
ImplementFeatureType( MFT_InterlacedDeferred, U32(-1), -1, true );
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,6 @@ DeclareFeatureType( MFT_AlphaTest );
|
||||||
DeclareFeatureType( MFT_NormalMap );
|
DeclareFeatureType( MFT_NormalMap );
|
||||||
DeclareFeatureType( MFT_RTLighting );
|
DeclareFeatureType( MFT_RTLighting );
|
||||||
|
|
||||||
DeclareFeatureType( MFT_IsEmissive );
|
|
||||||
DeclareFeatureType( MFT_SubSurface );
|
DeclareFeatureType( MFT_SubSurface );
|
||||||
DeclareFeatureType( MFT_LightMap );
|
DeclareFeatureType( MFT_LightMap );
|
||||||
DeclareFeatureType( MFT_ToneMap );
|
DeclareFeatureType( MFT_ToneMap );
|
||||||
|
|
|
||||||
|
|
@ -254,7 +254,7 @@ BaseMatInstance * MaterialManager::createMeshDebugMatInstance(const LinearColorF
|
||||||
debugMat = allocateAndRegister( meshDebugStr );
|
debugMat = allocateAndRegister( meshDebugStr );
|
||||||
|
|
||||||
debugMat->mDiffuse[0] = meshColor;
|
debugMat->mDiffuse[0] = meshColor;
|
||||||
debugMat->mEmissive[0] = true;
|
debugMat->mReceiveShadows[0] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseMatInstance *debugMatInstance = NULL;
|
BaseMatInstance *debugMatInstance = NULL;
|
||||||
|
|
|
||||||
|
|
@ -353,15 +353,10 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum,
|
||||||
if ( mMaterial->mAlphaTest )
|
if ( mMaterial->mAlphaTest )
|
||||||
fd.features.addFeature( MFT_AlphaTest );
|
fd.features.addFeature( MFT_AlphaTest );
|
||||||
|
|
||||||
if (mMaterial->mEmissive[stageNum])
|
if (mMaterial->isTranslucent())
|
||||||
{
|
|
||||||
fd.features.addFeature(MFT_IsEmissive);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
fd.features.addFeature(MFT_RTLighting);
|
fd.features.addFeature(MFT_RTLighting);
|
||||||
if (mMaterial->isTranslucent())
|
fd.features.addFeature(MFT_ReflectionProbes);
|
||||||
fd.features.addFeature(MFT_ReflectionProbes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( mMaterial->mAnimFlags[stageNum] )
|
if ( mMaterial->mAnimFlags[stageNum] )
|
||||||
|
|
@ -1204,8 +1199,8 @@ void ProcessedShaderMaterial::_setShaderConstants(SceneRenderState * state, cons
|
||||||
|
|
||||||
// Deferred Shading: Determine Material Info Flags
|
// Deferred Shading: Determine Material Info Flags
|
||||||
S32 matInfoFlags =
|
S32 matInfoFlags =
|
||||||
(mMaterial->mEmissive[stageNum] ? 1 : 0) | //emissive
|
(mMaterial->mReceiveShadows[stageNum] ? 1 : 0) | //ReceiveShadows
|
||||||
(mMaterial->mSubSurface[stageNum] ? 2 : 0); //subsurface
|
(mMaterial->mSubSurface[stageNum] ? 1 << 2 : 0); //subsurface
|
||||||
mMaterial->mMatInfoFlags[stageNum] = matInfoFlags / 255.0f;
|
mMaterial->mMatInfoFlags[stageNum] = matInfoFlags / 255.0f;
|
||||||
shaderConsts->setSafe(handles->mMatInfoFlagsSC, mMaterial->mMatInfoFlags[stageNum]);
|
shaderConsts->setSafe(handles->mMatInfoFlagsSC, mMaterial->mMatInfoFlags[stageNum]);
|
||||||
if( handles->mAccuScaleSC->isValid() )
|
if( handles->mAccuScaleSC->isValid() )
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ void RenderOcclusionMgr::init()
|
||||||
|
|
||||||
mMaterial = MATMGR->allocateAndRegister( String::EmptyString );
|
mMaterial = MATMGR->allocateAndRegister( String::EmptyString );
|
||||||
mMaterial->mDiffuse[0] = LinearColorF( 1, 0, 1, 1 );
|
mMaterial->mDiffuse[0] = LinearColorF( 1, 0, 1, 1 );
|
||||||
mMaterial->mEmissive[0] = true;
|
mMaterial->mReceiveShadows[0] = false;
|
||||||
mMaterial->mAutoGenerated = true;
|
mMaterial->mAutoGenerated = true;
|
||||||
|
|
||||||
mMatInstance = mMaterial->createMatInstance();
|
mMatInstance = mMaterial->createMatInstance();
|
||||||
|
|
|
||||||
|
|
@ -323,7 +323,7 @@ void TerrainBaseMapFeatGLSL::processPix( Vector<ShaderComponent*> &componentLis
|
||||||
meta->addStatement(new GenOp(" @;\r\n", new DecOp(ormConfig)));
|
meta->addStatement(new GenOp(" @;\r\n", new DecOp(ormConfig)));
|
||||||
}
|
}
|
||||||
|
|
||||||
meta->addStatement(new GenOp(" @ = float4(0.0, 1.0, 1.0, 0.0);\r\n", ormConfig));
|
meta->addStatement(new GenOp(" @ = float4(1.0f/255.0f, 1.0, 1.0, 0.0);\r\n", ormConfig));
|
||||||
|
|
||||||
output = meta;
|
output = meta;
|
||||||
|
|
||||||
|
|
@ -1109,7 +1109,7 @@ void TerrainORMMapFeatGLSL::processPix(Vector<ShaderComponent*> &componentList,
|
||||||
}
|
}
|
||||||
if (compositeIndex == 0)
|
if (compositeIndex == 0)
|
||||||
{
|
{
|
||||||
meta->addStatement(new GenOp(" @ = vec4(0.0, 0.0, 0.0, 0.0);\r\n", ormConfig));
|
meta->addStatement(new GenOp(" @ = vec4(1.0f/255.0f, 1.0, 1.0, 0.0);\r\n", ormConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
Var *detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", compositeIndex));
|
Var *detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", compositeIndex));
|
||||||
|
|
@ -1176,7 +1176,7 @@ void TerrainBlankInfoMapFeatGLSL::processPix(Vector<ShaderComponent*> &component
|
||||||
|
|
||||||
if (compositeIndex == 0)
|
if (compositeIndex == 0)
|
||||||
{
|
{
|
||||||
meta->addStatement(new GenOp(" @ = float4(0.0, 0.0, 0.0, 0.0);\r\n", ormConfig));
|
meta->addStatement(new GenOp(" @ = float4(1.0f/255.0f, 1.0, 1.0, 0.0);\r\n", ormConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
Var* detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", compositeIndex));
|
Var* detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", compositeIndex));
|
||||||
|
|
|
||||||
|
|
@ -383,7 +383,7 @@ void TerrainBaseMapFeatHLSL::processPix(Vector<ShaderComponent*>& componentList,
|
||||||
meta->addStatement(new GenOp(" @;\r\n", new DecOp(ormConfig)));
|
meta->addStatement(new GenOp(" @;\r\n", new DecOp(ormConfig)));
|
||||||
}
|
}
|
||||||
|
|
||||||
meta->addStatement(new GenOp(" @ = float4(0.0, 1.0, 1.0, 0.0);\r\n", ormConfig));
|
meta->addStatement(new GenOp(" @ = float4(1.0f/255.0f, 1.0, 1.0, 0.0);\r\n", ormConfig));
|
||||||
|
|
||||||
output = meta;
|
output = meta;
|
||||||
}
|
}
|
||||||
|
|
@ -1191,7 +1191,7 @@ void TerrainORMMapFeatHLSL::processPix(Vector<ShaderComponent*> &componentList,
|
||||||
}
|
}
|
||||||
if (compositeIndex == 0)
|
if (compositeIndex == 0)
|
||||||
{
|
{
|
||||||
meta->addStatement(new GenOp(" @ = float4(0.0, 0.0, 0.0, 0.0);\r\n", ormConfig));
|
meta->addStatement(new GenOp(" @ = float4(1.0f/255.0f, 0.0, 0.0, 0.0);\r\n", ormConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
Var *detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", compositeIndex));
|
Var *detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", compositeIndex));
|
||||||
|
|
@ -1256,7 +1256,7 @@ void TerrainBlankInfoMapFeatHLSL::processPix(Vector<ShaderComponent*> &component
|
||||||
|
|
||||||
if (compositeIndex == 0)
|
if (compositeIndex == 0)
|
||||||
{
|
{
|
||||||
meta->addStatement(new GenOp(" @ = float4(0.0, 0.0, 0.0, 0.0);\r\n", ormConfig));
|
meta->addStatement(new GenOp(" @ = float4(1.0f/255.0f, 1.0, 1.0, 0.0);\r\n", ormConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
Var* detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", compositeIndex));
|
Var* detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", compositeIndex));
|
||||||
|
|
|
||||||
|
|
@ -147,13 +147,6 @@ void main()
|
||||||
Surface surface = createSurface( normDepth, colorBuffer, matInfoBuffer,
|
Surface surface = createSurface( normDepth, colorBuffer, matInfoBuffer,
|
||||||
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
||||||
|
|
||||||
//early out if emissive
|
|
||||||
if (getFlag(surface.matFlag, 0))
|
|
||||||
{
|
|
||||||
OUT_col = vec4(0, 0, 0, 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 L = lightPosition - surface.P;
|
vec3 L = lightPosition - surface.P;
|
||||||
float dist = length(L);
|
float dist = length(L);
|
||||||
vec3 lighting = vec3(0.0);
|
vec3 lighting = vec3(0.0);
|
||||||
|
|
@ -162,22 +155,22 @@ void main()
|
||||||
float distToLight = dist / lightRange;
|
float distToLight = dist / lightRange;
|
||||||
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, L);
|
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, L);
|
||||||
|
|
||||||
#ifdef NO_SHADOW
|
float shadow = 1.0;
|
||||||
float shadowed = 1.0;
|
#ifndef NO_SHADOW
|
||||||
#else
|
if (getFlag(surface.matFlag, 0)) //also skip if we don't recieve shadows
|
||||||
|
{
|
||||||
#ifdef SHADOW_CUBE
|
#ifdef SHADOW_CUBE
|
||||||
|
|
||||||
// TODO: We need to fix shadow cube to handle soft shadows!
|
// TODO: We need to fix shadow cube to handle soft shadows!
|
||||||
float occ = texture( shadowMap, tMul( worldToLightProj, -surfaceToLight.L ) ).r;
|
float occ = texture( shadowMap, tMul( worldToLightProj, -surfaceToLight.L ) ).r;
|
||||||
float shadowed = saturate( exp( lightParams.y * ( occ - distToLight ) ) );
|
shadow = saturate( exp( lightParams.y * ( occ - distToLight ) ) );
|
||||||
|
|
||||||
#else
|
#else
|
||||||
vec2 shadowCoord = decodeShadowCoord( tMul( worldToLightProj, -surfaceToLight.L ) ).xy;
|
vec2 shadowCoord = decodeShadowCoord( tMul( worldToLightProj, -surfaceToLight.L ) ).xy;
|
||||||
float shadowed = softShadow_filter(shadowMap, ssPos.xy/ssPos.w, shadowCoord, shadowSoftness, distToLight, surfaceToLight.NdotL, lightParams.y);
|
shadow = softShadow_filter(shadowMap, ssPos.xy/ssPos.w, shadowCoord, shadowSoftness, distToLight, surfaceToLight.NdotL, lightParams.y);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
#endif // !NO_SHADOW
|
#endif // !NO_SHADOW
|
||||||
|
|
||||||
vec3 lightCol = lightColor.rgb;
|
vec3 lightCol = lightColor.rgb;
|
||||||
#ifdef USE_COOKIE_TEX
|
#ifdef USE_COOKIE_TEX
|
||||||
|
|
@ -225,7 +218,7 @@ void main()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//get punctual light contribution
|
//get punctual light contribution
|
||||||
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed);
|
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
OUT_col = vec4(lighting, 0);
|
OUT_col = vec4(lighting, 0);
|
||||||
|
|
|
||||||
|
|
@ -56,13 +56,6 @@ void main()
|
||||||
//create surface
|
//create surface
|
||||||
Surface surface = createSurface(normDepth, colorBuffer, matInfoBuffer, IN_uv0.xy, eyePosWorld, IN_wsEyeRay, cameraToWorld);
|
Surface surface = createSurface(normDepth, colorBuffer, matInfoBuffer, IN_uv0.xy, eyePosWorld, IN_wsEyeRay, cameraToWorld);
|
||||||
|
|
||||||
//early out if emissive
|
|
||||||
if (getFlag(surface.matFlag, 0))
|
|
||||||
{
|
|
||||||
OUT_col = vec4(surface.albedo, 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef USE_SSAO_MASK
|
#ifdef USE_SSAO_MASK
|
||||||
float ssao = 1.0 - texture( ssaoMask, viewportCoordToRenderTarget( IN_uv0.xy, rtParams7 ) ).r;
|
float ssao = 1.0 - texture( ssaoMask, viewportCoordToRenderTarget( IN_uv0.xy, rtParams7 ) ).r;
|
||||||
surface.ao = min(surface.ao, ssao);
|
surface.ao = min(surface.ao, ssao);
|
||||||
|
|
|
||||||
|
|
@ -81,13 +81,6 @@ void main()
|
||||||
Surface surface = createSurface( normDepth, colorBuffer,matInfoBuffer,
|
Surface surface = createSurface( normDepth, colorBuffer,matInfoBuffer,
|
||||||
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
||||||
|
|
||||||
//early out if emissive
|
|
||||||
if (getFlag(surface.matFlag, 0))
|
|
||||||
{
|
|
||||||
OUT_col = vec4(0, 0, 0, 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 L = lightPosition - surface.P;
|
vec3 L = lightPosition - surface.P;
|
||||||
float dist = length(L);
|
float dist = length(L);
|
||||||
vec3 lighting = vec3(0.0);
|
vec3 lighting = vec3(0.0);
|
||||||
|
|
@ -96,9 +89,10 @@ void main()
|
||||||
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, L);
|
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, L);
|
||||||
vec3 lightCol = lightColor.rgb;
|
vec3 lightCol = lightColor.rgb;
|
||||||
|
|
||||||
#ifdef NO_SHADOW
|
float shadow = 1.0;
|
||||||
float shadowed = 1.0;
|
#ifndef NO_SHADOW
|
||||||
#else
|
if (getFlag(surface.matFlag, 0)) //also skip if we don't recieve shadows
|
||||||
|
{
|
||||||
// Get the shadow texture coordinate
|
// Get the shadow texture coordinate
|
||||||
vec4 pxlPosLightProj = tMul( worldToLightProj, vec4( surface.P, 1 ) );
|
vec4 pxlPosLightProj = tMul( worldToLightProj, vec4( surface.P, 1 ) );
|
||||||
vec2 shadowCoord = ( ( pxlPosLightProj.xy / pxlPosLightProj.w ) * 0.5 ) + vec2( 0.5, 0.5 );
|
vec2 shadowCoord = ( ( pxlPosLightProj.xy / pxlPosLightProj.w ) * 0.5 ) + vec2( 0.5, 0.5 );
|
||||||
|
|
@ -106,7 +100,7 @@ void main()
|
||||||
|
|
||||||
//distance to light in shadow map space
|
//distance to light in shadow map space
|
||||||
float distToLight = pxlPosLightProj.z / lightRange;
|
float distToLight = pxlPosLightProj.z / lightRange;
|
||||||
float shadowed = softShadow_filter(shadowMap, ssPos.xy/ssPos.w, shadowCoord, shadowSoftness, distToLight, surfaceToLight.NdotL, lightParams.y);
|
shadow = softShadow_filter(shadowMap, ssPos.xy/ssPos.w, shadowCoord, shadowSoftness, distToLight, surfaceToLight.NdotL, lightParams.y);
|
||||||
#ifdef USE_COOKIE_TEX
|
#ifdef USE_COOKIE_TEX
|
||||||
// Lookup the cookie sample.
|
// Lookup the cookie sample.
|
||||||
vec4 cookie = texture(cookieMap, shadowCoord);
|
vec4 cookie = texture(cookieMap, shadowCoord);
|
||||||
|
|
@ -117,6 +111,7 @@ void main()
|
||||||
// regions of the cookie texture.
|
// regions of the cookie texture.
|
||||||
lightCol *= max(cookie.r, max(cookie.g, cookie.b));
|
lightCol *= max(cookie.r, max(cookie.g, cookie.b));
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -156,7 +151,7 @@ void main()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//get Punctual light contribution
|
//get Punctual light contribution
|
||||||
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed);
|
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadow);
|
||||||
//get spot angle attenuation
|
//get spot angle attenuation
|
||||||
lighting *= getSpotAngleAtt(-surfaceToLight.L, lightDirection, lightSpotParams );
|
lighting *= getSpotAngleAtt(-surfaceToLight.L, lightDirection, lightSpotParams );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -187,23 +187,16 @@ void main()
|
||||||
Surface surface = createSurface( normDepth, colorBuffer, matInfoBuffer,
|
Surface surface = createSurface( normDepth, colorBuffer, matInfoBuffer,
|
||||||
uv0, eyePosWorld, wsEyeRay, cameraToWorld);
|
uv0, eyePosWorld, wsEyeRay, cameraToWorld);
|
||||||
|
|
||||||
//early out if emissive
|
|
||||||
if (getFlag(surface.matFlag, 0))
|
|
||||||
{
|
|
||||||
OUT_col = vec4(0, 0, 0, 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//create surface to light
|
//create surface to light
|
||||||
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, -lightDirection);
|
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, -lightDirection);
|
||||||
|
|
||||||
//light color might be changed by PSSM_DEBUG_RENDER
|
//light color might be changed by PSSM_DEBUG_RENDER
|
||||||
vec3 lightingColor = lightColor.rgb;
|
vec3 lightingColor = lightColor.rgb;
|
||||||
|
|
||||||
#ifdef NO_SHADOW
|
float shadow = 1.0;
|
||||||
float shadow = 1.0;
|
#ifndef NO_SHADOW
|
||||||
#else
|
if (getFlag(surface.matFlag, 0)) //also skip if we don't recieve shadows
|
||||||
|
{
|
||||||
// Fade out the shadow at the end of the range.
|
// Fade out the shadow at the end of the range.
|
||||||
vec4 zDist = vec4(zNearFarInvNearFar.x + zNearFarInvNearFar.y * surface.depth);
|
vec4 zDist = vec4(zNearFarInvNearFar.x + zNearFarInvNearFar.y * surface.depth);
|
||||||
float fadeOutAmt = ( zDist.x - fadeStartLength.x ) * fadeStartLength.y;
|
float fadeOutAmt = ( zDist.x - fadeStartLength.x ) * fadeStartLength.y;
|
||||||
|
|
@ -211,7 +204,7 @@ void main()
|
||||||
vec4 shadowed_colors = AL_VectorLightShadowCast( shadowMap, uv0.xy, worldToLightProj, surface.P, scaleX, scaleY, offsetX, offsetY,
|
vec4 shadowed_colors = AL_VectorLightShadowCast( shadowMap, uv0.xy, worldToLightProj, surface.P, scaleX, scaleY, offsetX, offsetY,
|
||||||
farPlaneScalePSSM, surfaceToLight.NdotL);
|
farPlaneScalePSSM, surfaceToLight.NdotL);
|
||||||
|
|
||||||
float shadow = shadowed_colors.a;
|
shadow = shadowed_colors.a;
|
||||||
|
|
||||||
#ifdef PSSM_DEBUG_RENDER
|
#ifdef PSSM_DEBUG_RENDER
|
||||||
lightingColor = shadowed_colors.rgb;
|
lightingColor = shadowed_colors.rgb;
|
||||||
|
|
@ -223,7 +216,7 @@ void main()
|
||||||
if ( fadeOutAmt > 1.0 )
|
if ( fadeOutAmt > 1.0 )
|
||||||
lightingColor = vec3(1.0,1.0,1.0);
|
lightingColor = vec3(1.0,1.0,1.0);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
#endif //NO_SHADOW
|
#endif //NO_SHADOW
|
||||||
|
|
||||||
#ifdef DIFFUSE_LIGHT_VIZ
|
#ifdef DIFFUSE_LIGHT_VIZ
|
||||||
|
|
|
||||||
|
|
@ -147,12 +147,6 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
|
||||||
Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
||||||
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
||||||
|
|
||||||
//early out if emissive
|
|
||||||
if (getFlag(surface.matFlag, 0))
|
|
||||||
{
|
|
||||||
return float4(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
float3 L = lightPosition - surface.P;
|
float3 L = lightPosition - surface.P;
|
||||||
float dist = length(L);
|
float dist = length(L);
|
||||||
float3 lighting = 0.0.xxx;
|
float3 lighting = 0.0.xxx;
|
||||||
|
|
@ -162,21 +156,21 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
|
||||||
float distToLight = dist / lightRange;
|
float distToLight = dist / lightRange;
|
||||||
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, L);
|
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, L);
|
||||||
|
|
||||||
#ifdef NO_SHADOW
|
float shadow = 1.0;
|
||||||
float shadowed = 1.0;
|
#ifndef NO_SHADOW
|
||||||
#else
|
if (getFlag(surface.matFlag, 0)) //also skip if we don't recieve shadows
|
||||||
|
{
|
||||||
#ifdef SHADOW_CUBE
|
#ifdef SHADOW_CUBE
|
||||||
|
|
||||||
// TODO: We need to fix shadow cube to handle soft shadows!
|
// TODO: We need to fix shadow cube to handle soft shadows!
|
||||||
float occ = TORQUE_TEXCUBE( shadowMap, mul( worldToLightProj, -surfaceToLight.L ) ).r;
|
float occ = TORQUE_TEXCUBE( shadowMap, mul( worldToLightProj, -surfaceToLight.L ) ).r;
|
||||||
float shadowed = saturate( exp( lightParams.y * ( occ - distToLight ) ) );
|
shadow = saturate( exp( lightParams.y * ( occ - distToLight ) ) );
|
||||||
|
|
||||||
#else
|
#else
|
||||||
float2 shadowCoord = decodeShadowCoord( mul( worldToLightProj, -surfaceToLight.L ) ).xy;
|
float2 shadowCoord = decodeShadowCoord( mul( worldToLightProj, -surfaceToLight.L ) ).xy;
|
||||||
float shadowed = softShadow_filter(TORQUE_SAMPLER2D_MAKEARG(shadowMap), ssPos.xy, shadowCoord, shadowSoftness, distToLight, surfaceToLight.NdotL, lightParams.y);
|
shadow = softShadow_filter(TORQUE_SAMPLER2D_MAKEARG(shadowMap), ssPos.xy, shadowCoord, shadowSoftness, distToLight, surfaceToLight.NdotL, lightParams.y);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
#endif // !NO_SHADOW
|
#endif // !NO_SHADOW
|
||||||
|
|
||||||
float3 lightCol = lightColor.rgb;
|
float3 lightCol = lightColor.rgb;
|
||||||
|
|
@ -221,7 +215,7 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//get punctual light contribution
|
//get punctual light contribution
|
||||||
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed);
|
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
return float4(lighting, 0);
|
return float4(lighting, 0);
|
||||||
|
|
|
||||||
|
|
@ -51,12 +51,6 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
||||||
Surface surface = createSurface(normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
Surface surface = createSurface(normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
||||||
IN.uv0.xy, eyePosWorld, IN.wsEyeRay, cameraToWorld);
|
IN.uv0.xy, eyePosWorld, IN.wsEyeRay, cameraToWorld);
|
||||||
|
|
||||||
//early out if emissive
|
|
||||||
if (getFlag(surface.matFlag, 0))
|
|
||||||
{
|
|
||||||
return float4(surface.albedo, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef USE_SSAO_MASK
|
#ifdef USE_SSAO_MASK
|
||||||
float ssao = 1.0 - TORQUE_TEX2D( ssaoMask, viewportCoordToRenderTarget( IN.uv0.xy, rtParams7 ) ).r;
|
float ssao = 1.0 - TORQUE_TEX2D( ssaoMask, viewportCoordToRenderTarget( IN.uv0.xy, rtParams7 ) ).r;
|
||||||
surface.ao = min(surface.ao, ssao);
|
surface.ao = min(surface.ao, ssao);
|
||||||
|
|
|
||||||
|
|
@ -86,12 +86,6 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
|
||||||
Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
||||||
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
||||||
|
|
||||||
//early out if emissive
|
|
||||||
if (getFlag(surface.matFlag, 0))
|
|
||||||
{
|
|
||||||
return float4(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
float3 L = lightPosition - surface.P;
|
float3 L = lightPosition - surface.P;
|
||||||
float dist = length(L);
|
float dist = length(L);
|
||||||
float3 lighting = 0.0.xxx;
|
float3 lighting = 0.0.xxx;
|
||||||
|
|
@ -101,16 +95,17 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
|
||||||
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, L);
|
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, L);
|
||||||
float3 lightCol = lightColor.rgb;
|
float3 lightCol = lightColor.rgb;
|
||||||
|
|
||||||
#ifdef NO_SHADOW
|
float shadow = 1.0;
|
||||||
float shadowed = 1.0;
|
#ifndef NO_SHADOW
|
||||||
#else
|
if (getFlag(surface.matFlag, 0)) //also skip if we don't recieve shadows
|
||||||
|
{
|
||||||
// Get the shadow texture coordinate
|
// Get the shadow texture coordinate
|
||||||
float4 pxlPosLightProj = mul( worldToLightProj, float4( surface.P, 1 ) );
|
float4 pxlPosLightProj = mul( worldToLightProj, float4( surface.P, 1 ) );
|
||||||
float2 shadowCoord = ( ( pxlPosLightProj.xy / pxlPosLightProj.w ) * 0.5 ) + float2( 0.5, 0.5 );
|
float2 shadowCoord = ( ( pxlPosLightProj.xy / pxlPosLightProj.w ) * 0.5 ) + float2( 0.5, 0.5 );
|
||||||
shadowCoord.y = 1.0f - shadowCoord.y;
|
shadowCoord.y = 1.0f - shadowCoord.y;
|
||||||
//distance to light in shadow map space
|
//distance to light in shadow map space
|
||||||
float distToLight = pxlPosLightProj.z / lightRange;
|
float distToLight = pxlPosLightProj.z / lightRange;
|
||||||
float shadowed = softShadow_filter(TORQUE_SAMPLER2D_MAKEARG(shadowMap), ssPos.xy, shadowCoord, shadowSoftness, distToLight, surfaceToLight.NdotL, lightParams.y);
|
shadow = softShadow_filter(TORQUE_SAMPLER2D_MAKEARG(shadowMap), ssPos.xy, shadowCoord, shadowSoftness, distToLight, surfaceToLight.NdotL, lightParams.y);
|
||||||
#ifdef USE_COOKIE_TEX
|
#ifdef USE_COOKIE_TEX
|
||||||
// Lookup the cookie sample.
|
// Lookup the cookie sample.
|
||||||
float4 cookie = TORQUE_TEX2D(cookieMap, shadowCoord);
|
float4 cookie = TORQUE_TEX2D(cookieMap, shadowCoord);
|
||||||
|
|
@ -121,6 +116,7 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
|
||||||
// regions of the cookie texture.
|
// regions of the cookie texture.
|
||||||
lightCol *= max(cookie.r, max(cookie.g, cookie.b));
|
lightCol *= max(cookie.r, max(cookie.g, cookie.b));
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DIFFUSE_LIGHT_VIZ
|
#ifdef DIFFUSE_LIGHT_VIZ
|
||||||
|
|
@ -153,7 +149,7 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//get Punctual light contribution
|
//get Punctual light contribution
|
||||||
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed);
|
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadow);
|
||||||
//get spot angle attenuation
|
//get spot angle attenuation
|
||||||
lighting *= getSpotAngleAtt(-surfaceToLight.L, lightDirection, lightSpotParams );
|
lighting *= getSpotAngleAtt(-surfaceToLight.L, lightDirection, lightSpotParams );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -177,22 +177,16 @@ float4 main(FarFrustumQuadConnectP IN) : SV_TARGET
|
||||||
Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
||||||
IN.uv0, eyePosWorld, IN.wsEyeRay, cameraToWorld);
|
IN.uv0, eyePosWorld, IN.wsEyeRay, cameraToWorld);
|
||||||
|
|
||||||
//early out if emissive
|
|
||||||
if (getFlag(surface.matFlag, 0))
|
|
||||||
{
|
|
||||||
return float4(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
//create surface to light
|
//create surface to light
|
||||||
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, -lightDirection);
|
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, -lightDirection);
|
||||||
|
|
||||||
//light color might be changed by PSSM_DEBUG_RENDER
|
//light color might be changed by PSSM_DEBUG_RENDER
|
||||||
float3 lightingColor = lightColor.rgb;
|
float3 lightingColor = lightColor.rgb;
|
||||||
|
|
||||||
#ifdef NO_SHADOW
|
float shadow = 1.0;
|
||||||
float shadow = 1.0;
|
#ifndef NO_SHADOW
|
||||||
#else
|
if (getFlag(surface.matFlag, 0)) //also skip if we don't recieve shadows
|
||||||
|
{
|
||||||
// Fade out the shadow at the end of the range.
|
// Fade out the shadow at the end of the range.
|
||||||
float4 zDist = (zNearFarInvNearFar.x + zNearFarInvNearFar.y * surface.depth);
|
float4 zDist = (zNearFarInvNearFar.x + zNearFarInvNearFar.y * surface.depth);
|
||||||
float fadeOutAmt = ( zDist.x - fadeStartLength.x ) * fadeStartLength.y;
|
float fadeOutAmt = ( zDist.x - fadeStartLength.x ) * fadeStartLength.y;
|
||||||
|
|
@ -200,7 +194,7 @@ float4 main(FarFrustumQuadConnectP IN) : SV_TARGET
|
||||||
float4 shadowed_colors = AL_VectorLightShadowCast( TORQUE_SAMPLER2D_MAKEARG(shadowMap), IN.uv0.xy, worldToLightProj, surface.P, scaleX, scaleY, offsetX, offsetY,
|
float4 shadowed_colors = AL_VectorLightShadowCast( TORQUE_SAMPLER2D_MAKEARG(shadowMap), IN.uv0.xy, worldToLightProj, surface.P, scaleX, scaleY, offsetX, offsetY,
|
||||||
farPlaneScalePSSM, surfaceToLight.NdotL);
|
farPlaneScalePSSM, surfaceToLight.NdotL);
|
||||||
|
|
||||||
float shadow = shadowed_colors.a;
|
shadow = shadowed_colors.a;
|
||||||
|
|
||||||
#ifdef PSSM_DEBUG_RENDER
|
#ifdef PSSM_DEBUG_RENDER
|
||||||
lightingColor = shadowed_colors.rgb;
|
lightingColor = shadowed_colors.rgb;
|
||||||
|
|
@ -212,7 +206,7 @@ float4 main(FarFrustumQuadConnectP IN) : SV_TARGET
|
||||||
if ( fadeOutAmt > 1.0 )
|
if ( fadeOutAmt > 1.0 )
|
||||||
lightingColor = 1.0;
|
lightingColor = 1.0;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
#endif //NO_SHADOW
|
#endif //NO_SHADOW
|
||||||
|
|
||||||
#ifdef DIFFUSE_LIGHT_VIZ
|
#ifdef DIFFUSE_LIGHT_VIZ
|
||||||
|
|
|
||||||
|
|
@ -3156,7 +3156,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
|
||||||
};
|
};
|
||||||
new GuiCheckBoxCtrl() {
|
new GuiCheckBoxCtrl() {
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
internalName = "emissiveCheckbox";
|
internalName = "receiveShadowsCheckbox";
|
||||||
Enabled = "1";
|
Enabled = "1";
|
||||||
isContainer = "0";
|
isContainer = "0";
|
||||||
Profile = "ToolsGuiCheckBoxProfile";
|
Profile = "ToolsGuiCheckBoxProfile";
|
||||||
|
|
@ -3167,11 +3167,11 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
|
||||||
MinExtent = "8 2";
|
MinExtent = "8 2";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
Visible = "1";
|
Visible = "1";
|
||||||
Command = "MaterialEditorGui.updateActiveMaterial(\"emissive[\" @ MaterialEditorGui.currentLayer @ \"]\",$ThisControl.getValue());";
|
Command = "MaterialEditorGui.updateActiveMaterial(\"receiveShadows[\" @ MaterialEditorGui.currentLayer @ \"]\",$ThisControl.getValue());";
|
||||||
tooltipprofile = "ToolsGuiDefaultProfile";
|
tooltipprofile = "ToolsGuiDefaultProfile";
|
||||||
ToolTip = "Emissive causes an object to not be affected by lights. Good for light sources.";
|
ToolTip = "Do we recieve shadows?";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
text = "Emissive";
|
text = "receiveShadows";
|
||||||
groupNum = "-1";
|
groupNum = "-1";
|
||||||
buttonType = "ToggleButton";
|
buttonType = "ToggleButton";
|
||||||
useMouseEvents = "0";
|
useMouseEvents = "0";
|
||||||
|
|
|
||||||
|
|
@ -935,7 +935,7 @@ function MaterialEditorGui::guiSync( %this, %material )
|
||||||
MaterialEditorPropertiesWindow-->glowMulTextEdit.setText((%material).glowMul[%layer]);
|
MaterialEditorPropertiesWindow-->glowMulTextEdit.setText((%material).glowMul[%layer]);
|
||||||
MaterialEditorPropertiesWindow-->glowMulSlider.setValue((%material).glowMul[%layer]);
|
MaterialEditorPropertiesWindow-->glowMulSlider.setValue((%material).glowMul[%layer]);
|
||||||
MaterialEditorPropertiesWindow-->glowCheckbox.setValue((%material).glow[%layer]);
|
MaterialEditorPropertiesWindow-->glowCheckbox.setValue((%material).glow[%layer]);
|
||||||
MaterialEditorPropertiesWindow-->emissiveCheckbox.setValue((%material).emissive[%layer]);
|
MaterialEditorPropertiesWindow-->receiveShadowsCheckbox.setValue((%material).receiveShadows[%layer]);
|
||||||
MaterialEditorPropertiesWindow-->parallaxTextEdit.setText((%material).parallaxScale[%layer]);
|
MaterialEditorPropertiesWindow-->parallaxTextEdit.setText((%material).parallaxScale[%layer]);
|
||||||
MaterialEditorPropertiesWindow-->parallaxSlider.setValue((%material).parallaxScale[%layer]);
|
MaterialEditorPropertiesWindow-->parallaxSlider.setValue((%material).parallaxScale[%layer]);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue