/// <summary> /// Create or update the Effect of the effect mesh. /// </summary> protected void UpdateEffect(RenderContext context, RenderMesh renderMesh, ParameterCollection passParameters) { if (dynamicEffectCompiler.Update(renderMesh, passParameters)) { renderMesh.Initialize(context.GraphicsDevice); } }
/// <summary> /// Create or update the Effect of the effect mesh. /// </summary> protected void UpdateEffect(RenderContext context, RenderMesh renderMesh, ParameterCollection passParameters) { if (dynamicEffectCompiler.Update(renderMesh, passParameters)) { try { renderMesh.Initialize(context.GraphicsDevice); } catch (Exception e) { Log.Error("Could not initialize RenderMesh, trying again with error fallback effect", e); // Try again with error effect to show user something failed with this model // TODO: What if an exception happens in this case too? Mark renderMesh as ignored or null? dynamicEffectCompiler.SwitchFallbackEffect(FallbackEffectType.Error, renderMesh, passParameters); renderMesh.Initialize(context.GraphicsDevice); } } }
/// <summary> /// Create or update the Effect of the effect mesh. /// </summary> protected void UpdateEffect(RenderContext context, RenderMesh renderMesh, ParameterCollection passParameters) { if (dynamicEffectCompiler.Update(renderMesh, passParameters)) { renderMesh.Initialize(context.GraphicsDevice); } }
/// <summary> /// Create or update the Effect of the effect mesh. /// </summary> protected void UpdateEffect(RenderContext context, RenderMesh renderMesh, ParameterCollection passParameters) { if (dynamicEffectCompiler.Update(renderMesh, passParameters)) { try { renderMesh.Initialize(context.GraphicsDevice); } catch (Exception e) { Log.Error("Could not initialize RenderMesh, trying again with error fallback effect", e); // Try again with error effect to show user something failed with this model // TODO: What if an exception happens in this case too? Mark renderMesh as ignored or null? dynamicEffectCompiler.SwitchFallbackEffect(FallbackEffectType.Error, renderMesh, passParameters); renderMesh.Initialize(context.GraphicsDevice); } } }