generator-rgb-to-svideo-or-composite
This shader takes an RGB image and turns it into either an S-Video or Composite signal (Based on whether
g_compositeBlend is 0 or 1). We might also be generating a PAIR of these,
using two different sets of phase inputs (if
g_scanlinePhases is a two-component input), for purposes of
temporal aliasing reduction.
See Generating a Fake NTSC Signal for more information.
Index
Input Textures/Samplers
Uniform Buffer Values
Input Textures/Samplers
- g_sourceTexture
-
g_sourceTextureType
texture(platform-specific)Description
The RGB input texture. It is expected to be g_inputWidthbyg_scanlineCountin size. - g_sourceSampler
-
g_samplerType
sampler(platform-specific, does not exist on some platforms)Description
The sampler to use to sample g_sourceTexture.
This sampler should be set up with linear filtering, and either clamp or border addressing.
- g_scanlinePhases
-
g_scanlinePhasesType
texture(platform-specific)Description
This is the scanline phases texture (the output of gen-phase). It is g_scanlineCount x 1in size, and each texel component in it represents the phase offset of the NTSC colorburst for the corresponding scanline, in multiples of the colorburst wavelength. - g_scanlinePhasesSampler
-
g_scanlinePhasesSamplerType
sampler(platform-specific, does not exist on some platforms)Description
The sampler to use to sample g_scanlinePhases.
This sampler should be set up with linear filtering, and either clamp or border addressing.
Uniform Buffer Values
- g_outputTexelsPerColorburstCycle
-
uint g_outputTexelsPerColorburstCycleType
uintDescription
The number of texels that the output texture will contain for each color cycle wave (i.e. the wavelength in output samples of the color carrier wave). - g_inputWidth
-
uint g_inputWidthType
uintDescription
The width of the input texture. - g_outputWidth
-
uint g_outputWidthType
uintDescription
The width of the output render target. - g_scanlineCount
-
uint g_scanlineCountType
uintDescription
The number of scanlines in the current field of video (the height of the input texture). - g_compositeBlend
-
float g_compositeBlendType
floatDescription
Whether we're blending the generated luma/chroma into a single output channel or not. It is expected to be 0or1(no intermediate values), where "0" means "keep luma and chroma separate, like an S-Video signal" and "1" means "add the two together, like a composite signal". - g_instabilityScale
-
float g_instabilityScaleType
floatDescription
The scale of any picture instability (horizontal scanline-by-scanline tracking issues). This is used to offset our texture sampling when generating the output so the picture tracking is imperfect. Must match the similarly-named value in gen-phase. - g_noiseSeed
-
uint g_noiseSeedType
uintDescription
A seed for the noise used to generate the scanline-by-scanline picture instability. Must match the simiarly-named value in gen-phase. - g_sidePaddingTexelCount
-
uint g_sidePaddingTexelCountType
uintDescription
The number of output texels to pad on either side of the signal texture (so that filtering won't have visible artifacts on the left and right sides).