# リソース バインディング
上級
プログラマー
[エフェクト](../effects-and-shaders/index.md)を使った[頂点の描画](draw-vertices.md)を行う場合、シェーダーは次のような特定のリソースが利用可能であることが期待されます。
- テクスチャーとバッファ
- サンプラー
- 定数バッファ
## 自動リソースバインディング
@'Stride.Rendering.EffectInstance' クラスは、読み込まれたエフェクトから列挙されるリソースの詳細を処理します。
また、エフェクトは @'Stride.Graphics.RootSignature' を公開しており、これを[パイプライン ステート](pipeline-state.md)として設定する必要があります。
そして、@'Stride.Rendering.ParameterCollection' に基づいて、定数バッファを満たし、リソースをバインドすることができます。
**コード:** EffectInstance を使用する
```cs
// EffectInstance を作成しパイプラインの設定に使う
// Create a EffectInstance and use it to set up the pipeline
var effectInstance = new EffectInstance(EffectSystem.LoadEffect("MyEffect").WaitForResult());
pipelineStateDescription.EffectBytecode = effectInstance.Effect.Bytecode;
pipelineStateDescription.RootSignature = effectInstance.RootSignature;
// 定数バッファを更新しリソースをバインドする
// Update constant buffers and bind resources
effectInstance.Apply(context.GraphicsContext);
```
## 手動リソースバインディング
さらに最適化されたコードが必要な場合(例:[レンダリング パイプライン](../rendering-pipeline/index.md))、定数バッファの更新とリソースバインディングを手動で行うことができます。