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



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

금별 0 2,312 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


번호 포토 분류 제목 글쓴이 날짜 조회
148 유니티 유니티 쉐이더그래프 - 노이즈 관련 이미지 팁 금별 2020.08.06 3501
147 유니티 유니티 - 매직 카드제작 트릭팁 금별 2020.08.02 2648
146 언리얼4 언리얼4 - 머터리얼에서 양면 렌더링 방법 금별 2020.07.30 3937
145 언리얼4 언리얼4 - Vertex(정점) Offset 흡수 효과 금별 2020.07.30 4328
144 유니티 유니티 앰플리파이 쉐이더 이펙트 - 물속성+불속성 토네이토 금별 2020.07.30 2429
143 언리얼4 언리얼4 나이아가라 - 트레일관련 미니팁 금별 2020.05.30 2370
142 유니티 유니티 - 기어즈5 Hammer of Dawn 이펙트 만들기 댓글+1 금별 2020.05.16 2236
141 유니티 포토샵으로 디졸브 쉐이더를 사용해 2D 툰이펙트 제작팁 댓글+2 금별 2020.05.16 4560
140 언리얼4 언리얼4 이펙트 튜토리얼 - 애펙을 사용한 트랜지션 효과 만들기 금별 2020.04.01 3336
139 유니티 유니티 URP 쉐이더그래프 팁 - 블러만들기 금별 2020.04.01 6490
138 유니티 유니티 HDRP에서 소규모 고품질의 영상 제작 - Unite Tokyo 2019 금별 2020.03.29 2224
137 3D Visual Effects Bootcamp: The Rise of Realtime 금별 2020.03.26 2255
136 언리얼4 언리얼4 머터리얼 튜토리얼 - Procedural 노이즈제작 금별 2020.03.26 2260
135 언리얼4 언리얼4 머터리얼 팁 - 머터리얼만으로 밴드형태 구현하기 금별 2020.03.26 2558
134 언리얼4 언리얼4 머터리얼 팁 - 머터리얼만으로 트위스트 구현하기 금별 2020.03.26 2067
133 유니티 유니티 쉐이더 그래프 - Orthographic 뎁스 금별 2020.03.26 2072
132 언리얼4 언리얼4 머터리얼 튜토 - 플립북 모션벡터의 비대칭 RowCollumn 카운트 수정 금별 2020.03.19 2117
131 유니티 유니티 쉐이더 그래프 - 꼬여지는듯한 착각의 쉐이더 금별 2020.03.19 2418
130 언리얼4 언리얼4 이펙트 팁 - 꿀렁이는 액체머터리얼 금별 2020.03.14 4413
129 3D [후디니]간단한 UV twist 방법 댓글+1 금별 2020.03.14 3171
128 2D 번개 효과 제작 간단팁 영상 댓글+2 금별 2020.03.13 3665
127 언리얼4 언리얼4 - 리퀴드 이로이젼(침식) 효과 금별 2020.03.12 3145

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand