mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
cleaned up variant of https://github.com/GarageGames/Torque3D/pull/768 alterations: opengl support, in-shader bug-reporting, direction vector fit to material slider-bar.
This commit is contained in:
parent
949251b988
commit
c6cdfafe4e
42 changed files with 2680 additions and 8 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include "sfx/sfxTrack.h"
|
||||
#include "sfx/sfxTypes.h"
|
||||
#include "core/util/safeDelete.h"
|
||||
#include "T3D/accumulationVolume.h"
|
||||
|
||||
|
||||
IMPLEMENT_CONOBJECT( Material );
|
||||
|
|
@ -119,6 +120,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;
|
||||
|
|
@ -250,6 +258,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. "
|
||||
|
|
@ -669,4 +695,18 @@ ConsoleMethod( Material, setAutoGenerated, void, 3, 3,
|
|||
"setAutoGenerated(bool isAutoGenerated): Set whether or not the Material is autogenerated." )
|
||||
{
|
||||
object->setAutoGenerated(dAtob(argv[2]));
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue