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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
347 유니티 유니티 앰플리파이 쉐이더 - 흑백처리효과[grabpass] 제작방법 금별 2022.10.24 3223
346 유니티 유니티 쉐이더그래프 - 흑백처리효과[grabpass] 제작방법 금별 2022.10.24 5986
345 2D [텍스쳐 페인터]Flame Painter 10주년 할인(10달러) 금별 2022.10.24 2414
344 언리얼4 언리얼 나이아가라 - 디졸브 제작 튜토리얼 금별 2022.10.24 2576
343 언리얼4 [오프라인특강영상]언리얼4 이펙터가 알아야할 랜더링 오프라인 특강 금별 2022.10.23 2748
342 언리얼4 언리얼 이펙터 기본강의 - 색감과 타이밍[한글이론] 금별 2022.10.23 2672
341 언리얼4 언리얼 - 나이아가라 흡수 효과 제작방법 금별 2022.10.20 3797
340 언리얼4 언리얼 - 게임에서 VAT를 활용하는 방법(GIC 폴란드 컨퍼런스) 금별 2022.10.16 2673
339 언리얼4 언리얼 - 횡으로 생성되는 헥사곤 타일 연출예제(노드포함) 금별 2022.10.14 2543
338 언리얼4 언리얼 간단팁 - 원형 UV 심 밉맵 모드변경으로 수정하는팁 금별 2022.10.13 2670
337 언리얼4 언리얼 간단팁 - Dot Product(벡터 내적)를 활용한 디세츄레이션(채도감소) 금별 2022.10.13 2942
336 유니티 유니티 앰플리파이 쉐이더 - 버텍스 오프셋을 활용한 리듬 기둥 이펙트[노드포함] 금별 2022.10.13 2911
335 언리얼4 언리얼 나이아가라 - 텔레포트 효과 제작방법 금별 2022.10.13 2593
334 언리얼4 언리얼 나이아가라 - 액터 홀로그래픽 FX 제작방법 금별 2022.10.13 2431
333 유니티 유니티 - How to upgrade materials to URP in Unity 2021.2.2 금별 2022.10.09 2612
332 언리얼4 언리얼 - 간단한 발사체 트레일 제작방법 금별 2022.10.09 4642
331 언리얼4 언리얼 나이아가라 - Spawn Per Unit Sword Trails 설명 금별 2022.10.09 2706
330 언리얼4 언리얼 나이아가라 - 캐릭이 불타는 효과 제작방법 금별 2022.10.09 3026
329 언리얼4 언리얼 - 스크린 트랜지션 효과 제작방법 금별 2022.10.06 2986
328 언리얼4 언리얼 - 프로시졀 트라이앵글형태 타일링 효과 예제(머트리얼 노드 포함) 금별 2022.10.06 3049
327 언리얼4 언리얼 나이아가라 - 분해 후 흡수 효과 제작방법 금별 2022.10.06 3698
326 언리얼4 언리얼 - 캐릭이 액체화되는 효과 제작방법 금별 2022.10.06 3726

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand