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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
312 2D 섭스턴스 디자인/언리얼 - 바닥 크랙 데칼 제작방법 금별 2022.09.14 3686
311 2D 포토샵 - 비정형 라인 생성방법 금별 2022.09.14 3770
310 2D 포토샵 - 간단한 플레어 제작방법 금별 2022.09.14 3090
309 유니티 유니티 앰플리파이 쉐이더 - 얼음 소재 제작방법(중국어) 댓글+1 금별 2022.09.08 3819
308 유니티 유니티 앰플리파이 쉐이더 - 카툰느낌 불 소재 제작방법(중국어) 금별 2022.09.08 3257
307 2D 포토샵 - 다양한 패턴의 간단 텍스쳐 제작 방법 금별 2022.09.04 2896
306 2D [간단팁]라이트닝 효과 제작원리 금별 2022.09.03 2948
305 2D 애프터 이펙트 - 엘리먼트 3D 카툰풍 빔 이펙트 제작방법(중국어) 금별 2022.08.31 3783
304 언리얼4 언리얼 - 나이아가라에 블루프린트로 트리거 셋팅 퀵팁 금별 2022.08.29 3343
303 유니티 유니티 앰플리파이 쉐이더 - 눈알 형태의 우주공간 생성 제작방법 금별 2022.08.29 2632
302 유니티 유니티 앰플리파이 쉐이더 - 나비 효과 구현하기 금별 2022.08.25 4600
301 유니티 유니티 - 피어나는 꽃봉오리 효과 제작과정영상 금별 2022.08.25 3289
300 유니티 유니티 - 자라나는 나무 효과 제작과정 금별 2022.08.25 3359
299 유니티 유니티 쉐이더 그래프 - 3D 스캔 이펙트 제작방법 금별 2022.08.24 2862
298 유니티 유니티 쉐이더그래프 - 오브텍트 반응형 폭포제작 금별 2022.08.24 2636
297 유니티 유니티 쉐이더 - 스텐실 버퍼 활용방법 금별 2022.08.24 2992
296 유니티 유니티 쉐이더 그래프 - 홀로그램 카드 제작방법 금별 2022.08.24 2652
295 유니티 유니티 앰플리파이 쉐이더 - 용해화 스타일 하프톤 쉐이더 제작방법(중국어) 금별 2022.08.23 3352
294 유니티 유니티 쉐이더 - 오브젝트 표면 파티클화 효과 제작방법(쉐이더코드포함) 금별 2022.08.18 4290
293 언리얼4 언리얼5 - 시간 역재생(프렉쳐) 효과 튜토리얼 금별 2022.08.18 2938
292 언리얼4 언리얼 머트리얼 노드 예제 - 2D 트랜지션 효과 노드 금별 2022.08.18 2419
291 언리얼4 언리얼 퀵팁 - 2D 컬 노이즈 간단제작방법 금별 2022.08.17 2258

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand