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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
456 2D 포토샵 - 간단한 4장 시퀀스 번개 제작방법2 금별 2023.04.08 4271
455 2D 포토샵 - 간단한 4장 시퀀스 번개 제작방법 금별 2023.04.08 3610
454 2D 포토샵 - 간단 작은 파티클 잎 텍스처 제작 금별 2023.04.08 2364
453 2D 포토샵 - 간단 작은 돌 질감 텍스쳐 제작방법 금별 2023.04.08 2454
452 2D 포토샵 - 간단 노이즈 텍스쳐 제작방법(심리스) 금별 2023.04.08 3583
451 2D 포토샵 - 연속되는 테일 텍스쳐 제작방법 금별 2023.04.08 2576
450 2D 포토샵 - 간단 플레어 텍스쳐 제작방법 금별 2023.04.08 3425
449 2D 포토샵 - 간단 검광 텍스쳐 제작방법 금별 2023.04.08 2684
448 유니티 유니티 앰플리파이 쉐이더 - 흑백으로 집중되는 펜스타일 포스트프로세스 간단 제작과정 금별 2023.04.04 3875
447 언리얼4 언리얼5.1 - 클라드니 패턴(반지의 제왕 인트로) 이펙트 금별 2023.04.02 2060
446 언리얼4 언리얼 - 리본을 활용한 크리스탈 외곽효과 제작방법 금별 2023.04.01 2223
445 언리얼4 언리얼5 - 메시를 다른 메시로 디졸브하는 방법 금별 2023.03.31 2572
444 언리얼4 언리얼 - 노이즈에 그라데이션 반영 금별 2023.03.30 2865
443 언리얼4 언리얼 - UV 부풀어 보이게 하는 팁 금별 2023.03.30 2804
442 언리얼4 언리얼 - Polar UV에 대한 간단팁 금별 2023.03.30 3082
441 언리얼4 언리얼4 - 머트리얼로 버블 느낌 구현 금별 2023.03.26 3209
440 유니티 유니티 - 레이저 채찍으로 용소환 바닥 크랙생성 제작튜토리얼 금별 2023.03.26 3470
439 유니티 유니티 앰플리파이 쉐이더 - 모델의 조각/분해/축중심회전 금별 2023.03.26 2546
438 3D 후디니- 그리드를 활용한 충격파 그라운드스파이크 간단제작과정 금별 2023.03.26 2852
437 언리얼4 언리얼 - FFT Ocean Flipbook : Blender 및 UE를 사용하여 생성 및 샘플링하는 방법 금별 2023.03.20 2578
436 언리얼4 언리얼 - 무지갯빛 버블 쉐이더 제작과정 금별 2023.03.17 2860
435 유니티 유니티 - 레거시 쉐이더를 쉐이더 그래프에서 커스텀 함수로 포팅 제작과정 금별 2023.03.15 2822

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand