파라미터 Tex : Texture2D UV : float2 float4 luminance = float4(0.30, 0.59, 0.11, 1); float2 dim; Tex.GetDimensions(dim.x, dim.y); float texH = dim.y; float texW = dim.x; // TOP ROW float s11 = dot(Texture2DSample(Tex, TexSampler, UV + float2(-1.0f / texW, -1.0f / texH)), luminance); float s12 = dot(Texture2DSample(Tex, TexSampler, UV + float2(0, -1.0f / texH)), luminance); float s13 = dot(Texture2DS..
[HLSL] Edge Detection - Sobel
파라미터 Tex : Texture2D UV : float2 float4 luminance = float4(0.30, 0.59, 0.11, 1); float2 dim; Tex.GetDimensions(dim.x, dim.y); float texH = dim.y; float texW = dim.x; // TOP ROW float s11 = dot(Texture2DSample(Tex, TexSampler, UV + float2(-1.0f / texW, -1.0f / texH)), luminance); float s12 = dot(Texture2DSample(Tex, TexSampler, UV + float2(0, -1.0f / texH)), luminance); float s13 = dot(Texture2DS..
2021.09.16