'Material, BluePrint > Material' 카테고리의 다른 글
customdepth를 활용한 사람형태 (0) | 2020.11.06 |
---|---|
customdepth (0) | 2020.07.17 |
CustomDepth로 가려진 물체 표현 (0) | 2020.07.15 |
PostProcess - Radial Blur (0) | 2020.07.15 |
Pivot Painter 2.0를 이용해 작업중~ (0) | 2020.05.26 |
customdepth를 활용한 사람형태 (0) | 2020.11.06 |
---|---|
customdepth (0) | 2020.07.17 |
CustomDepth로 가려진 물체 표현 (0) | 2020.07.15 |
PostProcess - Radial Blur (0) | 2020.07.15 |
Pivot Painter 2.0를 이용해 작업중~ (0) | 2020.05.26 |
매 프레임 키가 있는 애니메이션을 가지고 왔는데 언리얼에서 플레이시 튕김 현상이 발생한다.
아래 Interpolation 옵션을 Step로 바꾸면 제대로 나오는 것을 확인 할 수 있다.
Set Actor Rotation 값이 영향이 없을때 (0) | 2022.06.18 |
---|---|
최적화 관련 항목 (0) | 2020.07.15 |
Customized UV
SkyLight
Fully Rough
Quality Switch
Feature Level Switch
SkeletalMesh
StaticMesh
Lod세팅에 Lod 거리 자동계산을 해제하면
각 Lod별로 화면 크기를 설정할 수 있다.
Set Actor Rotation 값이 영향이 없을때 (0) | 2022.06.18 |
---|---|
본 애니메이션 튀는 현상 (2) | 2020.07.29 |
SceneDepth
깊이 버퍼에 저장된 값은 삼각형의 정점 3개가 세계 뷰-정점 행렬에 의해 변환된 후 삼각형의 보간 w 좌표로 나눈 삼각형의 보간 z 좌표다. 깊이 버퍼를 텍스처로 사용하여, 그 픽셀의 뷰포트 위치를 현재 뷰-투영 매트릭스의 역순으로 변환한 다음 그 결과를 w 성분으로 곱하여 깊이 버퍼에 렌더링된 객체의 월드 스페이스 위치를 추출할 수 있다.
뷰포트 공간의 픽셀 위치로 뷰포트 위치를 정의한다. 즉, x 및 y components가 화면 중앙이 (0, 0)이고 -1~1의 범위에 있다.해당 픽셀의 깊이 버퍼에 저장된 깊이가 z component가 되고 w component는 1로 설정된다.
SceneDepth
깊이 버퍼에 저장된 값은 삼각형의 정점 3개가 세계 뷰-정점 행렬에 의해 변환된 후 삼각형의 보간 w 좌표로 나눈 삼각형의 보간 z 좌표다. 깊이 버퍼를 텍스처로 사용하여, 그 픽셀의 뷰포트 위치를 현재 뷰-투영 매트릭스의 역순으로 변환한 다음 그 결과를 w 성분으로 곱하여 깊이 버퍼에 렌더링된 객체의 월드 스페이스 위치를 추출할 수 있다.
뷰포트 공간의 픽셀 위치로 뷰포트 위치를 정의한다. 즉, x 및 y components가 화면 중앙이 (0, 0)이고 -1~1의 범위에 있다.해당 픽셀의 깊이 버퍼에 저장된 깊이가 z component가 되고 w component는 1로 설정된다.
//Get the depth buffer value at this pixel.
float zOverW = tex2D(depthTexture, texCoord);
// H is the viewport position at this pixel in the range -1 to 1.
float4 H = float4(texCoord.x * 2 - 1, (1 - texCoord.y) * 2 - 1, zOverW, 1);
// Transform by the view-projection inverse.
float4 D = mul(H, g_ViewProjectionInverseMatrix);
// Divide by w to get the world position.
float4 worldPos = D / D.w;
![]() 카메라 걸리는 구간에 PostProcess Volume - PP 쉐이더 |
![]() 오브젝트 뒤에 있는 오브젝트가 앞에 보이게 |
IF 노드 사용시
![]() 아래 시각화이미지를 통해 B의 CustomDepth적용된 오브젝트외의 값은(흰바탕) 10000이상이다는 결론 -> 검증 -> |
![]() 테스트로 A값 10000과 Clamp를 건 CustomDepth*0.0002의 값을 비교하는데 Clamp의 Max값이 10000미만일떄는 주황, 같을때는 블루, 초과일떄는 SceneTexture임을 확인 |
![]()
|
![]()
B의 시각화 |
![]()
|
![]()
|
![]()
|
IF 노드 없이
![]() A |
![]()
|
![]() B |
![]()
|
![]() C |
![]()
|
D=clamp(1-(A*B), 0, 1) | ![]() |
E=A*C | ![]() |
F=clamp(D*E, 0,1) | ![]() |
![]() F를 알파값으로 |
![]() |
이 방법으론 카메라가 항상 오브젝트에서 일정한 거리에 있으면 써도 문제가 없을거 같다.
지구 (0) | 2020.11.03 |
---|---|
customdepth (0) | 2020.07.17 |
PostProcess - Radial Blur (0) | 2020.07.15 |
Pivot Painter 2.0를 이용해 작업중~ (0) | 2020.05.26 |
UE4 - ICE / Mineral (0) | 2020.05.07 |
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까지 중에서 선택해야한다.
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) ![]()
|
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 |
global selectObject = $selection
global vColor
rollout Pos2VertexColor "Pos2VertexColor" width:380 height:330
(
button Pos2VertexColor_Btn "Pos2VertexColor" width:123 height:34
--button PivotCheck_Btn "PivotCheck" width:123 height:34
button UnitSetup_Btn "UnitSetup" width:123 height:34
button VertexColor_Check_Btn "VertexColorCheck" width:123 height:34
fn Pos2VertexColor =
(
if selectObject != undefined then
(
for m =1 to selectObject.count do
(
a = selectObject[m]
setCommandPanelTaskMode #modify
subObjectLevel =1
-- avoid minus value
MeshPivot = (a.pivot+50)*0.1
for i=1 to a.verts.count do
(
a.EditablePoly.Setselection #Vertex #{i}
a.setVertexColor (color MeshPivot[1] MeshPivot[2] MeshPivot[3] ) #vertexcolor
vColor = a.getVertexColor #vertexcolor
)
print vColor
)
)
if $ == undefined then
(
messagebox "please select Object"
)
)
fn get2VertexColor =
(
if selectObject != undefined then
(
a = selectObject
getVertColor a 1
)
)
fn timeCheck =
(
t=timeStamp()
format "%ms\n" (timeStamp()-t)
)
on Pos2VertexColor_Btn pressed do
(
Pos2VertexColor()
timeCheck()
)
on VertexColor_Check_Btn pressed do
(
get2VertexColor()
timeCheck()
)
)
createdialog Pos2VertexColor
FBX EXPORTER & Anim for Unity (0) | 2020.05.07 |
---|---|
pos2zero (0) | 2019.10.11 |
Random_Scatter_Surface (0) | 2019.10.11 |
TRI,VERTEX Viewport Count (0) | 2019.10.11 |
스크립트로 텍스쳐 렌더링을 하고 난후 보면 UV채널2에 각 메쉬마다의 위치값이 위치에 있다. 이 값을 텍스쳐로 사용.
![]() |
![]() |
하지만 위의 왼쪽과 같이 피봇포인트 X축이 풀잎의 끝 위치로 향하고 있지 않으면 수작업으로 오른쪽과 같이 피봇의 위치를 맞춰준다.
처음에 왼쪽 이미지로 설정을 했을때는 뿌리가 고정되지 않고 흔들린 반면, 오른쪽으로 수정후 뿌리의 흔들림 없이 정상적인 애니메이션이 가능하다.
단점 UV채널 하다 더 씀
장점 스켈레탈 애님보다 비용싸다.
![]() |
![]() |
![]() |
![]() |
CustomDepth로 가려진 물체 표현 (0) | 2020.07.15 |
---|---|
PostProcess - Radial Blur (0) | 2020.07.15 |
UE4 - ICE / Mineral (0) | 2020.05.07 |
UE4-Hair (0) | 2020.05.07 |
UE4-Rug (0) | 2020.05.07 |