private LayeredBlending CreateOrRetrieveSubRenderState(ScriptTranslator translator) { LayeredBlending layeredBlendState = null; //check if we already create a blend srs SubRenderState subState = translator.GetGeneratedSubRenderState(Type); if (subState != null) { layeredBlendState = subState as LayeredBlending; } else { SubRenderState subRenderState = CreateOrRetrieveInstance(translator); layeredBlendState = (LayeredBlending)subRenderState; } return(layeredBlendState); }