mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-22 16:13:45 +00:00
Merge remote-tracking branch 'upstream/development' into imageAsset_refactor_rev3
This commit is contained in:
commit
7c4d41ee21
21 changed files with 98 additions and 158 deletions
|
|
@ -443,6 +443,7 @@ DefineEngineMethod(LevelAsset, unloadDependencies, void, (), ,
|
|||
return object->unloadDependencies();
|
||||
}
|
||||
|
||||
#ifdef TORQUE_TOOLS
|
||||
//-----------------------------------------------------------------------------
|
||||
// GuiInspectorTypeAssetId
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -545,3 +546,5 @@ void GuiInspectorTypeLevelAssetId::consoleInit()
|
|||
|
||||
ConsoleBaseType::getType(TypeLevelAssetId)->setInspectorFieldType("GuiInspectorTypeLevelAssetId");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ EndImplementEnumType;
|
|||
|
||||
IRangeValidator ejectPeriodIValidator(1, 2047);
|
||||
IRangeValidator periodVarianceIValidator(0, 2047);
|
||||
FRangeValidator ejectionFValidator(0.f, 655.35f);
|
||||
FRangeValidator ejectionFValidator(-655.35f, 655.35f);
|
||||
FRangeValidator velVarianceFValidator(0.f, 163.83f);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -122,9 +122,9 @@ void SplashData::initPersistFields()
|
|||
addFieldV("lifetimeVariance", TypeRangedS32, Offset(lifetimeVariance, SplashData), &CommonValidators::PositiveInt, "Time variance for lifetimeMS.\n");
|
||||
addFieldV("width", TypeRangedF32, Offset(width, SplashData), &CommonValidators::PositiveFloat, "Width for the X and Y coordinates to create this effect within.");
|
||||
addFieldV("numSegments", TypeRangedS32, Offset(numSegments, SplashData), &CommonValidators::NaturalNumber, "Number of ejection points in the splash ring.\n");
|
||||
addFieldV("velocity", TypeRangedF32, Offset(velocity, SplashData), &CommonValidators::PositiveFloat, "Velocity for the splash effect to travel.\n");
|
||||
addFieldV("height", TypeRangedF32, Offset(height, SplashData), &CommonValidators::PositiveFloat, "Height for the splash to reach.\n");
|
||||
addFieldV("acceleration", TypeRangedF32, Offset(acceleration, SplashData), &CommonValidators::PositiveFloat, "Constant acceleration value to place upon the splash effect.\n");
|
||||
addFieldV("velocity", TypeRangedF32, Offset(velocity, SplashData), &CommonValidators::F32Range, "Velocity for the splash effect to travel.\n");
|
||||
addFieldV("height", TypeRangedF32, Offset(height, SplashData), &CommonValidators::F32Range, "Height for the splash to reach.\n");
|
||||
addFieldV("acceleration", TypeRangedF32, Offset(acceleration, SplashData), &CommonValidators::F32Range, "Constant acceleration value to place upon the splash effect.\n");
|
||||
addFieldV("times", TypeRangedF32, Offset(times, SplashData), &CommonValidators::NormalizedFloat, NUM_TIME_KEYS, "Times to transition through the splash effect. Up to 4 allowed. Values are 0.0 - 1.0, and corrispond to the life of the particle where 0 is first created and 1 is end of lifespace.\n" );
|
||||
addField("colors", TypeColorF, Offset(colors, SplashData), NUM_TIME_KEYS, "Color values to set the splash effect, rgba. Up to 4 allowed. Will transition through colors based on values set in the times value. Example: colors[0] = \"0.6 1.0 1.0 0.5\".\n" );
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ void SplashData::initPersistFields()
|
|||
addFieldV("ejectionFreq", TypeRangedF32, Offset(ejectionFreq, SplashData), &CommonValidators::PositiveFloat, "Frequency in which to emit splash rings.\n");
|
||||
addFieldV("ejectionAngle", TypeRangedF32, Offset(ejectionAngle, SplashData), &CommonValidators::DegreeRange, "Rotational angle to create a splash ring.\n");
|
||||
addFieldV("ringLifetime", TypeRangedF32, Offset(ringLifetime, SplashData), &CommonValidators::PositiveFloat, "Lifetime, in milliseconds, for a splash ring.\n");
|
||||
addFieldV("startRadius", TypeRangedF32, Offset(startRadius, SplashData), &CommonValidators::PositiveFloat, "Starting radius size of a splash ring.\n");
|
||||
addFieldV("startRadius", TypeRangedF32, Offset(startRadius, SplashData), &CommonValidators::F32Range, "Starting radius size of a splash ring.\n");
|
||||
addField("explosion", TYPEID< ExplosionData >(), Offset(explosion, SplashData), "ExplosionData object to create at the creation position of this splash effect.\n");
|
||||
|
||||
Parent::initPersistFields();
|
||||
|
|
|
|||
|
|
@ -726,10 +726,10 @@ void PlayerData::initPersistFields()
|
|||
addField( "firstPersonShadows", TypeBool, Offset(firstPersonShadows, PlayerData),
|
||||
"@brief Forces shadows to be rendered in first person when renderFirstPerson is disabled. Defaults to false.\n\n" );
|
||||
|
||||
addFieldV( "minLookAngle", TypeRangedF32, Offset(minLookAngle, PlayerData), &CommonValidators::PositiveFloat,
|
||||
addFieldV( "minLookAngle", TypeRangedF32, Offset(minLookAngle, PlayerData), &CommonValidators::DirFloatPi,
|
||||
"@brief Lowest angle (in radians) the player can look.\n\n"
|
||||
"@note An angle of zero is straight ahead, with positive up and negative down." );
|
||||
addFieldV( "maxLookAngle", TypeRangedF32, Offset(maxLookAngle, PlayerData), &CommonValidators::PositiveFloat,
|
||||
addFieldV( "maxLookAngle", TypeRangedF32, Offset(maxLookAngle, PlayerData), &CommonValidators::DirFloatPi,
|
||||
"@brief Highest angle (in radians) the player can look.\n\n"
|
||||
"@note An angle of zero is straight ahead, with positive up and negative down." );
|
||||
addFieldV( "maxFreelookAngle", TypeRangedF32, Offset(maxFreelookAngle, PlayerData), &CommonValidators::PositiveFloat,
|
||||
|
|
@ -948,7 +948,7 @@ void PlayerData::initPersistFields()
|
|||
|
||||
addGroup( "Falling" );
|
||||
|
||||
addFieldV( "fallingSpeedThreshold", TypeRangedF32, Offset(fallingSpeedThreshold, PlayerData), &CommonValidators::PositiveFloat,
|
||||
addFieldV( "fallingSpeedThreshold", TypeRangedF32, Offset(fallingSpeedThreshold, PlayerData), &CommonValidators::F32Range,
|
||||
"@brief Downward speed at which we consider the player falling.\n\n" );
|
||||
|
||||
addFieldV( "recoverDelay", TypeRangedS32, Offset(recoverDelay, PlayerData), &CommonValidators::PositiveInt,
|
||||
|
|
|
|||
|
|
@ -101,10 +101,12 @@ namespace CommonValidators
|
|||
{
|
||||
FRangeValidator F32Range(F32_MIN_EX, F32_MAX);
|
||||
FRangeValidator DirFloat(-1.0f, 1.0f);
|
||||
FRangeValidator DirFloatPi(-M_PI_F, M_PI_F);
|
||||
FRangeValidator NegDefaultF32(-1.0f, F32_MAX);
|
||||
FRangeValidator PositiveFloat(0.0f, F32_MAX);
|
||||
FRangeValidator PositiveNonZeroFloat((F32)POINT_EPSILON, F32_MAX);
|
||||
FRangeValidator NormalizedFloat(0.0f, 1.0f);
|
||||
FRangeValidator F32Percent(0.0f, 100.0f);
|
||||
|
||||
FRangeValidator F32_8BitPercent(0.0f, 1.0f, BIT(8));
|
||||
FRangeValidator F32_16BitPercent(0.0f, 1.0f, BIT(16));
|
||||
|
|
@ -116,6 +118,7 @@ namespace CommonValidators
|
|||
IRangeValidator NegDefaultInt(-1, S32_MAX);
|
||||
IRangeValidator PositiveInt(0, S32_MAX);
|
||||
IRangeValidator NaturalNumber(1, S32_MAX);
|
||||
IRangeValidator S32Percent(0, 100);
|
||||
//see "T3D/gameBase/processList.h" for TickMs = 32
|
||||
IRangeValidator MSTickRange(32, S32_MAX);
|
||||
|
||||
|
|
|
|||
|
|
@ -116,10 +116,12 @@ namespace CommonValidators
|
|||
// Floats
|
||||
extern FRangeValidator F32Range;
|
||||
extern FRangeValidator DirFloat;
|
||||
extern FRangeValidator DirFloatPi;
|
||||
extern FRangeValidator NegDefaultF32;
|
||||
extern FRangeValidator PositiveFloat;
|
||||
extern FRangeValidator PositiveNonZeroFloat;
|
||||
extern FRangeValidator NormalizedFloat;
|
||||
extern FRangeValidator F32Percent;
|
||||
extern FRangeValidator F32_8BitPercent;
|
||||
extern FRangeValidator F32_16BitPercent;
|
||||
extern FRangeValidator ValidSlopeAngle;
|
||||
|
|
@ -130,6 +132,7 @@ namespace CommonValidators
|
|||
extern IRangeValidator NegDefaultInt;
|
||||
extern IRangeValidator PositiveInt;
|
||||
extern IRangeValidator NaturalNumber;
|
||||
extern IRangeValidator S32Percent;
|
||||
extern IRangeValidator MSTickRange;
|
||||
extern IRangeValidator S32_8BitCap;
|
||||
extern IRangeValidator S32_16BitCap;
|
||||
|
|
|
|||
|
|
@ -640,7 +640,7 @@ void River::initPersistFields()
|
|||
"For purposes of generating the renderable geometry River segments are further subdivided "
|
||||
"such that no quad is of greater width or length than this distance in meters." );
|
||||
|
||||
addFieldV( "FlowMagnitude", TypeRangedF32, Offset( mFlowMagnitude, River ), &CommonValidators::PositiveFloat,
|
||||
addFieldV( "FlowMagnitude", TypeRangedF32, Offset( mFlowMagnitude, River ), &CommonValidators::F32Range,
|
||||
"Magnitude of the force vector applied to dynamic objects within the River." );
|
||||
|
||||
addFieldV( "LowLODDistance", TypeRangedF32, Offset( mLodDistance, River ), &CommonValidators::PositiveFloat,
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ void WaterObject::initPersistFields()
|
|||
addArray( "Ripples (texture animation)", MAX_WAVES );
|
||||
|
||||
addField( "rippleDir", TypePoint2F, Offset( mRippleDir, WaterObject ), MAX_WAVES, "Modifies the direction of ripples on the surface." );
|
||||
addFieldV( "rippleSpeed", TypeRangedF32, Offset( mRippleSpeed, WaterObject ), &CommonValidators::PositiveFloat, MAX_WAVES, "Modifies speed of surface ripples.");
|
||||
addFieldV( "rippleSpeed", TypeRangedF32, Offset( mRippleSpeed, WaterObject ), &CommonValidators::F32Range, MAX_WAVES, "Modifies speed of surface ripples.");
|
||||
addField( "rippleTexScale", TypePoint2F, Offset( mRippleTexScale, WaterObject ), MAX_WAVES, "Intensifies the affect of the normal map "
|
||||
"applied to the surface.");
|
||||
addFieldV( "rippleMagnitude", TypeRangedF32, Offset( mRippleMagnitude, WaterObject ), &CommonValidators::PositiveFloat, MAX_WAVES, "Intensifies the vertext modification of the surface." );
|
||||
|
|
|
|||
|
|
@ -29,32 +29,12 @@ GFXImplementVertexFormat( GFXVertexP )
|
|||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPad )
|
||||
{
|
||||
addElement("PADDING", GFXDeclType_UByte4);
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPT )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 0 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPTT )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 0 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 1 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPTTT )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 0 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 1 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 2 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPC )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
|
|
@ -75,20 +55,6 @@ GFXImplementVertexFormat( GFXVertexPCT )
|
|||
addElement( "TEXCOORD", GFXDeclType_Float2, 0 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPCTT )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
addElement( "COLOR", GFXDeclType_Color );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 0 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 1 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPN )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
addElement( "NORMAL", GFXDeclType_Float3 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPNT )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
|
|
|
|||
|
|
@ -36,11 +36,6 @@
|
|||
#include "math/mPoint3.h"
|
||||
#endif
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPad )
|
||||
{
|
||||
U32 data;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexP )
|
||||
{
|
||||
Point3F point;
|
||||
|
|
@ -52,21 +47,6 @@ GFXDeclareVertexFormat( GFXVertexPT )
|
|||
Point2F texCoord;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPTT )
|
||||
{
|
||||
Point3F point;
|
||||
Point2F texCoord1;
|
||||
Point2F texCoord2;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPTTT )
|
||||
{
|
||||
Point3F point;
|
||||
Point2F texCoord1;
|
||||
Point2F texCoord2;
|
||||
Point2F texCoord3;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPC )
|
||||
{
|
||||
Point3F point;
|
||||
|
|
@ -87,20 +67,6 @@ GFXDeclareVertexFormat( GFXVertexPCT )
|
|||
Point2F texCoord;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPCTT )
|
||||
{
|
||||
Point3F point;
|
||||
GFXVertexColor color;
|
||||
Point2F texCoord;
|
||||
Point2F texCoord2;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPN )
|
||||
{
|
||||
Point3F point;
|
||||
Point3F normal;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPNT )
|
||||
{
|
||||
Point3F point;
|
||||
|
|
@ -133,27 +99,6 @@ GFXDeclareVertexFormat( GFXVertexPNTBT )
|
|||
Point2F texCoord;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
DEFINE_VERT( GFXVertexPCNT,
|
||||
GFXVertexFlagXYZ | GFXVertexFlagNormal | GFXVertexFlagDiffuse | GFXVertexFlagTextureCount1 | GFXVertexFlagUV0)
|
||||
{
|
||||
Point3F point;
|
||||
Point3F normal;
|
||||
GFXVertexColor color;
|
||||
Point2F texCoord;
|
||||
};
|
||||
|
||||
DEFINE_VERT( GFXVertexPCNTT,
|
||||
GFXVertexFlagXYZ | GFXVertexFlagNormal | GFXVertexFlagDiffuse | GFXVertexFlagTextureCount2 | GFXVertexFlagUV0 | GFXVertexFlagUV1)
|
||||
{
|
||||
Point3F point;
|
||||
Point3F normal;
|
||||
GFXVertexColor color;
|
||||
Point2F texCoord[2];
|
||||
};
|
||||
*/
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPNTTB )
|
||||
{
|
||||
Point3F point;
|
||||
|
|
@ -164,16 +109,4 @@ GFXDeclareVertexFormat( GFXVertexPNTTB )
|
|||
Point2F texCoord2;
|
||||
};
|
||||
|
||||
/*
|
||||
DEFINE_VERT( GFXVertexPNTB,
|
||||
GFXVertexFlagXYZ | GFXVertexFlagNormal | GFXVertexFlagTextureCount2 |
|
||||
GFXVertexFlagUV0 | GFXVertexFlagUVW1 )
|
||||
{
|
||||
Point3F point;
|
||||
Point3F normal;
|
||||
Point2F texCoord;
|
||||
Point3F binormal;
|
||||
};
|
||||
*/
|
||||
|
||||
#endif // _GFXVERTEXTYPES_H_
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ GuiBitmapBarCtrl::GuiBitmapBarCtrl(void)
|
|||
void GuiBitmapBarCtrl::initPersistFields()
|
||||
{
|
||||
docsURL;
|
||||
addFieldV("percent", TypeRangedF32, Offset(mPercent, GuiBitmapBarCtrl), &CommonValidators::NormalizedFloat,
|
||||
addFieldV("percent", TypeRangedF32, Offset(mPercent, GuiBitmapBarCtrl), &CommonValidators::F32Percent,
|
||||
"% shown");
|
||||
addField("vertical", TypeBool, Offset(mVertical, GuiBitmapBarCtrl),
|
||||
"If true, the bitmap is clipped vertically.");
|
||||
|
|
|
|||
|
|
@ -608,8 +608,8 @@ void Material::updateTimeBasedParams()
|
|||
for (U32 i = 0; i < MAX_STAGES; i++)
|
||||
{
|
||||
mScrollOffset[i] += mScrollDir[i] * mScrollSpeed[i] * dt;
|
||||
mScrollOffset[i].x = mWrapF(mScrollOffset[i].x, 0.0, 1.0);
|
||||
mScrollOffset[i].y = mWrapF(mScrollOffset[i].y, 0.0, 1.0);
|
||||
mScrollOffset[i].x = mWrapF(mScrollOffset[i].x, -1.0, 1.0);
|
||||
mScrollOffset[i].y = mWrapF(mScrollOffset[i].y, -1.0, 1.0);
|
||||
mRotPos[i] = mWrapF((mRotPos[i] + (mRotSpeed[i] * dt)), 0.0, 360.0);
|
||||
mWavePos[i] = mWrapF((mWavePos[i] + (mWaveFreq[i] * dt)), 0.0, 1.0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -955,20 +955,18 @@ void ProcessedShaderMaterial::_setTextureTransforms(const U32 pass)
|
|||
? waveOffset * M_2PI
|
||||
: mMaterial->mRotPos[pass];
|
||||
|
||||
MatrixF rotationMat(EulerF(0.0f, 0.0f, rotationAngle));
|
||||
|
||||
Point3F pivotPoint(
|
||||
mMaterial->mRotPivotOffset[pass].x,
|
||||
mMaterial->mRotPivotOffset[pass].y,
|
||||
0.0f);
|
||||
|
||||
MatrixF finalRotationMat(true);
|
||||
finalRotationMat.setColumn(3, pivotPoint);
|
||||
finalRotationMat.mul(rotationMat);
|
||||
finalRotationMat.setColumn(3, -pivotPoint);
|
||||
|
||||
|
||||
MatrixF rotationMat = MatrixF(EulerF(0.0, 0.0, rotationAngle), Point3F(0.5, 0.5, 0.0));
|
||||
MatrixF test(true);
|
||||
test.setColumn(3, pivotPoint);
|
||||
rotationMat.mul(test);
|
||||
rotationMat.displace(texMat.getPosition());
|
||||
// Apply final rotation matrix
|
||||
texMat.mul(finalRotationMat);
|
||||
texMat = rotationMat;
|
||||
}
|
||||
|
||||
// --- Scale Animation ---
|
||||
|
|
|
|||
|
|
@ -2212,9 +2212,13 @@ void RTLightingFeatGLSL::processPix( Vector<ShaderComponent*> &componentList,
|
|||
|
||||
Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
|
||||
|
||||
Var *ambient = new Var( "ambient", "vec4" );
|
||||
ambient->uniform = true;
|
||||
ambient->constSortPos = cspPass;
|
||||
Var* ambient = (Var*)LangElement::find("ambient");
|
||||
if (!ambient)
|
||||
{
|
||||
ambient = new Var("ambient", "vec4");
|
||||
ambient->uniform = true;
|
||||
ambient->constSortPos = cspPass;
|
||||
}
|
||||
|
||||
Var* lighting = new Var("lighting", "vec4");
|
||||
meta->addStatement(new GenOp(" @ = compute4Lights( @, @, @, @,\r\n"
|
||||
|
|
@ -3091,9 +3095,9 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
|
|||
Var *ambient = (Var *)LangElement::find("ambient");
|
||||
if (!ambient)
|
||||
{
|
||||
ambient = new Var("ambient", "vec3");
|
||||
eyePos->uniform = true;
|
||||
eyePos->constSortPos = cspPass;
|
||||
ambient = new Var("ambient", "vec4");
|
||||
ambient->uniform = true;
|
||||
ambient->constSortPos = cspPass;
|
||||
}
|
||||
meta->addStatement(new GenOp(" @.rgb *= @.rgb;\r\n", ibl, ambient));
|
||||
meta->addStatement(new GenOp(" @.rgb = @.rgb;\r\n", curColor, ibl));
|
||||
|
|
|
|||
|
|
@ -2284,9 +2284,13 @@ void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
|
|||
|
||||
Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
|
||||
|
||||
Var *ambient = new Var( "ambient", "float4" );
|
||||
ambient->uniform = true;
|
||||
ambient->constSortPos = cspPass;
|
||||
Var* ambient = (Var*)LangElement::find("ambient");
|
||||
if (!ambient)
|
||||
{
|
||||
ambient = new Var("ambient", "float4");
|
||||
ambient->uniform = true;
|
||||
ambient->constSortPos = cspPass;
|
||||
}
|
||||
|
||||
Var* lighting = new Var("lighting", "float4");
|
||||
meta->addStatement(new GenOp(" @ = compute4Lights( @, @, @, @,\r\n"
|
||||
|
|
@ -3179,9 +3183,9 @@ void ReflectionProbeFeatHLSL::processPix(Vector<ShaderComponent*> &componentList
|
|||
Var *ambient = (Var *)LangElement::find("ambient");
|
||||
if (!ambient)
|
||||
{
|
||||
ambient = new Var("ambient","float3");
|
||||
eyePos->uniform = true;
|
||||
eyePos->constSortPos = cspPass;
|
||||
ambient = new Var("ambient","float4");
|
||||
ambient->uniform = true;
|
||||
ambient->constSortPos = cspPass;
|
||||
}
|
||||
meta->addStatement(new GenOp(" @.rgb *= @.rgb;\r\n", ibl, ambient));
|
||||
meta->addStatement(new GenOp(" @.rgb = @.rgb;\r\n", curColor, ibl));
|
||||
|
|
|
|||
|
|
@ -459,18 +459,12 @@ GFXShader* ShaderGen::getShader( const MaterialFeatureData &featureData, const G
|
|||
// Build a description string from the features
|
||||
// and vertex format combination ( and macros ).
|
||||
String shaderDescription = vertexFormat->getDescription() + features.getDescription();
|
||||
if ( macros && !macros->empty() )
|
||||
{
|
||||
String macroStr;
|
||||
GFXShaderMacro::stringize( *macros, ¯oStr );
|
||||
shaderDescription += macroStr;
|
||||
}
|
||||
|
||||
// Generate a single 64bit hash from the description string.
|
||||
//
|
||||
// Don't get paranoid! This has 1 in 18446744073709551616
|
||||
// chance for collision... it won't happen in this lifetime.
|
||||
//
|
||||
shaderDescription.replace("\n", " ");
|
||||
U64 hash = Torque::hash64( (const U8*)shaderDescription.c_str(), shaderDescription.length(), 0 );
|
||||
hash = convertHostToLEndian(hash);
|
||||
U32 high = (U32)( hash >> 32 );
|
||||
|
|
|
|||
|
|
@ -144,13 +144,20 @@ function GameConnectionListener::onSetSpawnObjectTypeComplete( %this, %client )
|
|||
// a new one could result in an uncontrolled player object.
|
||||
error("Attempting to create a player for a client that already has one!");
|
||||
}
|
||||
|
||||
if ((!isClass(%client.spawnClass)) || (!isClass(%client.spawnDBType)) || (!isObject(%client.spawnDataBlock)))
|
||||
%this.onSetSpawnObjectTypeFailed(%client, false );
|
||||
|
||||
%client.setSpawnPoint();
|
||||
}
|
||||
|
||||
function GameConnectionListener::onSetSpawnObjectTypeFailed( %this, %client, %canContinueOnFail )
|
||||
{
|
||||
errorf("Failed to properly set Spawn Object Type for client: " @ %client);
|
||||
error("Failed to properly set Spawn Object Type for client: " @ %client);
|
||||
//baseline controlObject spawn type with extention points
|
||||
%client.spawnClass = "Camera";
|
||||
%client.spawnDBType = "CameraData";
|
||||
%client.spawnDataBlock = "Observer";
|
||||
%client.onSetSpawnObjectTypeComplete(%client);
|
||||
}
|
||||
|
||||
function GameConnection::setSpawnPoint( %this )
|
||||
|
|
@ -246,7 +253,15 @@ function GameConnectionListener::onSetSpawnPointComplete( %this, %client )
|
|||
|
||||
function GameConnectionListener::onSetSpawnPointFailed( %this, %client, %canContinueOnFail )
|
||||
{
|
||||
errorf("Failed to properly set Spawn Object Type for client: " @ %client);
|
||||
error("Failed to properly set Spawn Location for client: " @ %client);
|
||||
|
||||
//baseline spawn point config rules with extention points
|
||||
%this.playerSpawnGroups = "PlayerSpawnPoints PlayerDropPoints";
|
||||
%this.spawnPoint = "";
|
||||
%this.spawnLocation = "0 0 0";
|
||||
%this.spawnProperties = "";
|
||||
%this.spawnScript = "";
|
||||
%this.onSetSpawnPointComplete(%client);
|
||||
}
|
||||
|
||||
function GameConnection::onPostSpawn( %this )
|
||||
|
|
|
|||
|
|
@ -433,16 +433,24 @@ void dampen(inout Surface surface, sampler2D WetnessTexture, float accumTime, fl
|
|||
vec3 n = abs(surface.N);
|
||||
float ang = clamp(n.z, 0.04, 0.96);
|
||||
|
||||
float speed = accumTime*(1.0-surface.roughness)*ang;
|
||||
vec2 wetoffset = vec2(speed,speed/2);
|
||||
|
||||
float speed = -accumTime*(1.0-surface.linearRoughnessSq)*clamp((2.0-ang), 0.04, 0.96);
|
||||
if ((n.x > 0.0) || (n.y > 0.0))
|
||||
speed *= -1.0;
|
||||
vec2 wetoffset = vec2(speed,speed)*0.1;
|
||||
|
||||
vec3 wetNormal = texture(WetnessTexture, float2(surface.P.xy*0.1+wetoffset)).xyz;
|
||||
wetNormal = lerp(wetNormal,texture(WetnessTexture,float2(surface.P.zx*0.1+wetoffset)).rgb ,n.y);
|
||||
wetNormal = lerp(wetNormal,texture(WetnessTexture,float2(surface.P.zy*0.1+wetoffset)).rgb ,n.x);
|
||||
surface.N = lerp(surface.N, wetNormal, degree);
|
||||
|
||||
float wetness = texture(WetnessTexture, vec2(surface.P.xy*0.1+wetoffset)).b;
|
||||
wetness = lerp(wetness,texture(WetnessTexture,vec2(surface.P.zx*0.1+wetoffset)).b,n.y);
|
||||
wetness = lerp(wetness,texture(WetnessTexture,vec2(surface.P.zy*0.1+wetoffset)).b,n.x);
|
||||
wetness = pow(wetness*ang*degree,3);
|
||||
|
||||
surface.roughness = lerp(surface.roughness, 0.04f, wetness);
|
||||
surface.baseColor.rgb = lerp(surface.baseColor.rgb, surface.baseColor.rgb*0.96+vec3(0.04,0.04,0.04), pow(wetness,5));
|
||||
surface.baseColor.rgb = lerp(surface.baseColor.rgb, surface.baseColor.rgb*0.6+float3(0.4,0.4,0.4)*wetness, wetness);
|
||||
surface.metalness = lerp(surface.metalness, 0.96, wetness);
|
||||
updateSurface(surface);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -436,16 +436,24 @@ void dampen(inout Surface surface, TORQUE_SAMPLER2D(WetnessTexture), float accum
|
|||
float3 n = abs(surface.N);
|
||||
float ang = clamp(n.z, 0.04, 0.96);
|
||||
|
||||
float speed = accumTime*(1.0-surface.roughness)*ang;
|
||||
float2 wetoffset = float2(speed,speed/2);
|
||||
|
||||
float speed = -accumTime*(1.0-surface.linearRoughnessSq)*clamp((2.0-ang), 0.04, 0.96);
|
||||
if ((n.x > 0.0) || (n.y > 0.0))
|
||||
speed *= -1.0;
|
||||
float2 wetoffset = float2(speed,speed)*0.1;
|
||||
|
||||
float3 wetNormal = TORQUE_TEX2D(WetnessTexture, float2(surface.P.xy*0.1+wetoffset)).xyz;
|
||||
wetNormal = lerp(wetNormal,TORQUE_TEX2D(WetnessTexture,float2(surface.P.zx*0.1+wetoffset)).rgb ,n.y);
|
||||
wetNormal = lerp(wetNormal,TORQUE_TEX2D(WetnessTexture,float2(surface.P.zy*0.1+wetoffset)).rgb ,n.x);
|
||||
surface.N = lerp(surface.N, wetNormal, degree);
|
||||
|
||||
float wetness = TORQUE_TEX2D(WetnessTexture, float2(surface.P.xy*0.1+wetoffset)).b;
|
||||
wetness = lerp(wetness,TORQUE_TEX2D(WetnessTexture,float2(surface.P.zx*0.1+wetoffset)).b,n.y);
|
||||
wetness = lerp(wetness,TORQUE_TEX2D(WetnessTexture,float2(surface.P.zy*0.1+wetoffset)).b,n.x);
|
||||
wetness = pow(wetness*ang*degree,3);
|
||||
|
||||
surface.roughness = lerp(surface.roughness, 0.04f, wetness);
|
||||
surface.baseColor.rgb = lerp(surface.baseColor.rgb, surface.baseColor.rgb*0.96+float3(0.04,0.04,0.04), pow(wetness,5));
|
||||
surface.baseColor.rgb = lerp(surface.baseColor.rgb, surface.baseColor.rgb*0.6+float3(0.4,0.4,0.4)*wetness, wetness);
|
||||
surface.metalness = lerp(surface.metalness, 0.96, wetness);
|
||||
surface.Update();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ void main()
|
|||
|
||||
vec2 envBRDF = textureLod(BRDFTexture, vec2(surface.NdotV, surface.roughness),0).rg;
|
||||
vec3 diffuse = irradiance * lerp(surface.baseColor.rgb, vec3(0.04f,0.04f,0.04f), surface.metalness);
|
||||
vec3 specularCol = ((specular * surface.baseColor.rgb) * envBRDF.x + envBRDF.y)*surface.metalness;
|
||||
vec3 specularCol = (specular * surface.f0 * envBRDF.x + envBRDF.y)*surface.metalness;
|
||||
|
||||
float horizonOcclusion = 1.3;
|
||||
float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
|
||||
if (SkylightDamp>0)
|
||||
wetAmmout += alpha;
|
||||
|
||||
dampen(surface, TORQUE_SAMPLER2D_MAKEARG(WetnessTexture), accumTime, wetAmmout*dampness);
|
||||
|
||||
// Radiance (Specular)
|
||||
|
|
@ -179,9 +180,9 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
specular += TORQUE_TEXCUBEARRAYLOD(specularCubemapAR, dir, cubemapIdx, lod).xyz * contrib;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if(skylightCubemapIdx != -1 && alpha >= 0.001)
|
||||
{
|
||||
{
|
||||
irradiance = lerp(irradiance,TORQUE_TEXCUBEARRAYLOD(irradianceCubemapAR, surface.N, skylightCubemapIdx, 0).xyz,alpha);
|
||||
specular = lerp(specular,TORQUE_TEXCUBEARRAYLOD(specularCubemapAR, surface.R, skylightCubemapIdx, lod).xyz,alpha);
|
||||
}
|
||||
|
|
@ -193,8 +194,8 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
#endif
|
||||
|
||||
float2 envBRDF = TORQUE_TEX2DLOD(BRDFTexture, float4(surface.NdotV, surface.roughness,0,0)).rg;
|
||||
float3 diffuse = irradiance * lerp(surface.baseColor.rgb, 0.04f, surface.metalness);
|
||||
float3 specularCol = ((specular * surface.baseColor.rgb) * envBRDF.x + envBRDF.y)*surface.metalness;
|
||||
float3 diffuse = irradiance * lerp(surface.baseColor.rgb, float3(0.04f,0.04f,0.04f), surface.metalness);
|
||||
float3 specularCol = (specular * surface.f0 * envBRDF.x + envBRDF.y)*surface.metalness;
|
||||
|
||||
float horizonOcclusion = 1.3;
|
||||
float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue