Class ShaderGeneratorContext
Base class for generating shader class source with associated parameters.
public class ShaderGeneratorContext : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
- Inheritance
-
ShaderGeneratorContext
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
ShaderGeneratorContext(GraphicsDevice)
public ShaderGeneratorContext(GraphicsDevice graphicsDevice = null)
Parameters
graphicsDevice
GraphicsDevice
Properties
ColorSpace
public ColorSpace ColorSpace { get; set; }
Property Value
Content
Gets or sets the asset manager.
public ContentManager Content { get; set; }
Property Value
- ContentManager
The asset manager.
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
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
- bool
true
if [materials are optimized]; otherwise,false
.
Parameters
public ParameterCollection Parameters { get; set; }
Property Value
Methods
GenerateTextureFromColor(Color)
public Texture GenerateTextureFromColor(Color color)
Parameters
color
Color
Returns
GetParameterKey(ParameterKey)
public ParameterKey GetParameterKey(ParameterKey key)
Parameters
key
ParameterKey
Returns
GetSamplerKey(SamplerStateDescription, GraphicsDevice)
public ObjectParameterKey<SamplerState> GetSamplerKey(SamplerStateDescription samplerStateDesc, GraphicsDevice graphicsDevice)
Parameters
samplerStateDesc
SamplerStateDescriptiongraphicsDevice
GraphicsDevice
Returns
GetSamplerKey(ComputeColorParameterSampler)
public ObjectParameterKey<SamplerState> GetSamplerKey(ComputeColorParameterSampler sampler)
Parameters
sampler
ComputeColorParameterSampler
Returns
GetTextureKey(Texture, ObjectParameterKey<Texture>, Color?)
public ObjectParameterKey<Texture> GetTextureKey(Texture texture, ObjectParameterKey<Texture> key, Color? defaultTextureValue = null)
Parameters
texture
Texturekey
ObjectParameterKey<Texture>defaultTextureValue
Color?
Returns
GetTextureKey(ComputeTextureBase, MaterialComputeColorKeys)
public ObjectParameterKey<Texture> GetTextureKey(ComputeTextureBase computeTexture, MaterialComputeColorKeys baseKeys)
Parameters
computeTexture
ComputeTextureBasebaseKeys
MaterialComputeColorKeys
Returns
PopOverrides()
public void PopOverrides()
PushOverrides(MaterialOverrides)
public void PushOverrides(MaterialOverrides overrides)
Parameters
overrides
MaterialOverrides
ResetParameterKeys()
protected void ResetParameterKeys()