Table of Contents

Class ShaderGeneratorContext

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
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

ColorSpace

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

MaterialOverrides

FindAsset

public ShaderGeneratorContext.FindAssetDelegate FindAsset { get; set; }

Property Value

ShaderGeneratorContext.FindAssetDelegate

GetAssetFriendlyName

public ShaderGeneratorContext.GetAssetFriendlyNameDelegate GetAssetFriendlyName { get; set; }

Property Value

ShaderGeneratorContext.GetAssetFriendlyNameDelegate

IsNotPixelStage

public bool IsNotPixelStage { get; set; }

Property Value

bool

Log

public LoggerResult Log { get; set; }

Property Value

LoggerResult

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

ParameterCollection

Methods

GenerateTextureFromColor(Color)

public Texture GenerateTextureFromColor(Color color)

Parameters

color Color

Returns

Texture

GetParameterKey(ParameterKey)

public ParameterKey GetParameterKey(ParameterKey key)

Parameters

key ParameterKey

Returns

ParameterKey

GetSamplerKey(SamplerStateDescription, GraphicsDevice)

public ObjectParameterKey<SamplerState> GetSamplerKey(SamplerStateDescription samplerStateDesc, GraphicsDevice graphicsDevice)

Parameters

samplerStateDesc SamplerStateDescription
graphicsDevice GraphicsDevice

Returns

ObjectParameterKey<SamplerState>

GetSamplerKey(ComputeColorParameterSampler)

public ObjectParameterKey<SamplerState> GetSamplerKey(ComputeColorParameterSampler sampler)

Parameters

sampler ComputeColorParameterSampler

Returns

ObjectParameterKey<SamplerState>

GetTextureKey(Texture, ObjectParameterKey<Texture>, Color?)

public ObjectParameterKey<Texture> GetTextureKey(Texture texture, ObjectParameterKey<Texture> key, Color? defaultTextureValue = null)

Parameters

texture Texture
key ObjectParameterKey<Texture>
defaultTextureValue Color?

Returns

ObjectParameterKey<Texture>

GetTextureKey(ComputeTextureBase, MaterialComputeColorKeys)

public ObjectParameterKey<Texture> GetTextureKey(ComputeTextureBase computeTexture, MaterialComputeColorKeys baseKeys)

Parameters

computeTexture ComputeTextureBase
baseKeys MaterialComputeColorKeys

Returns

ObjectParameterKey<Texture>

PopOverrides()

public void PopOverrides()

PushOverrides(MaterialOverrides)

public void PushOverrides(MaterialOverrides overrides)

Parameters

overrides MaterialOverrides

ResetParameterKeys()

protected void ResetParameterKeys()