Corrected probe init'ing so they don't fight for the cubemap idx order

Also correct deleting behavior so it updates indicies when a probe is removed
Updated forward lighting to utilize the same math as deferred
This commit is contained in:
Areloch 2019-06-30 23:04:16 -05:00
parent a2aa241c92
commit e87dc787ee
18 changed files with 426 additions and 375 deletions

View file

@ -388,10 +388,9 @@ void AdvancedLightManager::setLightInfo( ProcessedMaterial *pmat,
lsc->mLightPositionSC, lsc->mLightPositionSC,
lsc->mLightDiffuseSC, lsc->mLightDiffuseSC,
lsc->mLightAmbientSC, lsc->mLightAmbientSC,
lsc->mLightInvRadiusSqSC, lsc->mLightConfigDataSC,
lsc->mLightSpotDirSC, lsc->mLightSpotDirSC,
lsc->mLightSpotAngleSC, lsc->mLightSpotParamsSC,
lsc->mLightSpotFalloffSC,
shaderConsts ); shaderConsts );
// Static // Static

View file

@ -304,10 +304,9 @@ BasicLightManager::LightingShaderConstants::LightingShaderConstants()
mLightPosition( NULL ), mLightPosition( NULL ),
mLightDiffuse( NULL ), mLightDiffuse( NULL ),
mLightAmbient( NULL ), mLightAmbient( NULL ),
mLightInvRadiusSq( NULL ), mLightConfigDataSC( NULL ),
mLightSpotDir( NULL ), mLightSpotDir( NULL ),
mLightSpotAngle( NULL ), mLightSpotParamsSC( NULL )
mLightSpotFalloff( NULL )
{ {
} }
@ -333,11 +332,10 @@ void BasicLightManager::LightingShaderConstants::init(GFXShader* shader)
mLightPosition = shader->getShaderConstHandle( ShaderGenVars::lightPosition ); mLightPosition = shader->getShaderConstHandle( ShaderGenVars::lightPosition );
mLightDiffuse = shader->getShaderConstHandle( ShaderGenVars::lightDiffuse); mLightDiffuse = shader->getShaderConstHandle( ShaderGenVars::lightDiffuse);
mLightInvRadiusSq = shader->getShaderConstHandle( ShaderGenVars::lightInvRadiusSq ); mLightConfigDataSC = shader->getShaderConstHandle( ShaderGenVars::lightConfigData );
mLightAmbient = shader->getShaderConstHandle( ShaderGenVars::lightAmbient ); mLightAmbient = shader->getShaderConstHandle( ShaderGenVars::lightAmbient );
mLightSpotDir = shader->getShaderConstHandle( ShaderGenVars::lightSpotDir ); mLightSpotDir = shader->getShaderConstHandle( ShaderGenVars::lightSpotDir );
mLightSpotAngle = shader->getShaderConstHandle( ShaderGenVars::lightSpotAngle ); mLightSpotParamsSC = shader->getShaderConstHandle( ShaderGenVars::lightSpotParams );
mLightSpotFalloff = shader->getShaderConstHandle( ShaderGenVars::lightSpotFalloff );
mInit = true; mInit = true;
} }
@ -399,9 +397,8 @@ void BasicLightManager::setLightInfo( ProcessedMaterial* pmat,
mLastConstants->mLightPosition, mLastConstants->mLightPosition,
mLastConstants->mLightDiffuse, mLastConstants->mLightDiffuse,
mLastConstants->mLightAmbient, mLastConstants->mLightAmbient,
mLastConstants->mLightInvRadiusSq, mLastConstants->mLightConfigDataSC,
mLastConstants->mLightSpotDir, mLastConstants->mLightSpotDir,
mLastConstants->mLightSpotAngle, mLastConstants->mLightSpotParamsSC,
mLastConstants->mLightSpotFalloff,
shaderConsts ); shaderConsts );
} }

View file

@ -88,10 +88,9 @@ protected:
GFXShaderConstHandle *mLightPosition; GFXShaderConstHandle *mLightPosition;
GFXShaderConstHandle *mLightDiffuse; GFXShaderConstHandle *mLightDiffuse;
GFXShaderConstHandle *mLightAmbient; GFXShaderConstHandle *mLightAmbient;
GFXShaderConstHandle *mLightInvRadiusSq; GFXShaderConstHandle *mLightConfigDataSC;
GFXShaderConstHandle *mLightSpotDir; GFXShaderConstHandle *mLightSpotDir;
GFXShaderConstHandle *mLightSpotAngle; GFXShaderConstHandle *mLightSpotParamsSC;
GFXShaderConstHandle *mLightSpotFalloff;
LightingShaderConstants(); LightingShaderConstants();
~LightingShaderConstants(); ~LightingShaderConstants();

View file

@ -306,10 +306,9 @@ void LightManager::_update4LightConsts( const SceneData &sgData,
GFXShaderConstHandle *lightPositionSC, GFXShaderConstHandle *lightPositionSC,
GFXShaderConstHandle *lightDiffuseSC, GFXShaderConstHandle *lightDiffuseSC,
GFXShaderConstHandle *lightAmbientSC, GFXShaderConstHandle *lightAmbientSC,
GFXShaderConstHandle *lightInvRadiusSqSC, GFXShaderConstHandle *lightConfigDataSC,
GFXShaderConstHandle *lightSpotDirSC, GFXShaderConstHandle *lightSpotDirSC,
GFXShaderConstHandle *lightSpotAngleSC, GFXShaderConstHandle *lightSpotParamsSC,
GFXShaderConstHandle *lightSpotFalloffSC,
GFXShaderConstBuffer *shaderConsts ) GFXShaderConstBuffer *shaderConsts )
{ {
PROFILE_SCOPE( LightManager_Update4LightConsts ); PROFILE_SCOPE( LightManager_Update4LightConsts );
@ -317,14 +316,110 @@ void LightManager::_update4LightConsts( const SceneData &sgData,
// Skip over gathering lights if we don't have to! // Skip over gathering lights if we don't have to!
if ( lightPositionSC->isValid() || if ( lightPositionSC->isValid() ||
lightDiffuseSC->isValid() || lightDiffuseSC->isValid() ||
lightInvRadiusSqSC->isValid() || lightConfigDataSC->isValid() ||
lightSpotDirSC->isValid() || lightSpotDirSC->isValid() ||
lightSpotAngleSC->isValid() || lightSpotParamsSC->isValid() )
lightSpotFalloffSC->isValid() )
{ {
PROFILE_SCOPE( LightManager_Update4LightConsts_setLights ); PROFILE_SCOPE( LightManager_Update4LightConsts_setLights );
static AlignedArray<Point4F> lightPositions( 3, sizeof( Point4F ) ); //new setup
const U32 MAX_FORWARD_LIGHTS = 4;
static AlignedArray<Point4F> lightPositions(MAX_FORWARD_LIGHTS, sizeof(Point4F));
static AlignedArray<Point4F> lightSpotDirs(MAX_FORWARD_LIGHTS, sizeof(Point4F));
static AlignedArray<Point4F> lightColors(MAX_FORWARD_LIGHTS, sizeof(Point4F));
static AlignedArray<Point4F> lightConfigData(MAX_FORWARD_LIGHTS, sizeof(Point4F)); //type, brightness, range, invSqrRange : rgba
static AlignedArray<Point4F> lightSpotParams(MAX_FORWARD_LIGHTS, sizeof(Point4F));
dMemset(lightPositions.getBuffer(), 0, lightPositions.getBufferSize());
dMemset(lightSpotDirs.getBuffer(), 0, lightSpotDirs.getBufferSize());
dMemset(lightColors.getBuffer(), 0, lightColors.getBufferSize());
dMemset(lightConfigData.getBuffer(), 0, lightConfigData.getBufferSize());
dMemset(lightSpotParams.getBuffer(), 0, lightSpotParams.getBufferSize());
//sun-only
F32 vectorLightBrightness;
static Point4F vectorLightDirection;
static Point4F vectorLightColor;
static Point4F vectorLightAmbientColor;
int hasVectorLight = 0;
vectorLightBrightness = 0;
vectorLightDirection = Point4F::Zero;
vectorLightColor = Point4F::Zero;
vectorLightAmbientColor = Point4F::Zero;
// Gather the data for the first 4 lights.
const LightInfo* light;
for (U32 i = 0; i < MAX_FORWARD_LIGHTS; i++)
{
light = sgData.lights[i];
if (!light)
break;
if (light->getType() == LightInfo::Vector)
{
if (hasVectorLight != 0)
continue;
vectorLightBrightness = light->getBrightness();
vectorLightDirection = light->getDirection();
vectorLightColor = Point4F(light->getColor());
vectorLightAmbientColor = Point4F(light->getAmbient());
hasVectorLight = 1;
continue;
}
// The light positions and spot directions are
// in SoA order to make optimal use of the GPU.
const Point3F& lightPos = light->getPosition();
lightPositions[i].x = lightPos.x;
lightPositions[i].y = lightPos.y;
lightPositions[i].z = lightPos.z;
lightPositions[i].w = 0;
const VectorF& lightDir = light->getDirection();
lightSpotDirs[i].x = lightDir.x;
lightSpotDirs[i].y = lightDir.y;
lightSpotDirs[i].z = lightDir.z;
lightSpotDirs[i].w = 0;
lightColors[i] = Point4F(light->getColor());
if (light->getType() == LightInfo::Point)
{
lightConfigData[i].x = 0;
}
else if (light->getType() == LightInfo::Spot)
{
lightConfigData[i].x = 1;
const F32 outerCone = light->getOuterConeAngle();
const F32 innerCone = getMin(light->getInnerConeAngle(), outerCone);
const F32 outerCos = mCos(mDegToRad(outerCone / 2.0f));
const F32 innerCos = mCos(mDegToRad(innerCone / 2.0f));
Point2F spotParams(outerCos, innerCos - outerCos);
lightSpotParams[i].x = spotParams.x;
lightSpotParams[i].y = spotParams.y;
}
lightConfigData[i].y = light->getBrightness();
F32 range = light->getRange().x;
lightConfigData[i].z = range;
lightConfigData[i].w = 1.0f / (range * range);
}
shaderConsts->setSafe(lightPositionSC, lightPositions);
shaderConsts->setSafe(lightDiffuseSC, lightColors);
shaderConsts->setSafe(lightSpotDirSC, lightSpotDirs);
shaderConsts->setSafe(lightConfigDataSC, lightConfigData);
shaderConsts->setSafe(lightSpotParamsSC, lightSpotParams);
//================================================================
//old setup
/*static AlignedArray<Point4F> lightPositions( 3, sizeof( Point4F ) );
static AlignedArray<Point4F> lightSpotDirs( 3, sizeof( Point4F ) ); static AlignedArray<Point4F> lightSpotDirs( 3, sizeof( Point4F ) );
static AlignedArray<Point4F> lightColors( 4, sizeof( Point4F ) ); static AlignedArray<Point4F> lightColors( 4, sizeof( Point4F ) );
static Point4F lightInvRadiusSq; static Point4F lightInvRadiusSq;
@ -343,7 +438,7 @@ void LightManager::_update4LightConsts( const SceneData &sgData,
// Gather the data for the first 4 lights. // Gather the data for the first 4 lights.
const LightInfo *light; const LightInfo *light;
for ( U32 i=0; i < 4; i++ ) for ( U32 i=0; i < MAX_FORWARD_LIGHTS; i++ )
{ {
light = sgData.lights[i]; light = sgData.lights[i];
if ( !light ) if ( !light )
@ -382,7 +477,7 @@ void LightManager::_update4LightConsts( const SceneData &sgData,
shaderConsts->setSafe( lightSpotDirSC, lightSpotDirs ); shaderConsts->setSafe( lightSpotDirSC, lightSpotDirs );
shaderConsts->setSafe( lightSpotAngleSC, lightSpotAngle ); shaderConsts->setSafe( lightSpotAngleSC, lightSpotAngle );
shaderConsts->setSafe( lightSpotFalloffSC, lightSpotFalloff ); shaderConsts->setSafe( lightSpotFalloffSC, lightSpotFalloff );*/
} }
// Setup the ambient lighting from the first // Setup the ambient lighting from the first

View file

@ -177,8 +177,7 @@ protected:
GFXShaderConstHandle *lightAmbientSC, GFXShaderConstHandle *lightAmbientSC,
GFXShaderConstHandle *lightInvRadiusSqSC, GFXShaderConstHandle *lightInvRadiusSqSC,
GFXShaderConstHandle *lightSpotDirSC, GFXShaderConstHandle *lightSpotDirSC,
GFXShaderConstHandle *lightSpotAngleSC, GFXShaderConstHandle * lightSpotParamsSC,
GFXShaderConstHandle *lightSpotFalloffSC,
GFXShaderConstBuffer *shaderConsts ); GFXShaderConstBuffer *shaderConsts );
/// A dummy default light used when no lights /// A dummy default light used when no lights

View file

@ -460,10 +460,8 @@ LightingShaderConstants::LightingShaderConstants()
mLightPositionSC(NULL), mLightPositionSC(NULL),
mLightDiffuseSC(NULL), mLightDiffuseSC(NULL),
mLightAmbientSC(NULL), mLightAmbientSC(NULL),
mLightInvRadiusSqSC(NULL), mLightConfigDataSC(NULL),
mLightSpotDirSC(NULL), mLightSpotDirSC(NULL),
mLightSpotAngleSC(NULL),
mLightSpotFalloffSC(NULL),
mShadowMapSC(NULL), mShadowMapSC(NULL),
mDynamicShadowMapSC(NULL), mDynamicShadowMapSC(NULL),
mShadowMapSizeSC(NULL), mShadowMapSizeSC(NULL),
@ -524,10 +522,8 @@ void LightingShaderConstants::init(GFXShader* shader)
mLightPositionSC = shader->getShaderConstHandle( ShaderGenVars::lightPosition ); mLightPositionSC = shader->getShaderConstHandle( ShaderGenVars::lightPosition );
mLightDiffuseSC = shader->getShaderConstHandle( ShaderGenVars::lightDiffuse ); mLightDiffuseSC = shader->getShaderConstHandle( ShaderGenVars::lightDiffuse );
mLightAmbientSC = shader->getShaderConstHandle( ShaderGenVars::lightAmbient ); mLightAmbientSC = shader->getShaderConstHandle( ShaderGenVars::lightAmbient );
mLightInvRadiusSqSC = shader->getShaderConstHandle( ShaderGenVars::lightInvRadiusSq ); mLightConfigDataSC = shader->getShaderConstHandle( ShaderGenVars::lightConfigData);
mLightSpotDirSC = shader->getShaderConstHandle( ShaderGenVars::lightSpotDir ); mLightSpotDirSC = shader->getShaderConstHandle( ShaderGenVars::lightSpotDir );
mLightSpotAngleSC = shader->getShaderConstHandle( ShaderGenVars::lightSpotAngle );
mLightSpotFalloffSC = shader->getShaderConstHandle( ShaderGenVars::lightSpotFalloff );
mShadowMapSC = shader->getShaderConstHandle("$shadowMap"); mShadowMapSC = shader->getShaderConstHandle("$shadowMap");
mDynamicShadowMapSC = shader->getShaderConstHandle("$dynamicShadowMap"); mDynamicShadowMapSC = shader->getShaderConstHandle("$dynamicShadowMap");

View file

@ -87,10 +87,8 @@ struct LightingShaderConstants
GFXShaderConstHandle *mLightPositionSC; GFXShaderConstHandle *mLightPositionSC;
GFXShaderConstHandle *mLightDiffuseSC; GFXShaderConstHandle *mLightDiffuseSC;
GFXShaderConstHandle *mLightAmbientSC; GFXShaderConstHandle *mLightAmbientSC;
GFXShaderConstHandle *mLightInvRadiusSqSC; GFXShaderConstHandle *mLightConfigDataSC;
GFXShaderConstHandle *mLightSpotDirSC; GFXShaderConstHandle *mLightSpotDirSC;
GFXShaderConstHandle *mLightSpotAngleSC;
GFXShaderConstHandle *mLightSpotFalloffSC;
GFXShaderConstHandle* mShadowMapSC; GFXShaderConstHandle* mShadowMapSC;
GFXShaderConstHandle* mDynamicShadowMapSC; GFXShaderConstHandle* mDynamicShadowMapSC;

View file

@ -317,10 +317,10 @@ void RenderProbeMgr::addElement(RenderInst *inst)
ProbeRenderInst* RenderProbeMgr::registerProbe() ProbeRenderInst* RenderProbeMgr::registerProbe()
{ {
ProbeRenderInst newProbe; mRegisteredProbes.increment();
ProbeRenderInst* newProbe = &mRegisteredProbes.last();
mRegisteredProbes.push_back(newProbe); newProbe->mProbeIdx = mRegisteredProbes.size() - 1;
newProbe.mProbeIdx = mRegisteredProbes.size();
const U32 cubeIndex = _findNextEmptyCubeSlot(); const U32 cubeIndex = _findNextEmptyCubeSlot();
if (cubeIndex == INVALID_CUBE_SLOT) if (cubeIndex == INVALID_CUBE_SLOT)
@ -349,18 +349,18 @@ ProbeRenderInst* RenderProbeMgr::registerProbe()
mCubeSlotCount += PROBE_ARRAY_SLOT_BUFFER_SIZE; mCubeSlotCount += PROBE_ARRAY_SLOT_BUFFER_SIZE;
} }
newProbe.mCubemapIndex = cubeIndex; newProbe->mCubemapIndex = cubeIndex;
//mark cubemap slot as taken //mark cubemap slot as taken
mCubeMapSlots[cubeIndex] = true; mCubeMapSlots[cubeIndex] = true;
mCubeMapCount++; mCubeMapCount++;
#ifdef TORQUE_DEBUG #ifdef TORQUE_DEBUG
Con::warnf("RenderProbeMgr::registerProbe: Registered probe %u to cubeIndex %u", newProbe.mProbeIdx, cubeIndex); Con::warnf("RenderProbeMgr::registerProbe: Registered probe %u to cubeIndex %u", newProbe->mProbeIdx, cubeIndex);
#endif #endif
mProbesDirty = true; mProbesDirty = true;
return &mRegisteredProbes.last(); return newProbe;
} }
void RenderProbeMgr::unregisterProbe(U32 probeIdx) void RenderProbeMgr::unregisterProbe(U32 probeIdx)
@ -378,6 +378,12 @@ void RenderProbeMgr::unregisterProbe(U32 probeIdx)
mRegisteredProbes.erase(probeIdx); mRegisteredProbes.erase(probeIdx);
//recalculate all the probe's indicies just to be sure
for (U32 i = 0; i < mRegisteredProbes.size(); i++)
{
mRegisteredProbes[i].mProbeIdx == i;
}
//rebuild our probe data //rebuild our probe data
mProbesDirty = true; mProbesDirty = true;
} }
@ -750,7 +756,7 @@ void RenderProbeMgr::render( SceneRenderState *state )
mProbeArrayEffect->setCubemapArrayTexture(5, mIrradianceArray); mProbeArrayEffect->setCubemapArrayTexture(5, mIrradianceArray);
mProbeArrayEffect->setShaderConst("$numProbes", (S32)mEffectiveProbeCount); mProbeArrayEffect->setShaderConst("$numProbes", (S32)mEffectiveProbeCount);
mProbeArrayEffect->setShaderConst("$skylightCubemapIdx", mSkylightCubemapIdx); mProbeArrayEffect->setShaderConst("$skylightCubemapIdx", (S32)mSkylightCubemapIdx);
mProbeArrayEffect->setShaderConst("$cubeMips", (float)mMipCount); mProbeArrayEffect->setShaderConst("$cubeMips", (float)mMipCount);

View file

@ -818,6 +818,74 @@ Var* ShaderFeatureHLSL::addOutDetailTexCoord( Vector<ShaderComponent*> &compon
return outTex; return outTex;
} }
Var* ShaderFeatureHLSL::getSurface(Vector<ShaderComponent*>& componentList, MultiLine* meta)
{
ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(componentList[C_CONNECTOR]);
Var* diffuseColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
Var* matinfo = (Var*)LangElement::find("PBRConfig");
if (!matinfo)
{
Var* metalness = (Var*)LangElement::find("metalness");
if (!metalness)
{
metalness = new Var("metalness", "float");
metalness->uniform = true;
metalness->constSortPos = cspPotentialPrimitive;
}
Var* smoothness = (Var*)LangElement::find("smoothness");
if (!smoothness)
{
smoothness = new Var("smoothness", "float");
smoothness->uniform = true;
smoothness->constSortPos = cspPotentialPrimitive;
}
matinfo = new Var("PBRConfig", "float4");
LangElement* colorDecl = new DecOp(matinfo);
meta->addStatement(new GenOp(" @ = float4(0.0,1.0,@,@);\r\n", colorDecl, smoothness, metalness)); //reconstruct matinfo, no ao darkening
}
Var* inTex = getInTexCoord("texCoord", "float2", componentList);
if (!inTex)
return nullptr;
Var* wsNormal = (Var*)LangElement::find("wsNormal");
if (!wsNormal)
{
wsNormal = connectComp->getElement(RT_TEXCOORD);
wsNormal->setName("wsNormal");
wsNormal->setStructName("IN");
wsNormal->setType("float3");
// If we loaded the normal its our responsibility
// to normalize it... the interpolators won't.
//
// Note we cast to half here to get partial precision
// optimized code which is an acceptable loss of
// precision for normals and performs much better
// on older Geforce cards.
//
meta->addStatement(new GenOp(" @ = normalize( half3( @ ) );\r\n", wsNormal, wsNormal));
}
Var* wsEyePos = (Var*)LangElement::find("eyePosWorld");
Var* wsPosition = getInWsPosition(componentList);
Var* wsView = getWsView(wsPosition, meta);
Var* surface = (Var*)LangElement::find("surface");
if (!surface)
{
surface = new Var("surface", "Surface");
meta->addStatement(new GenOp(" @ = createForwardSurface(@,@,@,@,@,@,@);\r\n\n", new DecOp(surface), diffuseColor, wsNormal, matinfo,
inTex, wsPosition, wsEyePos, wsView));
}
return surface;
}
//**************************************************************************** //****************************************************************************
// Base Texture // Base Texture
//**************************************************************************** //****************************************************************************
@ -2157,10 +2225,10 @@ void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
Var *wsView = getWsView( wsPosition, meta ); Var *wsView = getWsView( wsPosition, meta );
// Create temporaries to hold results of lighting. // Create temporaries to hold results of lighting.
Var *rtShading = new Var( "rtShading", "float4" ); //Var *rtShading = new Var( "rtShading", "float4" );
Var *specular = new Var( "specular", "float4" ); //Var *specular = new Var( "specular", "float4" );
meta->addStatement( new GenOp( " @; @;\r\n", //meta->addStatement( new GenOp( " @; @;\r\n",
new DecOp( rtShading ), new DecOp( specular ) ) ); // new DecOp( rtShading ), new DecOp( specular ) ) );
// Look for a light mask generated from a previous // Look for a light mask generated from a previous
// feature (this is done for BL terrain lightmaps). // feature (this is done for BL terrain lightmaps).
@ -2171,12 +2239,13 @@ void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
// Get all the light constants. // Get all the light constants.
Var *inLightPos = new Var( "inLightPos", "float4" ); Var *inLightPos = new Var( "inLightPos", "float4" );
inLightPos->uniform = true; inLightPos->uniform = true;
inLightPos->arraySize = 3; inLightPos->arraySize = 4;
inLightPos->constSortPos = cspPotentialPrimitive; inLightPos->constSortPos = cspPotentialPrimitive;
Var *inLightInvRadiusSq = new Var( "inLightInvRadiusSq", "float4" ); Var * inLightConfigData = new Var( "inLightConfigData", "float4" );
inLightInvRadiusSq->uniform = true; inLightConfigData->uniform = true;
inLightInvRadiusSq->constSortPos = cspPotentialPrimitive; inLightConfigData->arraySize = 4;
inLightConfigData->constSortPos = cspPotentialPrimitive;
Var *inLightColor = new Var( "inLightColor", "float4" ); Var *inLightColor = new Var( "inLightColor", "float4" );
inLightColor->uniform = true; inLightColor->uniform = true;
@ -2185,19 +2254,23 @@ void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
Var *inLightSpotDir = new Var( "inLightSpotDir", "float4" ); Var *inLightSpotDir = new Var( "inLightSpotDir", "float4" );
inLightSpotDir->uniform = true; inLightSpotDir->uniform = true;
inLightSpotDir->arraySize = 3; inLightSpotDir->arraySize = 4;
inLightSpotDir->constSortPos = cspPotentialPrimitive; inLightSpotDir->constSortPos = cspPotentialPrimitive;
Var *inLightSpotAngle = new Var( "inLightSpotAngle", "float4" ); Var * lightSpotParams = new Var( "lightSpotParams", "float4" );
inLightSpotAngle->uniform = true; lightSpotParams->uniform = true;
inLightSpotAngle->constSortPos = cspPotentialPrimitive; lightSpotParams->arraySize = 4;
lightSpotParams->constSortPos = cspPotentialPrimitive;
Var *lightSpotFalloff = new Var( "inLightSpotFalloff", "float4" ); Var* surface = getSurface(componentList, meta);
lightSpotFalloff->uniform = true; if (!surface)
lightSpotFalloff->constSortPos = cspPotentialPrimitive; {
Con::errorf("ShaderGen::RTLightingFeatHLSL() - failed to generate surface!");
return;
}
Var *smoothness = (Var*)LangElement::find("smoothness"); Var *smoothness = (Var*)LangElement::find("smoothness");
if (!fd.features[MFT_SpecularMap]) /*if (!fd.features[MFT_SpecularMap])
{ {
if (!smoothness) if (!smoothness)
{ {
@ -2205,10 +2278,10 @@ void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
smoothness->uniform = true; smoothness->uniform = true;
smoothness->constSortPos = cspPotentialPrimitive; smoothness->constSortPos = cspPotentialPrimitive;
} }
} }*/
Var *metalness = (Var*)LangElement::find("metalness"); Var *metalness = (Var*)LangElement::find("metalness");
if (!fd.features[MFT_SpecularMap]) /*if (!fd.features[MFT_SpecularMap])
{ {
if (!metalness) if (!metalness)
{ {
@ -2216,7 +2289,7 @@ void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
metalness->uniform = true; metalness->uniform = true;
metalness->constSortPos = cspPotentialPrimitive; metalness->constSortPos = cspPotentialPrimitive;
} }
} }*/
Var *albedo = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget)); Var *albedo = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
@ -2225,16 +2298,24 @@ void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
ambient->constSortPos = cspPass; ambient->constSortPos = cspPass;
// Calculate the diffuse shading and specular powers. // Calculate the diffuse shading and specular powers.
meta->addStatement( new GenOp( " compute4Lights( @, @, @, @,\r\n" /*meta->addStatement( new GenOp( " compute4Lights( @, @, @, @,\r\n"
" @, @, @, @, @, @, @, @, @,\r\n" " @, @, @, @, @, @, @, @, @,\r\n"
" @, @ );\r\n", " @, @ );\r\n",
wsView, wsPosition, wsNormal, lightMask, wsView, wsPosition, wsNormal, lightMask,
inLightPos, inLightInvRadiusSq, inLightColor, inLightSpotDir, inLightSpotAngle, lightSpotFalloff, smoothness, metalness, albedo, inLightPos, inLightConfigData, inLightColor, inLightSpotDir, inLightSpotAngle, lightSpotFalloff, smoothness, metalness, albedo,
rtShading, specular ) ); rtShading, specular ) );
// Apply the lighting to the diffuse color. // Apply the lighting to the diffuse color.
LangElement *lighting = new GenOp( "float4( @.rgb + @.rgb, 1 )", rtShading, ambient ); LangElement *lighting = new GenOp( "float4( @.rgb + @.rgb, 1 )", rtShading, ambient );
meta->addStatement( new GenOp( " @;\r\n", assignColor( lighting, Material::Mul ) ) ); meta->addStatement( new GenOp( " @;\r\n", assignColor( lighting, Material::Mul ) ) );*/
Var* lighting = new Var("lighting", "float4");
meta->addStatement(new GenOp(" @ = compute4Lights( @, @, @, @,\r\n"
" @, @, @);\r\n",
new DecOp(lighting), surface, lightMask, inLightPos, inLightConfigData, inLightColor, inLightSpotDir, lightSpotParams));
meta->addStatement(new GenOp(" @;\r\n", assignColor(lighting, Material::Add)));
output = meta; output = meta;
} }
@ -3051,6 +3132,14 @@ void ReflectionProbeFeatHLSL::processPix(Vector<ShaderComponent*> &componentList
irradianceCubemapARTex->uniform = true; irradianceCubemapARTex->uniform = true;
irradianceCubemapARTex->texture = true; irradianceCubemapARTex->texture = true;
irradianceCubemapARTex->constNum = irradianceCubemapAR->constNum; irradianceCubemapARTex->constNum = irradianceCubemapAR->constNum;
Var* surface = getSurface(componentList, meta);
if (!surface)
{
Con::errorf("ShaderGen::ReflectionProbeFeatHLSL() - failed to generate surface!");
return;
}
Var *inTex = getInTexCoord("texCoord", "float2", componentList); Var *inTex = getInTexCoord("texCoord", "float2", componentList);
if (!inTex) if (!inTex)
@ -3059,55 +3148,15 @@ void ReflectionProbeFeatHLSL::processPix(Vector<ShaderComponent*> &componentList
Var *diffuseColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget)); Var *diffuseColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
Var *matinfo = (Var*)LangElement::find("PBRConfig"); Var *matinfo = (Var*)LangElement::find("PBRConfig");
if (!matinfo) Var* metalness = (Var*)LangElement::find("metalness");
{ Var* smoothness = (Var*)LangElement::find("smoothness");
Var* metalness = (Var*)LangElement::find("metalness");
if (!metalness)
{
metalness = new Var("metalness", "float");
metalness->uniform = true;
metalness->constSortPos = cspPotentialPrimitive;
}
Var* smoothness = (Var*)LangElement::find("smoothness");
if (!smoothness)
{
smoothness = new Var("smoothness", "float");
smoothness->uniform = true;
smoothness->constSortPos = cspPotentialPrimitive;
}
matinfo = new Var("PBRConfig", "float4");
LangElement* colorDecl = new DecOp(matinfo);
meta->addStatement(new GenOp(" @ = float4(0.0,1.0,@,@);\r\n", colorDecl, smoothness, metalness)); //reconstruct matinfo, no ao darkening
}
Var* wsEyePos = (Var*)LangElement::find("eyePosWorld"); Var* wsEyePos = (Var*)LangElement::find("eyePosWorld");
Var* worldToTangent = getInWorldToTangent(componentList); Var* worldToTangent = getInWorldToTangent(componentList);
Var* wsNormal = (Var*)LangElement::find("wsNormal"); Var* wsNormal = (Var*)LangElement::find("wsNormal");
if (!wsNormal)
{
wsNormal = connectComp->getElement(RT_TEXCOORD);
wsNormal->setName("wsNormal");
wsNormal->setStructName("IN");
wsNormal->setType("float3");
// If we loaded the normal its our responsibility
// to normalize it... the interpolators won't.
//
// Note we cast to half here to get partial precision
// optimized code which is an acceptable loss of
// precision for normals and performs much better
// on older Geforce cards.
//
meta->addStatement(new GenOp(" @ = normalize( half3( @ ) );\r\n", wsNormal, wsNormal));
}
//Reflection vec //Reflection vec
Var* surface = new Var("surface", "Surface");
meta->addStatement(new GenOp(" @ = createForwardSurface(@,@,@,@,@,@,@);\r\n\n", new DecOp(surface), diffuseColor, wsNormal, matinfo,
inTex, wsPosition, wsEyePos, wsView));
String computeForwardProbes = String::String(" @.rgb = computeForwardProbes(@,@,@,@,@,@,@,@,@,\r\n\t\t"); String computeForwardProbes = String::String(" @.rgb = computeForwardProbes(@,@,@,@,@,@,@,@,@,\r\n\t\t");
computeForwardProbes += String::String("@,TORQUE_SAMPLER2D_MAKEARG(@),\r\n\t\t"); computeForwardProbes += String::String("@,TORQUE_SAMPLER2D_MAKEARG(@),\r\n\t\t");
computeForwardProbes += String::String("TORQUE_SAMPLERCUBEARRAY_MAKEARG(@),TORQUE_SAMPLERCUBEARRAY_MAKEARG(@)).rgb; \r\n"); computeForwardProbes += String::String("TORQUE_SAMPLERCUBEARRAY_MAKEARG(@),TORQUE_SAMPLERCUBEARRAY_MAKEARG(@)).rgb; \r\n");

View file

@ -135,6 +135,8 @@ public:
bool useInstancing, bool useInstancing,
MultiLine *meta ); MultiLine *meta );
Var* getSurface(Vector<ShaderComponent*>& componentList, MultiLine* meta);
// ShaderFeature // ShaderFeature
Var* getVertTexCoord( const String &name ); Var* getVertTexCoord( const String &name );
LangElement* setupTexSpaceMat( Vector<ShaderComponent*> &componentList, Var **texSpaceMat ); LangElement* setupTexSpaceMat( Vector<ShaderComponent*> &componentList, Var **texSpaceMat );

View file

@ -61,10 +61,9 @@ const String ShaderGenVars::oneOverTargetSize("$oneOverTargetSize");
const String ShaderGenVars::lightPosition("$inLightPos"); const String ShaderGenVars::lightPosition("$inLightPos");
const String ShaderGenVars::lightDiffuse("$inLightColor"); const String ShaderGenVars::lightDiffuse("$inLightColor");
const String ShaderGenVars::lightAmbient("$ambient"); const String ShaderGenVars::lightAmbient("$ambient");
const String ShaderGenVars::lightInvRadiusSq("$inLightInvRadiusSq"); const String ShaderGenVars::lightConfigData("$inLightConfigData");
const String ShaderGenVars::lightSpotDir("$inLightSpotDir"); const String ShaderGenVars::lightSpotDir("$inLightSpotDir");
const String ShaderGenVars::lightSpotAngle("$inLightSpotAngle"); const String ShaderGenVars::lightSpotParams("$lightSpotParams");
const String ShaderGenVars::lightSpotFalloff("$inLightSpotFalloff");
const String ShaderGenVars::specularColor("$specularColor"); const String ShaderGenVars::specularColor("$specularColor");
const String ShaderGenVars::smoothness("$smoothness"); const String ShaderGenVars::smoothness("$smoothness");
const String ShaderGenVars::metalness("$metalness"); const String ShaderGenVars::metalness("$metalness");

View file

@ -74,10 +74,9 @@ struct ShaderGenVars
const static String lightPosition; const static String lightPosition;
const static String lightDiffuse; const static String lightDiffuse;
const static String lightAmbient; const static String lightAmbient;
const static String lightInvRadiusSq; const static String lightConfigData;
const static String lightSpotDir; const static String lightSpotDir;
const static String lightSpotAngle; const static String lightSpotParams;
const static String lightSpotFalloff;
const static String specularColor; const static String specularColor;
const static String smoothness; const static String smoothness;
const static String metalness; const static String metalness;

View file

@ -28,12 +28,12 @@
// These are the uniforms used by most lighting shaders. // These are the uniforms used by most lighting shaders.
uniform float4 inLightPos[3]; uniform float4 inLightPos[4];
uniform float4 inLightInvRadiusSq; uniform float4 inLightConfigData[4];
uniform float4 inLightColor[4]; uniform float4 inLightColor[4];
#ifndef TORQUE_BL_NOSPOTLIGHT #ifndef TORQUE_BL_NOSPOTLIGHT
uniform float4 inLightSpotDir[3]; uniform float4 inLightSpotDir[4];
uniform float4 inLightSpotAngle; uniform float4 inLightSpotAngle;
uniform float4 inLightSpotFalloff; uniform float4 inLightSpotFalloff;
#endif #endif
@ -48,6 +48,8 @@ uniform float4 albedo;
#define MAX_PROBES 50 #define MAX_PROBES 50
#define MAX_FORWARD_PROBES 4 #define MAX_FORWARD_PROBES 4
#define MAX_FORWARD_LIGHT 4
inline float3 getDistanceVectorToPlane( float3 origin, float3 direction, float4 plane ) inline float3 getDistanceVectorToPlane( float3 origin, float3 direction, float4 plane )
{ {
float denum = dot( plane.xyz, direction.xyz ); float denum = dot( plane.xyz, direction.xyz );
@ -65,146 +67,6 @@ inline float3 getDistanceVectorToPlane( float negFarPlaneDotEye, float3 directio
return direction.xyz * t; return direction.xyz * t;
} }
//TODO fix compute 4 lights
void compute4Lights( float3 wsView,
float3 wsPosition,
float3 wsNormal,
float4 shadowMask,
#ifdef TORQUE_SHADERGEN
float4 inLightPos[3],
float4 inLightInvRadiusSq,
float4 inLightColor[4],
float4 inLightSpotDir[3],
float4 inLightSpotAngle,
float4 inLightSpotFalloff,
float smoothness,
float metalness,
float4 albedo,
#endif // TORQUE_SHADERGEN
out float4 outDiffuse,
out float4 outSpecular )
{
// NOTE: The light positions and spotlight directions
// are stored in SoA order, so inLightPos[0] is the
// x coord for all 4 lights... inLightPos[1] is y... etc.
//
// This is the key to fully utilizing the vector units and
// saving a huge amount of instructions.
//
// For example this change saved more than 10 instructions
// over a simple for loop for each light.
int i;
float4 lightVectors[3];
for ( i = 0; i < 3; i++ )
lightVectors[i] = wsPosition[i] - inLightPos[i];
float4 squareDists = 0;
for ( i = 0; i < 3; i++ )
squareDists += lightVectors[i] * lightVectors[i];
// Accumulate the dot product between the light
// vector and the normal.
//
// The normal is negated because it faces away from
// the surface and the light faces towards the
// surface... this keeps us from needing to flip
// the light vector direction which complicates
// the spot light calculations.
//
// We normalize the result a little later.
//
float4 nDotL = 0;
for ( i = 0; i < 3; i++ )
nDotL += lightVectors[i] * -wsNormal[i];
float4 rDotL = 0;
#ifndef TORQUE_BL_NOSPECULAR
// We're using the Phong specular reflection model
// here where traditionally Torque has used Blinn-Phong
// which has proven to be more accurate to real materials.
//
// We do so because its cheaper as do not need to
// calculate the half angle for all 4 lights.
//
// Advanced Lighting still uses Blinn-Phong, but the
// specular reconstruction it does looks fairly similar
// to this.
//
float3 R = reflect( wsView, -wsNormal );
for ( i = 0; i < 3; i++ )
rDotL += lightVectors[i] * R[i];
#endif
// Normalize the dots.
//
// Notice we're using the half type here to get a
// much faster sqrt via the rsq_pp instruction at
// the loss of some precision.
//
// Unless we have some extremely large point lights
// i don't believe the precision loss will matter.
//
half4 correction = (half4)rsqrt( squareDists );
nDotL = saturate( nDotL * correction );
rDotL = clamp( rDotL * correction, 0.00001, 1.0 );
// First calculate a simple point light linear
// attenuation factor.
//
// If this is a directional light the inverse
// radius should be greater than the distance
// causing the attenuation to have no affect.
//
float4 atten = saturate( 1.0 - ( squareDists * inLightInvRadiusSq ) );
#ifndef TORQUE_BL_NOSPOTLIGHT
// The spotlight attenuation factor. This is really
// fast for what it does... 6 instructions for 4 spots.
float4 spotAtten = 0;
for ( i = 0; i < 3; i++ )
spotAtten += lightVectors[i] * inLightSpotDir[i];
float4 cosAngle = ( spotAtten * correction ) - inLightSpotAngle;
atten *= saturate( cosAngle * inLightSpotFalloff );
#endif
// Finally apply the shadow masking on the attenuation.
atten *= shadowMask;
// Get the final light intensity.
float4 intensity = nDotL * atten;
// Combine the light colors for output.
outDiffuse = 0;
for ( i = 0; i < 4; i++ )
outDiffuse += intensity[i] * inLightColor[i];
// Output the specular power.
float4 specularIntensity = pow( rDotL, float4(1,1,1,1) ) * atten;
// Apply the per-light specular attenuation.
float4 specular = float4(0,0,0,1);
for ( i = 0; i < 4; i++ )
specular += float4( inLightColor[i].rgb * inLightColor[i].a * specularIntensity[i], 1 );
// Add the final specular intensity values together
// using a single dot product operation then get the
// final specular lighting color.
outSpecular = float4(1,1,1,1) * specular;
}
struct Surface struct Surface
{ {
float3 P; // world space position float3 P; // world space position
@ -372,6 +234,57 @@ inline float3 getPunctualLight(in Surface surface, in SurfaceToLight surfaceToLi
return final; return final;
} }
float4 compute4Lights( Surface surface,
float4 shadowMask,
float4 inLightPos[4],
float4 inLightConfigData[4],
float4 inLightColor[4],
float4 inLightSpotDir[4],
float4 lightSpotParams[4] )
{
float3 finalLighting = 0.0.xxx;
int i;
for(i = 0; i < MAX_FORWARD_LIGHT; i++)
{
float3 L = inLightPos[i].xyz - surface.P;
float dist = length(L);
float lightRange = inLightConfigData[i].z;
SurfaceToLight surfaceToLight = createSurfaceToLight(surface, L);
float shadowed = 1.0;
float3 lightCol = inLightColor[i].rgb;
float lightBrightness = inLightConfigData[i].y;
float lightInvSqrRange= inLightConfigData[i].a;
float3 lighting = 0.0.xxx;
[branch]
if(dist < lightRange)
{
[branch]
if(inLightConfigData[i].x == 0) //point
{
//get punctual light contribution
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed);
}
else //spot
{
//get Punctual light contribution
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed);
//get spot angle attenuation
lighting *= getSpotAngleAtt(-surfaceToLight.L, inLightSpotDir[i].xyz, lightSpotParams[i].xy );
}
}
finalLighting += lighting;
}
return float4(finalLighting,1);
}
//Probe IBL stuff //Probe IBL stuff
float defineSphereSpaceInfluence(float3 wsPosition, float3 wsProbePosition, float radius) float defineSphereSpaceInfluence(float3 wsPosition, float3 wsProbePosition, float radius)
{ {

View file

@ -32,7 +32,7 @@ uniform float4 probeConfigData[MAX_PROBES]; //r,g,b/mode,radius,atten
uniform float4 probeContribColors[MAX_PROBES]; uniform float4 probeContribColors[MAX_PROBES];
#endif #endif
uniform float skylightCubemapIdx; uniform int skylightCubemapIdx;
float4 main(PFXVertToPix IN) : SV_TARGET float4 main(PFXVertToPix IN) : SV_TARGET
{ {
@ -140,7 +140,7 @@ float4 main(PFXVertToPix IN) : SV_TARGET
//Skylight coloration for anything not covered by probes above //Skylight coloration for anything not covered by probes above
if(skylightCubemapIdx != -1) if(skylightCubemapIdx != -1)
finalContribColor += float3(0.3, 0.3, 0.3) * contribAlpha; finalContribColor += float3(0, 1, 0) * contribAlpha;
return float4(finalContribColor, 1); return float4(finalContribColor, 1);
#endif #endif

View file

@ -7,8 +7,8 @@ singleton Material(Grid_512_Orange)
specular[0] = "0.8 0.8 0.8 1"; specular[0] = "0.8 0.8 0.8 1";
specularPower[0] = "0.25"; specularPower[0] = "0.25";
specularStrength[0] = "25"; specularStrength[0] = "25";
translucentBlendOp = "Add"; translucentBlendOp = "LerpAlpha";
smoothness[0] = "0.941176"; smoothness[0] = "1";
metalness[0] = "1"; metalness[0] = "1";
DiffuseMapAsset0 = "StaticShapeTest:Grid_512_orange_ALBEDO"; DiffuseMapAsset0 = "StaticShapeTest:Grid_512_orange_ALBEDO";
specularStrength0 = "25"; specularStrength0 = "25";

View file

@ -1,59 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<EditorSettings> <EditorSettings>
<Group name="Theme">
<Setting name="tooltipDividerColor">72 70 68 255</Setting>
<Setting name="headerTextColor">236 234 232 255</Setting>
<Setting name="tabsSELColor">59 58 57 255</Setting>
<Setting name="fieldBGHLColor">72 70 68 255</Setting>
<Setting name="tooltipTextColor">255 255 255 255</Setting>
<Setting name="fieldTextColor">178 175 172 255</Setting>
<Setting name="windowBackgroundColor">32 31 30 255</Setting>
<Setting name="headerColor">50 49 48 255</Setting>
<Setting name="dividerDarkColor">17 16 15 255</Setting>
<Setting name="fieldBGColor">59 58 57 255</Setting>
<Setting name="tooltipBGColor">43 43 43 255</Setting>
<Setting name="fieldTextSELColor">240 240 240 255</Setting>
<Setting name="fieldBGSELColor">100 98 96 255</Setting>
<Setting name="tabsColor">37 36 35 255</Setting>
<Setting name="dividerLightColor">96 94 92 255</Setting>
<Setting name="fieldTextHLColor">234 232 230 255</Setting>
<Setting name="tabsHLColor">50 49 48 255</Setting>
<Setting name="dividerMidColor">50 49 48 255</Setting>
</Group>
<Group name="GuiEditor">
<Setting name="previewResolution">1024 768</Setting>
<Setting name="lastPath">tools/gui</Setting>
<Group name="EngineDevelopment">
<Setting name="showEditorProfiles">0</Setting>
<Setting name="toggleIntoEditor">0</Setting>
<Setting name="showEditorGuis">0</Setting>
</Group>
<Group name="Help">
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
</Group>
<Group name="Selection">
<Setting name="fullBox">0</Setting>
</Group>
<Group name="Snapping">
<Setting name="snap2Grid">0</Setting>
<Setting name="snapToCanvas">1</Setting>
<Setting name="snapToGuides">1</Setting>
<Setting name="sensitivity">2</Setting>
<Setting name="snapToEdges">1</Setting>
<Setting name="snapToCenters">1</Setting>
<Setting name="snapToControls">1</Setting>
<Setting name="snap2GridSize">8</Setting>
</Group>
<Group name="Rendering">
<Setting name="drawBorderLines">1</Setting>
<Setting name="drawGuides">1</Setting>
</Group>
<Group name="Library">
<Setting name="viewType">Categorized</Setting>
</Group>
</Group>
<Group name="AxisGizmo"> <Group name="AxisGizmo">
<Setting name="rotationSnap">15</Setting> <Setting name="rotationSnap">15</Setting>
<Setting name="mouseRotateScalar">0.8</Setting> <Setting name="mouseRotateScalar">0.8</Setting>
@ -63,95 +9,149 @@
<Setting name="mouseScaleScalar">0.8</Setting> <Setting name="mouseScaleScalar">0.8</Setting>
<Setting name="renderInfoText">1</Setting> <Setting name="renderInfoText">1</Setting>
<Group name="Grid"> <Group name="Grid">
<Setting name="renderPlane">0</Setting>
<Setting name="gridColor">255 255 255 20</Setting>
<Setting name="gridSize">10 10 10</Setting> <Setting name="gridSize">10 10 10</Setting>
<Setting name="planeDim">500</Setting> <Setting name="planeDim">500</Setting>
<Setting name="gridColor">255 255 255 20</Setting>
<Setting name="renderPlaneHashes">0</Setting>
<Setting name="renderPlane">0</Setting>
<Setting name="snapToGrid">0</Setting> <Setting name="snapToGrid">0</Setting>
<Setting name="renderPlaneHashes">0</Setting>
</Group> </Group>
</Group> </Group>
<Group name="Theme">
<Setting name="tooltipDividerColor">72 70 68 255</Setting>
<Setting name="fieldTextColor">178 175 172 255</Setting>
<Setting name="fieldBGHLColor">72 70 68 255</Setting>
<Setting name="fieldTextSELColor">240 240 240 255</Setting>
<Setting name="dividerMidColor">50 49 48 255</Setting>
<Setting name="windowBackgroundColor">32 31 30 255</Setting>
<Setting name="dividerLightColor">96 94 92 255</Setting>
<Setting name="dividerDarkColor">17 16 15 255</Setting>
<Setting name="fieldBGColor">59 58 57 255</Setting>
<Setting name="tooltipBGColor">43 43 43 255</Setting>
<Setting name="tabsColor">37 36 35 255</Setting>
<Setting name="tabsHLColor">50 49 48 255</Setting>
<Setting name="headerTextColor">236 234 232 255</Setting>
<Setting name="headerColor">50 49 48 255</Setting>
<Setting name="fieldBGSELColor">100 98 96 255</Setting>
<Setting name="tabsSELColor">59 58 57 255</Setting>
<Setting name="fieldTextHLColor">234 232 230 255</Setting>
<Setting name="tooltipTextColor">255 255 255 255</Setting>
</Group>
<Group name="WorldEditor"> <Group name="WorldEditor">
<Setting name="orthoFOV">50</Setting>
<Setting name="displayType">6</Setting>
<Setting name="forceLoadDAE">0</Setting>
<Setting name="dropType">screenCenter</Setting>
<Setting name="undoLimit">40</Setting> <Setting name="undoLimit">40</Setting>
<Setting name="currentEditor">WorldEditorInspectorPlugin</Setting> <Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
<Setting name="forceLoadDAE">0</Setting>
<Setting name="torsionPath">AssetWork_Debug.exe</Setting> <Setting name="torsionPath">AssetWork_Debug.exe</Setting>
<Setting name="orthoShowGrid">1</Setting> <Setting name="orthoShowGrid">1</Setting>
<Group name="Tools"> <Setting name="displayType">6</Setting>
<Setting name="objectsUseBoxCenter">1</Setting> <Setting name="orthoFOV">50</Setting>
<Setting name="dropAtScreenCenterScalar">1</Setting> <Setting name="dropType">screenCenter</Setting>
<Setting name="snapGround">0</Setting> <Group name="ObjectIcons">
<Setting name="snapSoft">0</Setting> <Setting name="fadeIconsEndAlpha">0</Setting>
<Setting name="dropAtScreenCenterMax">100</Setting> <Setting name="fadeIcons">1</Setting>
<Setting name="boundingBoxCollision">0</Setting> <Setting name="fadeIconsStartDist">8</Setting>
<Setting name="snapSoftSize">2</Setting> <Setting name="fadeIconsEndDist">20</Setting>
</Group> <Setting name="fadeIconsStartAlpha">255</Setting>
<Group name="Color">
<Setting name="objMouseOverColor">0 255 0 255</Setting>
<Setting name="selectionBoxColor">255 255 0 255</Setting>
<Setting name="objectTextColor">255 255 255 255</Setting>
<Setting name="objSelectColor">255 0 0 255</Setting>
<Setting name="popupBackgroundColor">100 100 100 255</Setting>
<Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
<Setting name="dragRectColor">255 255 0 255</Setting>
</Group> </Group>
<Group name="Grid"> <Group name="Grid">
<Setting name="gridSnap">0</Setting>
<Setting name="gridMinorColor">51 51 51 100</Setting>
<Setting name="gridColor">102 102 102 100</Setting>
<Setting name="gridSize">1</Setting> <Setting name="gridSize">1</Setting>
<Setting name="gridMinorColor">51 51 51 100</Setting>
<Setting name="gridOriginColor">255 255 255 100</Setting> <Setting name="gridOriginColor">255 255 255 100</Setting>
<Setting name="gridColor">102 102 102 100</Setting>
<Setting name="gridSnap">0</Setting>
</Group>
<Group name="Images">
<Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
<Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
<Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
</Group>
<Group name="Render">
<Setting name="renderPopupBackground">1</Setting>
<Setting name="renderObjHandle">1</Setting>
<Setting name="showMousePopupInfo">1</Setting>
<Setting name="renderObjText">1</Setting>
<Setting name="renderSelectionBox">1</Setting>
</Group>
<Group name="Tools">
<Setting name="snapSoft">0</Setting>
<Setting name="snapSoftSize">2</Setting>
<Setting name="dropAtScreenCenterScalar">1</Setting>
<Setting name="objectsUseBoxCenter">1</Setting>
<Setting name="snapGround">0</Setting>
<Setting name="boundingBoxCollision">0</Setting>
<Setting name="dropAtScreenCenterMax">100</Setting>
</Group>
<Group name="Color">
<Setting name="popupBackgroundColor">100 100 100 255</Setting>
<Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
<Setting name="objMouseOverColor">Lime</Setting>
<Setting name="selectionBoxColor">255 255 0 255</Setting>
<Setting name="objectTextColor">255 255 255 255</Setting>
<Setting name="dragRectColor">255 255 0 255</Setting>
<Setting name="objSelectColor">255 0 0 255</Setting>
</Group>
<Group name="Theme">
<Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
<Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
<Setting name="windowTitleBGColor">50 50 50 255</Setting>
<Setting name="windowTitleFontColor">215 215 215 255</Setting>
<Setting name="windowTitleFontHLColor">255 255 255 255</Setting>
</Group> </Group>
<Group name="Docs"> <Group name="Docs">
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting> <Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
<Setting name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting> <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
<Setting name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
</Group> </Group>
<Group name="ObjectIcons"> </Group>
<Setting name="fadeIconsEndAlpha">0</Setting> <Group name="GuiEditor">
<Setting name="fadeIconsStartAlpha">255</Setting> <Setting name="previewResolution">1024 768</Setting>
<Setting name="fadeIconsEndDist">20</Setting> <Setting name="lastPath">tools/gui</Setting>
<Setting name="fadeIconsStartDist">8</Setting> <Group name="Rendering">
<Setting name="fadeIcons">1</Setting> <Setting name="drawGuides">1</Setting>
<Setting name="drawBorderLines">1</Setting>
</Group> </Group>
<Group name="Render"> <Group name="EngineDevelopment">
<Setting name="renderObjHandle">1</Setting> <Setting name="showEditorProfiles">0</Setting>
<Setting name="renderObjText">1</Setting> <Setting name="showEditorGuis">0</Setting>
<Setting name="showMousePopupInfo">1</Setting> <Setting name="toggleIntoEditor">0</Setting>
<Setting name="renderSelectionBox">1</Setting>
<Setting name="renderPopupBackground">1</Setting>
</Group> </Group>
<Group name="Theme"> <Group name="Snapping">
<Setting name="windowTitleFontHLColor">255 255 255 255</Setting> <Setting name="snapToGuides">1</Setting>
<Setting name="windowTitleBGHLColor">48 48 48 255</Setting> <Setting name="snap2GridSize">8</Setting>
<Setting name="windowTitleBGColor">50 50 50 255</Setting> <Setting name="snapToEdges">1</Setting>
<Setting name="windowTitleBGNAColor">180 180 180 255</Setting> <Setting name="snapToCanvas">1</Setting>
<Setting name="windowTitleFontColor">215 215 215 255</Setting> <Setting name="snapToControls">1</Setting>
<Setting name="sensitivity">2</Setting>
<Setting name="snapToCenters">1</Setting>
<Setting name="snap2Grid">0</Setting>
</Group> </Group>
<Group name="Images"> <Group name="Help">
<Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting> <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
<Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting> <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
<Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting> <Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
</Group>
<Group name="Library">
<Setting name="viewType">Categorized</Setting>
</Group>
<Group name="Selection">
<Setting name="fullBox">0</Setting>
</Group>
</Group>
<Group name="LevelInformation">
<Setting name="levelsDirectory">data/FPSGameplay/levels</Setting>
<Group name="levels">
<Group name="BlankRoom.mis">
<Setting name="cameraSpeed">25</Setting>
</Group>
<Group name="PbrMatTest.mis">
<Setting name="cameraSpeed">5</Setting>
</Group>
</Group> </Group>
</Group> </Group>
<Group name="NavEditor"> <Group name="NavEditor">
<Setting name="SpawnClass">AIPlayer</Setting> <Setting name="SpawnClass">AIPlayer</Setting>
</Group> </Group>
<Group name="LevelInformation">
<Setting name="levelsDirectory">data/FPSGameplay/levels</Setting>
<Group name="levels">
<Group name="PbrMatTest.mis">
<Setting name="cameraSpeed">5</Setting>
</Group>
<Group name="BlankRoom.mis">
<Setting name="cameraSpeed">25</Setting>
</Group>
</Group>
</Group>
<Group name="ConvexEditor"> <Group name="ConvexEditor">
<Setting name="materialName">Grid_512_Orange</Setting> <Setting name="materialName">Grid_512_Orange</Setting>
</Group> </Group>