MCPcopy Create free account
hub / github.com/OGRECave/ogre / translateShadowCasterProgramRef

Method translateShadowCasterProgramRef

OgreMain/src/OgreScriptTranslator.cpp:2254–2280  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2252 }
2253 //-------------------------------------------------------------------------
2254 void PassTranslator::translateShadowCasterProgramRef(GpuProgramType type, ScriptCompiler *compiler, ObjectAbstractNode *node)
2255 {
2256 auto program = getProgram(compiler, node);
2257 if(!program) return;
2258 auto pass = any_cast<Pass*>(node->parent->context);
2259
2260 compiler->addError(ScriptCompiler::CE_DEPRECATEDSYMBOL, node->file, node->line,
2261 node->cls + ". Use shadow_caster_material instead");
2262
2263 auto caster_mat = pass->getParent()->getShadowCasterMaterial();
2264 if(!caster_mat)
2265 {
2266 auto src_mat = pass->getParent()->getParent();
2267 // only first pass of this will be used. The caster material is technique specific.
2268 caster_mat = src_mat->clone(
2269 StringUtil::format("%s/%p/CasterFallback", src_mat->getName().c_str(), pass->getParent()));
2270 pass->getParent()->setShadowCasterMaterial(caster_mat);
2271 }
2272 auto caster_pass = caster_mat->getTechnique(0)->getPass(0);
2273
2274 caster_pass->setGpuProgram(type, program);
2275 if(program->isSupported())
2276 {
2277 GpuProgramParametersSharedPtr params = caster_pass->getGpuProgramParameters(type);
2278 GpuProgramTranslator::translateProgramParameters(compiler, params, node);
2279 }
2280 }
2281 //-------------------------------------------------------------------------
2282 void PassTranslator::translateShadowReceiverProgramRef(GpuProgramType type,ScriptCompiler *compiler, ObjectAbstractNode *node)
2283 {

Callers

nothing calls this directly

Calls 11

getProgramFunction · 0.85
addErrorMethod · 0.80
getPassMethod · 0.80
getParentMethod · 0.45
cloneMethod · 0.45
getNameMethod · 0.45
getTechniqueMethod · 0.45
setGpuProgramMethod · 0.45
isSupportedMethod · 0.45

Tested by

no test coverage detected