・元映像と設定が変わらないフレームの描画を高速化-M ・利得が100%を超え適用量が100%未満のとき、元映像と混ぜる前に明るさを打ち切るよう変更-M ・長辺が8160画素を超える素材には効果を適用しないよう変更-M ・Direct3D 12や共有テクスチャを使えない環境では効果を適用せず入力映像を表示するよう変更-M
29 行
821 B
HLSL
29 行
821 B
HLSL
Texture2D SourceTexture : register(t0);
|
|
SamplerState SourceSampler : register(s0);
|
|
Texture2D ConvolvedTexture : register(t1);
|
|
SamplerState ConvolvedSampler : register(s1);
|
|
|
|
cbuffer Constants : register(b0)
|
|
{
|
|
float amount : packoffset(c0.x);
|
|
float pad0 : packoffset(c0.y);
|
|
float pad1 : packoffset(c0.z);
|
|
float pad2 : packoffset(c0.w);
|
|
};
|
|
|
|
float4 main(
|
|
float4 position : SV_POSITION,
|
|
float4 scenePosition : SCENE_POSITION,
|
|
float4 uv0 : TEXCOORD0,
|
|
float4 uv1 : TEXCOORD1
|
|
) : SV_TARGET
|
|
{
|
|
float4 source = SourceTexture.SampleLevel(SourceSampler, uv0.xy, 0);
|
|
if (amount <= 0.0)
|
|
return source;
|
|
|
|
float4 convolved = ConvolvedTexture.SampleLevel(ConvolvedSampler, uv1.xy, 0);
|
|
convolved.rgb = min(convolved.rgb, convolved.a.xxx);
|
|
return lerp(source, convolved, amount);
|
|
}
|