ShaderGeneratorContext Class
              
              
              Namespace: Stride.Rendering.Materials
              Assembly: Stride.Rendering.dll
              
              
              Base class for generating shader class source with associated parameters.
 
              
              
              
              
              
              
              
              
                public class ShaderGeneratorContext : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
               
              
              
              
              
              
                  
              
                     
              
                
                  |
                  Improve this Doc
                
                
                  View Source
                
              
              
                Constructors
              
                
              
              
              
              
              
              ShaderGeneratorContext(GraphicsDevice)
              
              
              
              
              
                public ShaderGeneratorContext(GraphicsDevice graphicsDevice = null)
               
              
              Parameters
              
                     
              
                
                  |
                  Improve this Doc
                
                
                  View Source
                
              
              
                Properties
              
                
              
              
              
              
              
              ColorSpace
              
              
              
              
              
                public ColorSpace ColorSpace { get; set; }
               
              
              Property Value
              
              
              
              
              
              
              Content
              
              Gets or sets the asset manager.
 
              
              
              
                public ContentManager Content { get; set; }
               
              
              Property Value
              
              
              
              
              
              
              CurrentOverrides
              
              
              
              
              
                public MaterialOverrides CurrentOverrides { get; }
               
              
              Property Value
              
              
              
              
              
              
              FindAsset
              
              
              
              
              
                public ShaderGeneratorContext.FindAssetDelegate FindAsset { get; set; }
               
              
              Property Value
              
              
              
              
              
              
              GetAssetFriendlyName
              
              
              
              
              
                public ShaderGeneratorContext.GetAssetFriendlyNameDelegate GetAssetFriendlyName { get; set; }
               
              
              Property Value
              
              
              
              
              
              
              IsNotPixelStage
              
              
              
              
              
                public bool IsNotPixelStage { get; set; }
               
              
              Property Value
              
                
                  
                    | Type | 
                    Description | 
                  
                
                
                  
                    | System.Boolean | 
                     | 
                  
                
              
              
              
              
              
              
              Log
              
              
              
              
              
                public LoggerResult Log { get; set; }
               
              
              Property Value
              
              
              
              
              
              
              OptimizeMaterials
              
              Gets or sets a value indicating whether materials will be optimized (textures blended together, generate optimized shader permutations, etc...).
 
              
              
              
                public bool OptimizeMaterials { get; set; }
               
              
              Property Value
              
                
                  
                    | Type | 
                    Description | 
                  
                
                
                  
                    | System.Boolean | 
                    true if [materials are optimized]; otherwise, false. 
 | 
                  
                
              
              
              
              
              
              
              Parameters
              
              
              
              
              
                public ParameterCollection Parameters { get; set; }
               
              
              Property Value
              
                     
              
                
                  |
                  Improve this Doc
                
                
                  View Source
                
              
              
                Methods
              
                
              
              
              
              
              
              GenerateTextureFromColor(Color)
              
              
              
              
              
                public Texture GenerateTextureFromColor(Color color)
               
              
              Parameters
              
                
                  
                    | Type | 
                    Name | 
                    Description | 
                  
                
                
                  
                    | Color | 
                    color | 
                     | 
                  
                
              
              Returns
              
              
              
              
              
              
              GetParameterKey(ParameterKey)
              
              
              
              
              
                public ParameterKey GetParameterKey(ParameterKey key)
               
              
              Parameters
              
              Returns
              
              
              
              
              
              
              GetSamplerKey(SamplerStateDescription, GraphicsDevice)
              
              
              
              
              
                public ObjectParameterKey<SamplerState> GetSamplerKey(SamplerStateDescription samplerStateDesc, GraphicsDevice graphicsDevice)
               
              
              Parameters
              
              Returns
              
              
              
              
              
              
              GetSamplerKey(ComputeColorParameterSampler)
              
              
              
              
              
                public ObjectParameterKey<SamplerState> GetSamplerKey(ComputeColorParameterSampler sampler)
               
              
              Parameters
              
              Returns
              
              
              
              
              
              
              GetTextureKey(Texture, ObjectParameterKey<Texture>, Nullable<Color>)
              
              
              
              
              
                public ObjectParameterKey<Texture> GetTextureKey(Texture texture, ObjectParameterKey<Texture> key, Color? defaultTextureValue = null)
               
              
              Parameters
              
              Returns
              
              
              
              
              
              
              GetTextureKey(ComputeTextureBase, MaterialComputeColorKeys)
              
              
              
              
              
                public ObjectParameterKey<Texture> GetTextureKey(ComputeTextureBase computeTexture, MaterialComputeColorKeys baseKeys)
               
              
              Parameters
              
              Returns
              
              
              
              
              
              
              PopOverrides()
              
              
              
              
              
                public void PopOverrides()
               
              
              
              
              
              
              
              PushOverrides(MaterialOverrides)
              
              
              
              
              
                public void PushOverrides(MaterialOverrides overrides)
               
              
              Parameters
              
              
              
              
              
              
              ResetParameterKeys()
              
              
              
              
              
                protected void ResetParameterKeys()
               
              
              
              
 
              
               
              
              
              
              
              
              
              Extension Methods