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



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

금별 0 1,735 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


번호 포토 분류 제목 글쓴이 날짜 조회
78 유니티 유니티 이펙트 제작과정 - 사슬로 감싼 폭발형태 제작 금별 2019.08.30 4957
77 유니티 마법적 구슬형태 제작 금별 2019.08.30 2054
열람중 유니티 유니티 버텍스 옵셋 효과 예제 Juane Gray 금별 2019.08.20 1736
75 유니티 Skeleton Mage Summon With Shaders and Textures 금별 2019.08.20 1460
74 언리얼4 언리얼4 - 버블쉐이더 금별 2019.08.20 1723
73 유니티 유니티 쉐이더 - 쉐이더그래프/앰플리파이 쉐이더에서의 커스터 버택스 스트림 사용 금별 2019.08.20 5329
72 언리얼4 토네이도와 폭발효과 만들기 금별 2019.08.18 3998
71 언리얼4 언리얼4 머터리얼 팁 - 텍스쳐없이 만드는 머터리얼 패턴 금별 2019.08.13 3234
70 유니티 유니티 쉐이더 그래프 - Weaving Ring Tutorial 2 댓글+1 금별 2019.08.12 1725
69 유니티 유니티 쉐이더 그래프 - Weaving Ring Tutorial 1 댓글+1 금별 2019.08.12 2203
68 유니티 유니티 쉐이더 팁 - 유령 트레일효과 SIN WAVE TRAIL 금별 2019.08.02 5933
67 유니티 유니티 쉐이더 팁 - RzFX//Radar Scan World Grid 금별 2019.07.24 4204
66 유니티 [NDC 2018] 게임 이펙트를 시작하는 법 금별 2019.07.18 1699
65 언리얼4 [NDC] 〈드래곤하운드〉 비주얼이펙트 연출 (언리얼4) 댓글+1 금별 2019.07.18 1838
64 유니티 유니티 쉐이더 팁 - 버블 쉐이더 만들기 금별 2019.07.14 4399
63 유니티 유니티 쉐이더 팁 - 스크린스페이스 맵핑을 객체의 월드포지션에 고정시키는 방법을 찾기 위한 사소한 팁 금별 2019.07.14 2066
62 유니티 유니티 쉐이더 튜토리얼 - 포트나이트형 갤럭시 쉐이더 제작 금별 2019.07.09 1874
61 유니티 유니티 - Soft squish shader(부드럽게 찌그러지는) 댓글+1 금별 2019.07.09 3211
60 유니티 유니티 - 홀로그램 행성 쉐이더 댓글+1 금별 2019.07.09 2106
59 유니티 유니티 반응형 풀 쉐이더 만들기 댓글+1 금별 2019.07.09 2691
58 유니티 유니티 이펙트 - 발사체 참고영상외 + 팁 금별 2019.05.09 4934
57 유니티 유니티 이펙트 튜토리얼 - 그라운드크랙 뎁스 마스크쉐이더 튜토리얼 금별 2019.03.20 5466

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand