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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
511 언리얼4 언리얼 - 구형 UV 활용 방법 금별 2023.06.17 2834
510 유니티 유니티 URP - 간단 바닥 화염 크랙 제작과정 금별 2023.06.12 2990
509 2D 섭스턴스 디자인 - 프로시졀 플레어 텍스쳐 제작과정 금별 2023.06.11 2195
508 언리얼4 언리얼5.2 - 체크무늬 바닥재질 만들기 금별 2023.06.09 2569
507 언리얼4 후디니/언리얼 - UI 플루이드 원형체력게이지 제작과정 금별 2023.06.08 2396
506 언리얼4 언리얼5 - 간단 메쉬표면 전기발생효과 제작방법 금별 2023.06.01 2946
505 언리얼4 언리얼5 - 간단 유도발사체 설정방법 금별 2023.06.01 2322
504 유니티 유니티 URP - 원신느낌의 Barbara의 치유 효과 만들기 금별 2023.06.01 3359
503 언리얼4 언리얼5 - High Quality Directionally animated FOG 금별 2023.05.31 2269
502 유니티 유니티 앰플리파이 쉐이더 - 쉐이더 활용 레이더 제작과정 금별 2023.05.25 2549
501 언리얼4 언리얼 - 물방울 형태 버프 이펙트 제작방법(물방울/십자 형태 텍스쳐제작) 금별 2023.05.25 2803
500 2D 포토샵 - 불/폭발/액체 그리는 방법 금별 2023.05.24 2706
499 유니티 유니티 쉐이더 그래프 URP - 에너지 쉴드 제작방법 금별 2023.05.22 3091
498 언리얼4 언리얼 - Smoothstep활용 프로시졀쉐이더 제작(2D 반지형 링) 금별 2023.05.18 3988
497 유니티 유니티 포스트프로세스 - 집중선 효과 제작과정 금별 2023.05.18 3339
496 유니티 유니티 앰플리파이 쉐이더 - 카툰풍 폭파 이펙트 제작방법(중국어) 금별 2023.05.15 3894
495 언리얼4 언리얼5 - 레벨에서 나이아가라 이펙트가 보이지 않을때 해결방법 금별 2023.05.15 3681
494 언리얼4 이펙터의 모든것! 게임이펙터 O/X 인터뷰 [신입~3년차] new 금별 2023.05.15 3692
493 언리얼4 Parallax Frost Material in UE5.2 Tutorial | Download Files ashif 2023.05.10 2295
492 언리얼4 언리얼 - 노출 변화화에 상관업이 이미시브 색상을 유지하는 방법 금별 2023.05.10 3555
491 유니티 유니티 쉐이더 팁 - 스텐실 버퍼를 활용한 카드형 포털 효과 금별 2023.05.10 3137
490 유니티 유니티 URP/HDRP - 스크린 공간·렌즈 플레어로 편하게 반짝 반짝 표현하기 금별 2023.05.08 4944

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand