MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getShaderMacros

Method getShaderMacros

Engine/source/materials/matTextureTarget.cpp:119–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void NamedTexTarget::getShaderMacros( Vector<GFXShaderMacro> *outMacros )
120{
121 ConditionerFeature *cond = getConditioner();
122 if ( !cond )
123 return;
124
125 // TODO: No check for duplicates is
126 // going on here which might be a problem?
127
128 String targetName = String::ToLower( mName );
129
130 // Add both the condition and uncondition macros.
131 const String &condMethod = cond->getShaderMethodName( ConditionerFeature::ConditionMethod );
132 if ( condMethod.isNotEmpty() )
133 {
134 GFXShaderMacro macro;
135 macro.name = targetName + "Condition";
136 macro.value = condMethod;
137 outMacros->push_back( macro );
138 }
139
140 const String &uncondMethod = cond->getShaderMethodName( ConditionerFeature::UnconditionMethod );
141 if ( uncondMethod.isNotEmpty() )
142 {
143 GFXShaderMacro macro;
144 macro.name = targetName + "Uncondition";
145 macro.value = uncondMethod;
146 outMacros->push_back( macro );
147 }
148}
149
150DefineEngineFunction(getNamedTargetList, String, (), , "")
151{

Callers 1

_setStageDataMethod · 0.45

Calls 3

ToLowerFunction · 0.50
isNotEmptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected