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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
294 유니티 유니티 쉐이더 - 오브젝트 표면 파티클화 효과 제작방법(쉐이더코드포함) 금별 2022.08.18 3891
293 언리얼4 언리얼5 - 시간 역재생(프렉쳐) 효과 튜토리얼 금별 2022.08.18 2537
292 언리얼4 언리얼 머트리얼 노드 예제 - 2D 트랜지션 효과 노드 금별 2022.08.18 2136
291 언리얼4 언리얼 퀵팁 - 2D 컬 노이즈 간단제작방법 금별 2022.08.17 1997
290 유니티 유니티 앰플리파이 쉐이더 - 트라이메쉬형태 방패 스킨 제작방법(중국어) 금별 2022.08.16 2583
289 유니티 유니티 앰플리파이 쉐이더 - 카드 생성 효과 제작방법(중국어) 금별 2022.08.16 3210
288 유니티 유니티 - 바루스 활 공격 효과 모작 제작과정(중국어) 금별 2022.08.11 3806
287 유니티 유니티 앰플리파이 쉐이더 - 노이즈 쉐이더 제작과정(중국어) 금별 2022.08.11 3740
286 유니티 유니티 - 앰플리파이쉐이더 2D 캐릭터 아웃라인 제작과정(중국어) 금별 2022.08.10 3760
285 유니티 유니티 - 방패버프효과 제작과정(중국어) 금별 2022.08.10 3350
284 언리얼4 언리얼 팁 - 라운드 텍스처에 대한 방사형 디스토션 생성 방법 동영상new 댓글+1 금별 2022.07.30 1979
283 유니티 유니티 앰플리파이 쉐이더 - 스크린 이펙트 제작과정(외곽라인이 불타는효과) 금별 2022.07.14 2924
282 유니티 유니티 앰플리파이쉐이더 - 번개 효과 제작방법(중국어) 금별 2022.07.14 2543
281 언리얼 언리얼 팁 - 프로젝트 이름 변경하는법 금별 2022.07.14 7921
280 유니티 유니티 앰플리파이 쉐이더 - 카드 효과(외곽 반사 효과 예제) 금별 2022.07.14 2612
279 언리얼4 나이아가라 - 모듈에 스태틱 스위치를 추가해 옵션기능을 노출하는법 금별 2022.07.14 2114
278 유니티 유니티 - 캐릭터 트레일 제작방법 금별 2022.07.14 2259
277 3D 블랜더 - 노드만을 이용한 원형 화염 제작 금별 2022.07.14 2122
276 언리얼 언리얼 - 노드를 사용한 타일링 텍스쳐 제작방법 사진 금별 2022.07.14 2355
275 언리얼4 언리얼5 - 육각형 트랜지션 머트리얼 효과(노드포함) 금별 2022.07.08 2579
274 2D 섭스턴스 디자인 - VFX Smoke Texture Trail new 금별 2022.07.07 2994
273 유니티 유니티 퀵팁 - 간단한 소팅 이슈 해결법 금별 2022.07.07 1820

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand