mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-10 06:51:04 +00:00
give afx the gfx cleanup treatment
This commit is contained in:
parent
6d71bec417
commit
028bf1df9b
|
|
@ -103,7 +103,6 @@ void afxZodiacGroundPlaneRenderer::initShader()
|
|||
GFXStateBlockDesc d;
|
||||
|
||||
d.cullDefined = true;
|
||||
d.ffLighting = false;
|
||||
d.blendDefined = true;
|
||||
d.blendEnable = true;
|
||||
d.zDefined = false;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ void afxZodiacMeshRoadRenderer::initShader()
|
|||
GFXStateBlockDesc d;
|
||||
|
||||
d.cullDefined = true;
|
||||
d.ffLighting = false;
|
||||
d.blendDefined = true;
|
||||
d.blendEnable = true;
|
||||
d.zDefined = false;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ void afxZodiacPolysoupRenderer::initShader()
|
|||
GFXStateBlockDesc d;
|
||||
|
||||
d.cullDefined = true;
|
||||
d.ffLighting = false;
|
||||
d.blendDefined = true;
|
||||
d.blendEnable = true;
|
||||
d.zDefined = false;
|
||||
|
|
|
|||
|
|
@ -113,7 +113,6 @@ void afxZodiacTerrainRenderer::initShader()
|
|||
GFXStateBlockDesc d;
|
||||
|
||||
d.cullDefined = true;
|
||||
d.ffLighting = false;
|
||||
d.blendDefined = true;
|
||||
d.blendEnable = true;
|
||||
d.zDefined = false;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ afxBillboardData::afxBillboardData()
|
|||
blendStyle = BlendUndefined;
|
||||
srcBlendFactor = BLEND_UNDEFINED;
|
||||
dstBlendFactor = BLEND_UNDEFINED;
|
||||
texFunc = TexFuncModulate;
|
||||
}
|
||||
|
||||
afxBillboardData::afxBillboardData(const afxBillboardData& other, bool temp_clone)
|
||||
|
|
@ -77,7 +76,6 @@ afxBillboardData::afxBillboardData(const afxBillboardData& other, bool temp_clon
|
|||
blendStyle = other.blendStyle;
|
||||
srcBlendFactor = other.srcBlendFactor;
|
||||
dstBlendFactor = other.dstBlendFactor;
|
||||
texFunc = other.texFunc;
|
||||
}
|
||||
|
||||
#define myOffset(field) Offset(field, afxBillboardData)
|
||||
|
|
@ -92,12 +90,6 @@ ImplementEnumType( afxBillboard_BlendStyle, "Possible blending types.\n" "@ingro
|
|||
{ afxBillboardData::BlendPremultAlpha, "PREMULTALPHA", "..." },
|
||||
EndImplementEnumType;
|
||||
|
||||
ImplementEnumType( afxBillboard_TexFuncType, "Possible texture function types.\n" "@ingroup afxBillboard\n\n" )
|
||||
{ afxBillboardData::TexFuncReplace, "replace", "..." },
|
||||
{ afxBillboardData::TexFuncModulate, "modulate", "..." },
|
||||
{ afxBillboardData::TexFuncAdd, "add", "..." },
|
||||
EndImplementEnumType;
|
||||
|
||||
void afxBillboardData::initPersistFields()
|
||||
{
|
||||
addField("color", TypeColorF, myOffset(color),
|
||||
|
|
@ -123,11 +115,6 @@ void afxBillboardData::initPersistFields()
|
|||
"Specifies destination blend factor when blendStyle is set to 'user'.\n"
|
||||
"Possible values: GFXBlendZero, GFXBlendOne, GFXBlendSrcColor, GFXBlendInvSrcColor, GFXBlendSrcAlpha, GFXBlendInvSrcAlpha, GFXBlendDestAlpha, or GFXBlendInvDestAlpha");
|
||||
|
||||
addField("textureFunction", TYPEID<afxBillboardData::TexFuncType>(), myOffset(texFunc),
|
||||
"Selects a texture function that determines how the texture pixels are combined "
|
||||
"with the shaded color of the billboard's quadrangle geometry.\n"
|
||||
"Possible values: replace, modulate, or add.");
|
||||
|
||||
Parent::initPersistFields();
|
||||
}
|
||||
|
||||
|
|
@ -145,7 +132,6 @@ void afxBillboardData::packData(BitStream* stream)
|
|||
|
||||
stream->writeInt(srcBlendFactor, 4);
|
||||
stream->writeInt(dstBlendFactor, 4);
|
||||
stream->writeInt(texFunc, 4);
|
||||
}
|
||||
|
||||
void afxBillboardData::unpackData(BitStream* stream)
|
||||
|
|
@ -163,7 +149,6 @@ void afxBillboardData::unpackData(BitStream* stream)
|
|||
|
||||
srcBlendFactor = (GFXBlend) stream->readInt(4);
|
||||
dstBlendFactor = (GFXBlend) stream->readInt(4);
|
||||
texFunc = stream->readInt(4);
|
||||
}
|
||||
|
||||
bool afxBillboardData::preload(bool server, String &errorStr)
|
||||
|
|
@ -291,4 +276,4 @@ void afxBillboard::onRemove()
|
|||
Parent::onRemove();
|
||||
}
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
|
|
|
|||
|
|
@ -46,12 +46,6 @@ public:
|
|||
BlendUser,
|
||||
};
|
||||
|
||||
enum TexFuncType {
|
||||
TexFuncReplace,
|
||||
TexFuncModulate,
|
||||
TexFuncAdd,
|
||||
};
|
||||
|
||||
public:
|
||||
StringTableEntry txr_name;
|
||||
GFXTexHandle txr;
|
||||
|
|
@ -62,7 +56,6 @@ public:
|
|||
S32 blendStyle;
|
||||
GFXBlend srcBlendFactor;
|
||||
GFXBlend dstBlendFactor;
|
||||
S32 texFunc;
|
||||
|
||||
public:
|
||||
/*C*/ afxBillboardData();
|
||||
|
|
@ -84,8 +77,6 @@ public:
|
|||
typedef afxBillboardData::BlendStyle afxBillboard_BlendStyle;
|
||||
DefineEnumType( afxBillboard_BlendStyle );
|
||||
|
||||
typedef afxBillboardData::TexFuncType afxBillboard_TexFuncType;
|
||||
DefineEnumType( afxBillboard_TexFuncType );
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
// afxBillboard
|
||||
|
|
|
|||
|
|
@ -72,20 +72,6 @@ void afxBillboard::_renderBillboard(ObjectRenderInst *ri, SceneRenderState* stat
|
|||
desc.zWriteEnable = false;
|
||||
|
||||
desc.samplersDefined = true;
|
||||
switch (mDataBlock->texFunc)
|
||||
{
|
||||
case afxBillboardData::TexFuncReplace:
|
||||
desc.samplers[0].textureColorOp = GFXTOPDisable;
|
||||
break;
|
||||
case afxBillboardData::TexFuncModulate:
|
||||
desc.samplers[0].textureColorOp = GFXTOPModulate;
|
||||
break;
|
||||
case afxBillboardData::TexFuncAdd:
|
||||
desc.samplers[0].textureColorOp = GFXTOPAdd;
|
||||
break;
|
||||
}
|
||||
|
||||
desc.samplers[1].textureColorOp = GFXTOPDisable;
|
||||
|
||||
normal_sb = GFX->createStateBlock(desc);
|
||||
|
||||
|
|
@ -142,4 +128,4 @@ void afxBillboard::_renderBillboard(ObjectRenderInst *ri, SceneRenderState* stat
|
|||
PrimBuild::end();
|
||||
}
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ void afxMooring::_renderAxisLines(ObjectRenderInst *ri, SceneRenderState* state,
|
|||
desc.blendEnable = false;
|
||||
desc.cullDefined = true;
|
||||
desc.cullMode = GFXCullNone;
|
||||
desc.ffLighting = false;
|
||||
desc.zDefined = true;
|
||||
desc.zWriteEnable = false;
|
||||
|
||||
|
|
@ -85,4 +84,4 @@ void afxMooring::_renderAxisLines(ObjectRenderInst *ri, SceneRenderState* state,
|
|||
PrimBuild::end();
|
||||
}
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
|
|
|
|||
|
|
@ -128,8 +128,6 @@ void afxZodiacPlane::_renderZodiacPlane(ObjectRenderInst *ri, SceneRenderState*
|
|||
desc.zFunc = GFXCmpLessEqual;
|
||||
desc.zWriteEnable = false;
|
||||
desc.samplersDefined = true;
|
||||
desc.samplers[0].textureColorOp = GFXTOPModulate;
|
||||
desc.samplers[1].textureColorOp = GFXTOPDisable;
|
||||
|
||||
normal_sb = GFX->createStateBlock(desc);
|
||||
if (mDataBlock->double_sided)
|
||||
|
|
|
|||
Loading…
Reference in a new issue