# CustomPixelShader
*in [Lib.image.use](README.md)*
Creates a custom shader from a source parameter. This can be useful for prototyping.
Use "Ignore Template" to bring in your entire shader.
## Input Parameters
| Name (Relevancy & Type) | Description |
|---|---|
| **ImageA** (Texture2D) | — |
| **ImageB** (Texture2D) | — |
| **Offset** (Vector2) | — |
| **A** (Single) | — |
| **B** (Single) | — |
| **C** (Single) | — |
| **D** (Single) | — |
| **GainAndBias** (Vector2) | — |
| **Gradient** (Gradient) | — |
| **ShaderCode** (String) | — |
| **AdditionalCode** (String) | — |
| **TemplateFile** (String) | — |
| **Resolution** (Int2) | — |
| **TextureFormat** (Format) | — |
| **GenerateMips** (Boolean) | — |
| **Clear** (Boolean) | Clearing RenderTarget
setting it to false also enables blending mode, so that result is blended on top of backbuffer |
| **ShaderResources** (ShaderResourceView) | Use SrvFromTexutre2d for additional texture inputs. They will need to be defined in AdditionalCode, for example:
Texture2D Image3 : register(t2); |
| **ConstantBuffers** (Buffer) | Use FloatsToBuffer or Ints to buffer to pass additional input params, define in AdditionalCode for example:
cbuffer AdditionalIntParams : register(b2)
{
int Index;
}
cbuffer AdditionalFloatParams : register(b3)
{
float4 Color;
} |
| **CustomSampler** (SamplerState) | Use SamplerState node to add custom sampler(s); first sampler input is defined in template as CustomSampler.
samplers coming after that will need to be defined in AdditionalCode, for example:
sampler Sampler2 : register(s2); |
## Outputs
| Name | Type |
|---|---|
| **TextureOutput** | T3.Core.DataTypes.Texture2D |
| **ShaderCode_** | System.String |