유니티 버텍스 옵셋 효과 예제 Juane Gray



유니티 버텍스 옵셋 효과 예제 Juane Gray

금별 0 4,029 2019.08.20 23:22

 

So, here I am again my goal is to make guts fall from a zombie character I have laying around, and with it comes some squash and stretch guts and organs that fall out of it.

How am I going to do it? I have no clue. I guess you and me will find out!

Update -1

 

 

So to start off I watched a bunch of videos, messed around with a lot of shader things (rotate about axis) (could not get it to work) so I tried another method. this time I started from scratch.

So I came up with the idea to pass the collision point of the object into a space local to the object.

 

 

Something like this or similar, and I wanted to get the result of this

 

 

Which I somehow of a miracle made happen:

 

 

and with that comes the shader: although I could not get rotation to work it’s definitely a step in the right direction!

 

 

So today I managed to get rotation working, by simply changing two inputs and converting to world/object space! I am so blind!

 

 

Here is what the shader looks like now:

 

 

 

Code related:

private void Start()
{
    rend = GetComponent<Renderer>();
    RB = GetComponent<Rigidbody>();
}

private void Update()
{
    rend.material.SetVector("_ContactPos", toPoint);
    if (!colliding && collisionPoint != Vector3.zero)
    {
        spring2 = 0f;
        spring += Time.deltaTime;
        toPoint = Vector3.Lerp(collisionPoint, Vector3.zero, spring);
    }

    if (colliding)
    {
        spring2 += Time.deltaTime;
        toPoint = Vector3.Lerp(toPoint, collisionPoint, spring2);
        if (toPoint == collisionPoint) { spring2 = 0f; }
    }
}


public void OnCollisionStay(Collision collision)
{
    colliding = true;
    ContactPoint contact = collision.GetContact(0);
    point.position = contact.point;
    collisionPoint = -point.gameObject.transform.localPosition;
    Vector3 dir = transform.position - collisionPoint;
    directionPoint = dir.magnitude;
}

public void OnCollisionExit(Collision collision)
{
    spring = 0;
    colliding = false;
}
}

Comments


번호 포토 분류 제목 글쓴이 날짜 조회
1281 언리얼4 Heat Distortion VFX for Fire in UE5 Niagara! (Photoshop & Normal Map Workflow) ????????✨ ashif 12.16 70
1280 2D 섭스턴스 디자인 - 색수차(Chromatic Aberration) 매직 오라 텍스처 만들기(한글자막) 금별 12.16 74
1279 언리얼4 언리얼 - 미호요 신작 스타일 Depth Fade와 UV 조작을 이용한 공간 포털 연출(한글자막) 금별 12.16 97
1278 언리얼4 언리얼5 - Polar Coordinates를 활용한 태극 무늬 제작 금별 12.16 55
1277 언리얼4 언리얼 - AAA 게임 개발에서의 나이아가라 모듈(Niagara Module) 연구 및 적용 금별 12.16 64
1276 유니티 유니티 - 유니티 스플라인 카메라 무브먼트 예제(워프 효과 연출) 금별 12.16 49
1275 언리얼4 언리얼 - 간단한 스타일라이즈드 불효과 제작과정팁 금별 12.16 59
1274 언리얼4 Simple Stylized Tornado VFX in UE5 Niagara! (Torus Mesh, Erode & Dynamic Params) ????️????✨ ashif 12.15 54
1273 2D 섭스턴스 디자인 - 움푹 파인 바닥 절차적 제작과정(한글자막) 금별 12.10 100
1272 언리얼4 언리얼 - Stylized 파도/물보라 제작과정 part3(한글자막) 금별 12.10 106
1271 언리얼4 언리얼 - Stylized 파도/물보라 제작과정 part2(한글자막) 금별 12.10 75
1270 언리얼4 언리얼 - Stylized 파도/물보라 제작과정 part1(한글자막) 금별 12.10 79
1269 언리얼4 언리얼 - 나이아가라 나선형 파티클 구현 과정 금별 12.04 139
1268 언리얼4 Create a Bubble Shield VFX in UE5 Niagara! (Character Defense & Multi-Layer Bubbles) ????️ ashif 12.02 147
1267 언리얼4 언리얼 - 흡입형 화면이 빨려들어가는 느낌 스크린 이펙트 제작과정(한글자막) 금별 12.02 191
1266 언리얼4 언리얼 - 물결무늬 에너지 실드 소재 제작과정(한글자막) 금별 12.02 160
1265 2D 포토샵 - 빛 효과 텍스쳐 간단 제작방법팁 금별 12.02 149
1264 3D 후디니 - COP 활용한 검기 텍스쳐 생성 과정(한글자막) 금별 11.24 220
1263 유니티 유니티 - ASE 활용 포털 조각 분리 및 트위스트 애니메이션 제작과정(한글자막) 금별 11.24 223
1262 언리얼4 언리얼 - 나이아가라 파티클 위치 및 곡선(Arc) 제어과정 금별 11.24 235
1261 언리얼4 언리얼5 - 나이아가라 객체 회전 예제 금별 11.24 216
1260 유니티 유니티 - (퀵팁) 간단한 파티클 orbit 움직임제어팁 금별 11.20 220

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand