Merge branch 'development' into defineconsolemethod

Conflicts:
	Engine/source/materials/materialDefinition.cpp
This commit is contained in:
Daniel Buckmaster 2014-12-26 13:22:16 +11:00
commit ae284a89ec
129 changed files with 3742 additions and 1038 deletions

View file

@ -35,6 +35,7 @@
#include "sfx/sfxTrack.h"
#include "sfx/sfxTypes.h"
#include "core/util/safeDelete.h"
#include "T3D/accumulationVolume.h"
IMPLEMENT_CONOBJECT( Material );
@ -120,6 +121,13 @@ Material::Material()
mSpecularStrength[i] = 1.0f;
mPixelSpecular[i] = false;
mAccuEnabled[i] = false;
mAccuScale[i] = 1.0f;
mAccuDirection[i] = 1.0f;
mAccuStrength[i] = 0.6f;
mAccuCoverage[i] = 0.9f;
mAccuSpecular[i] = 16.0f;
mParallaxScale[i] = 0.0f;
mVertLit[i] = false;
@ -251,6 +259,24 @@ void Material::initPersistFields()
"normal map texture. Note that if pixel specular is enabled the DXTnm format will not "
"work with your normal map, unless you are also using a specular map." );
addProtectedField( "accuEnabled", TYPEID< bool >(), Offset( mAccuEnabled, Material ),
&_setAccuEnabled, &defaultProtectedGetFn, MAX_STAGES, "Accumulation texture." );
addField("accuScale", TypeF32, Offset(mAccuScale, Material), MAX_STAGES,
"The scale that is applied to the accu map texture. You can use this to fit the texture to smaller or larger objects.");
addField("accuDirection", TypeF32, Offset(mAccuDirection, Material), MAX_STAGES,
"The direction of the accumulation. Chose whether you want the accu map to go from top to bottom (ie. snow) or upwards (ie. mold).");
addField("accuStrength", TypeF32, Offset(mAccuStrength, Material), MAX_STAGES,
"The strength of the accu map. This changes the transparency of the accu map texture. Make it subtle or add more contrast.");
addField("accuCoverage", TypeF32, Offset(mAccuCoverage, Material), MAX_STAGES,
"The coverage ratio of the accu map texture. Use this to make the entire shape pick up some of the accu map texture or none at all.");
addField("accuSpecular", TypeF32, Offset(mAccuSpecular, Material), MAX_STAGES,
"Changes specularity to this value where the accumulated material is present.");
addField( "specularMap", TypeImageFilename, Offset(mSpecularMapFilename, Material), MAX_STAGES,
"The specular map texture. The RGB channels of this texture provide a per-pixel replacement for the 'specular' parameter on the material. "
"If this texture contains alpha information, the alpha channel of the texture will be used as the gloss map. "
@ -670,4 +696,18 @@ DefineConsoleMethod( Material, setAutoGenerated, void, (bool isAutoGenerated), ,
"setAutoGenerated(bool isAutoGenerated): Set whether or not the Material is autogenerated." )
{
object->setAutoGenerated(isAutoGenerated);
}
// Accumulation
bool Material::_setAccuEnabled( void *object, const char *index, const char *data )
{
Material* mat = reinterpret_cast< Material* >( object );
if ( index )
{
U32 i = dAtoui(index);
mat->mAccuEnabled[i] = dAtob(data);
AccumulationVolume::refreshVolumes();
}
return true;
}