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



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

금별 0 4,653 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


번호 포토 분류 제목 글쓴이 날짜 조회
437 언리얼4 언리얼 - FFT Ocean Flipbook : Blender 및 UE를 사용하여 생성 및 샘플링하는 방법 금별 2023.03.20 3016
436 언리얼4 언리얼 - 무지갯빛 버블 쉐이더 제작과정 금별 2023.03.17 3420
435 유니티 유니티 - 레거시 쉐이더를 쉐이더 그래프에서 커스텀 함수로 포팅 제작과정 금별 2023.03.15 3279
434 언리얼4 언리얼 5.1 - Creating cinematic VFX from scratch 금별 2023.03.14 3192
433 유니티 유니티 - 간단한 시퀀스 보간 블랜드 제작과정 금별 2023.03.09 3215
432 언리얼4 언리얼 - 회전하는 2D 소용돌이 쉐이더 제작노드 금별 2023.03.08 3950
431 언리얼4 언리얼 - Cairo Tiling 제작노드 및 설명영상 금별 2023.03.08 3089
430 언리얼4 언리얼 - 머터리얼 에디터 4가지 활용 팁 금별 2023.03.08 2775
429 유니티 유니티 - 크리처 소환 이펙트 제작과정 금별 2023.03.08 5047
428 유니티 유니티 - AI 활용한 쉐이더 제작 금별 2023.03.07 5060
427 2D 스테이블 디퓨전을 활용한 AI 시퀀스 텍스쳐 제작방법 금별 2023.03.07 6619
426 언리얼4 언리얼 - 메쉬에 아웃라인 머트리얼 간단 제작방법 금별 2023.03.04 3873
425 유니티 쿠파 유니티이펙트 취업 클래스 실제강의 파도,워터 쇼크웨이브 간단 제작과정 금별 2023.03.04 4547
424 언리얼4 언리얼5 - 스파크 라이트닝 제작과정 금별 2023.03.01 2988
423 언리얼4 언리얼 - 외곽이 꿀렁되는 UMG 머트리얼 금별 2023.02.28 3836
422 유니티 유니티 - 캐릭 도트화 ScreenPosition 적용 제작과정예제 금별 2023.02.20 3313
421 유니티 유니티 - 쿠파 취업 클래스 실제강의 파도,워터 쇼크웨이브 압축 제작과정 금별 2023.02.20 3696
420 언리얼4 언리얼 - UV 축을 보여주는 머티리얼 함수 금별 2023.02.19 4403
419 언리얼4 언리얼 - 디지털 트랜지션 효과 제작방법 금별 2023.02.17 3345
418 언리얼4 언리얼 - Procedural Hex Tiling Material 금별 2023.02.17 2890
417 언리얼4 언리얼5 - 원신느낌의 Wenti's 원소폭파 제작과정 금별 2023.02.13 3629
416 3D 마야 - 윈드 메쉬 제작방법 금별 2023.02.13 3263

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand