GetTextureInstance() public méthode

Get the instance for a local texture.
It is only valid to call this when local textures have been loaded, which in practice means that the compositor instance is active. Calling it at other times will cause an exception. Note that since textures are cleaned up aggressively, this name is not guaranteed to stay the same if you disable and renable the compositor instance.
public GetTextureInstance ( string name ) : Axiom.Core.Texture
name string The name of the texture in the original compositor definition
Résultat Axiom.Core.Texture
Exemple #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="instance"></param>
 /// <param name="texture"></param>
 /// <returns></returns>
 private bool IsInputToOutputTarget( CompositorInstance instance, Texture texture )
 {
     var tp = instance.Technique.OutputTarget;
     foreach ( var p in tp.Passes )
     {
         for ( var i = 0; i < p.Inputs.Length; i++ )
         {
             var t = instance.GetTextureInstance( p.GetInput( i ).Name, 0 );
             if ( t != null && t == texture )
             {
                 return true;
             }
         }
     }
     return false;
 }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="instance"></param>
 /// <param name="texture"></param>
 /// <returns></returns>
 private bool IsInputPreviousTarget( CompositorInstance instance, Texture texture )
 {
     foreach ( var tp in instance.Technique.TargetPasses )
     {
         if ( tp.InputMode == CompositorInputMode.Previous )
         {
             // Don't have to worry about an MRT, because no MRT can be input previous
             var t = instance.GetTextureInstance( tp.OutputName, 0 );
             if ( t != null && t == texture )
             {
                 return true;
             }
         }
     }
     return false;
 }