ViewSize
The ViewSize expression outputs a 2D vector giving the size of the current view in pixels. This is useful for causing various changes in your materials based on the current resolution of the screen.
픽셀의 현재 뷰의 크기를 나타내는 2D벡터를 출력.
ScreenPosition
The ScreenPosition expression outputs the screen-space position of the pixel currently being rendered.
현재 렌더링 된 픽셀의 스크린공간 위치
SceneTexelSize
The SceneTexelSize expression allows you to offset by texel sizes, as you would when using the SceneColor and SceneDepth expressions. This is useful for edge detection in multi-resolution systems, as without this calculation you would be forced to use a small static value, resulting in inconsistent results at lower resolutions.
ViewSize
The ViewSize expression outputs a 2D vector giving the size of the current view in pixels. This is useful for causing various changes in your materials based on the current resolution of the screen.
픽셀의 현재 뷰의 크기를 나타내는 2D벡터를 출력.
ScreenPosition
The ScreenPosition expression outputs the screen-space position of the pixel currently being rendered.
현재 렌더링 된 픽셀의 스크린공간 위치
SceneTexelSize
The SceneTexelSize expression allows you to offset by texel sizes, as you would when using the SceneColor and SceneDepth expressions. This is useful for edge detection in multi-resolution systems, as without this calculation you would be forced to use a small static value, resulting in inconsistent results at lower resolutions.
커스텀 노드에 SceneTextureLookup함수를 쓸경우 해당 노드가 머트리얼에 연결도어 있어야야 한다. 그렇지 않으면 SceneTextureLookup 함수 인지를 못함
Radial Blur 코드
"버퍼사이즈 대비 뷰사이즈비율" 1:x= buffer:view
const float2 ScreenMult = View.ViewSizeAndInvSize.xy * View.BufferSizeAndInvSize.zw;
const int TexIndex = 14;"내부코드에서 14번은 PostprocessInput 0을 가리킴"
const float Samples[11] = {-0.08,-0.05,-0.03,-0.02,-0.01,0,0.01,0.02,0.03,0.05,0.08};
float2 dir = ViewUV-float2(0.5, 0.5) ;"(0.5,0.5) 중심으로 하는 UV좌표"
float4 sum = float4(0.0, 0.0, 0.0, 0.0);
for(int i = 0; i<11; i++)
{
"UV"
"(0.5,0.5)중심의 UV를 샘플링값에 따라 스케일(확대/축소)하고 그 값을 화면UV에 +한다"
float2 offest = ViewUV - dir * Samples[i] * BlurDist;
"UV를 다시 0,1로"
offest = clamp(offest, float2(0.0,0.0), float2(1.0, 1.0));
"SceneTexture Case : 14 = PostProcessInput0--화면 그대로 보여주는"
sum += SceneTextureLookup(pos * ScreenMult, TexIndex, false);
}
return sum / 11.0;"더해진 값을 그대로 나눠줌"
Custom Node의 SceneTextureLookup함수
를 사용하고자 할 경우 int SceneTextureIndex에 case 0 ~28까지 중에서 선택해야한다.
- PostProcessInput 0 = case 14
- SceneTextureLookup(float2 uv, int SceneTextureIndex, Bool bFiltered)
offest= clamp(pos, float2(0.0,0.0), float2(1.0, 1.0)); viewuv를 다시 0,1 사이로
offest가 ViewUV보다 작아질경우 clamp하면 원본에서 줄어든 부분만큼 마지막 픽셀로 쭉 이어져서 공백이 없음(검은 계단이미지)
Normalize(ScreenUV-float2(0.5, 0.5))
|
ScreenUV-float2(0.5, 0.5)
|
'Material, BluePrint > Material' 카테고리의 다른 글
customdepth (0) | 2020.07.17 |
---|---|
CustomDepth로 가려진 물체 표현 (0) | 2020.07.15 |
Pivot Painter 2.0를 이용해 작업중~ (0) | 2020.05.26 |
UE4 - ICE / Mineral (0) | 2020.05.07 |
UE4-Hair (0) | 2020.05.07 |