์ปจ๋ฒ๋ฃจ์ | wiki: Convolution | ํ์ฌ ํฝ์ ์ ์ค์ฌ์ผ๋ก ํด์ ๊ทธ ์ฃผ์์ ์๋ ํฝ์ ๋ง๋ค ๊ฐ์ค์น๋ฅผ ๊ณฑํ ๋ค, ๊ฒฐ๊ณผ๋ฅผ ๋ชจ๋ ๋ํ ๊ฐ์ผ๋ก ํ์ฌ ํฝ์ ์ ๊ฐ์ ๋ณ๊ฒฝํ๋ ์ฐ์ฐ |
์ปค๋ | kernel | ํ๋ ฌ ํ๋๋ก ์ ์ฅํ ๊ฐ์ค์น์ ์งํฉ |
์๋ฒจ ์ฐ์ฐ์์ ์ปค๋
์ข์ฐ ์ธ๊ณฝ์ ๊ฒ์ถ
| -1 0 +1 |
Kx = | -2 0 +2 |
| -1 0 +1 |
์ํ ์ธ๊ณฝ์ ๊ฒ์ถ
| +1 +2 +1 |
Ky = | 0 0 0 |
| -1 -2 -1 |
์ปจ๋ฒ๋ฃจ์
๊ฒฐ๊ณผ
L = sqrt(Lx * Lx + Ly * Ly)
shader
struct PS_INPUT
{
float2 mUV : TEXCOORD0;
};
sampler2D SceneSampler;
float2 gPixelOffset;
float3x3 Kx = { -1, 0, +1,
-2, 0, +2,
-1, 0, +1};
float3x3 Ky = { +1, +2, +1,
0, 0, 0,
-1, -2, -1};
float4 ps_main(PS_INPUT Input) : COLOR
{
float Lx = 0;
float Ly = 0;
for (int y = -1; y <= 1; ++y)
{
for (int x = -1; x <= 1; ++x)
{
float2 offset = float2(x, y) * gPixelOffset;
float3 tex = tex2D(SceneSampler, Input.mUV + offset).rgb;
float luminance = dot(tex, float3(0.3f, 0.59f, 0.11f));
Lx += luminance * Kx[y + 1][x + 1];
Ly += luminance * Ky[y + 1][x + 1];
}
}
float L = sqrt((Lx * Lx) + (Ly * Ly));
return float4(L.xxx, 1);
}
๋๊ฐ ์ฃ์ง ๊ฒ์ถ
| 0 +1 +2 |
K\ = | -1 0 +1 |
| -2 -1 0 |
| -2 -1 0 |
K/ = | -1 0 +1 |
| 0 +1 +2 |
- ์์๋ณด์
- HDR
- https://www.slideshare.net/cagetu/ndc11-hdr
- https://www.slideshare.net/agebreak/ndc12-hdr
- Tone Mapping
- HDR ๊ฒฐ๊ณผ๋ฅผ ๋์คํ๋ ์ด ์ถ๋ ฅ์ด ๊ฐ๋ฅํ ์ ํฉํ ํ๋ ๋ฒ์๋ก ๋ณํํด ์ฃผ๋ ์ฒ๋ฆฌ(HDR -> LDR)
- Bloom
- ๋ฐ๊ธฐ์ถ์ถ -> Gaussian Blur
- vignette
- Depth Of Field
- SSAO: Screen Space Ambient Occlusion
- motion blur: ์นด๋ฉ๋ผ๊ฐ ์์ง์ด๋ ์ ๋์ ๋ฐ๋ผ ์ ๋ฒ ํ๋ ์๊ณผ ํ์ฌ ํ๋ ์์ ๋ธ๋ ๋ฉ.
- gpg gems
- ShaderX / GPU Pro
- SIGGRAPH
- GDC(Game Developers Conference)
- Gamefest