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



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

금별 0 3,516 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


번호 포토 분류 제목 글쓴이 날짜 조회
444 언리얼4 언리얼 - 노이즈에 그라데이션 반영 금별 2023.03.30 2543
443 언리얼4 언리얼 - UV 부풀어 보이게 하는 팁 금별 2023.03.30 2382
442 언리얼4 언리얼 - Polar UV에 대한 간단팁 금별 2023.03.30 2644
441 언리얼4 언리얼4 - 머트리얼로 버블 느낌 구현 금별 2023.03.26 2750
440 유니티 유니티 - 레이저 채찍으로 용소환 바닥 크랙생성 제작튜토리얼 금별 2023.03.26 2875
439 유니티 유니티 앰플리파이 쉐이더 - 모델의 조각/분해/축중심회전 금별 2023.03.26 2187
438 3D 후디니- 그리드를 활용한 충격파 그라운드스파이크 간단제작과정 금별 2023.03.26 2426
437 언리얼4 언리얼 - FFT Ocean Flipbook : Blender 및 UE를 사용하여 생성 및 샘플링하는 방법 금별 2023.03.20 2182
436 언리얼4 언리얼 - 무지갯빛 버블 쉐이더 제작과정 금별 2023.03.17 2477
435 유니티 유니티 - 레거시 쉐이더를 쉐이더 그래프에서 커스텀 함수로 포팅 제작과정 금별 2023.03.15 2382
434 언리얼4 언리얼 5.1 - Creating cinematic VFX from scratch 금별 2023.03.14 2269
433 유니티 유니티 - 간단한 시퀀스 보간 블랜드 제작과정 금별 2023.03.09 2346
432 언리얼4 언리얼 - 회전하는 2D 소용돌이 쉐이더 제작노드 금별 2023.03.08 3065
431 언리얼4 언리얼 - Cairo Tiling 제작노드 및 설명영상 금별 2023.03.08 2263
430 언리얼4 언리얼 - 머터리얼 에디터 4가지 활용 팁 금별 2023.03.08 1972
429 유니티 유니티 - 크리처 소환 이펙트 제작과정 금별 2023.03.08 3768
428 유니티 유니티 - AI 활용한 쉐이더 제작 금별 2023.03.07 3586
427 2D 스테이블 디퓨전을 활용한 AI 시퀀스 텍스쳐 제작방법 금별 2023.03.07 4997
426 언리얼4 언리얼 - 메쉬에 아웃라인 머트리얼 간단 제작방법 금별 2023.03.04 2701
425 유니티 쿠파 유니티이펙트 취업 클래스 실제강의 파도,워터 쇼크웨이브 간단 제작과정 금별 2023.03.04 3240
424 언리얼4 언리얼5 - 스파크 라이트닝 제작과정 금별 2023.03.01 2194
423 언리얼4 언리얼 - 외곽이 꿀렁되는 UMG 머트리얼 금별 2023.02.28 2765

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand