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



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

금별 0 4,091 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


번호 포토 분류 제목 글쓴이 날짜 조회
389 언리얼4 언리얼 - 디지털 웨이브 간단 제작예제 금별 2022.12.11 3639
388 언리얼4 언리얼 - 광역 마법진 간단 제작예제 금별 2022.12.11 3641
387 3D 3dsmax에서 UV polar coordinate의 불규칙 모델 구현 금별 2022.12.11 2837
386 언리얼4 언리얼 - 저렴한 포그 제작방법[Depth-mask post process] 금별 2022.12.10 2308
385 유니티 슬래밍 AoE를 만드는 방법 - CGM Summer 22 금별 2022.12.07 2685
384 언리얼4 언리얼5 - 폴더에서 특정폴더/파일삭제후 성능을 즉시 향상시키는 방법 금별 2022.12.06 2372
383 언리얼4 언리얼5 - 아틀라스 마스터 머티리얼을 만드는 방법 금별 2022.12.06 4703
382 언리얼4 언리얼5 - 텍스쳐 메모리 절약팁(블루 채널 사용 간소화) 금별 2022.12.06 3821
381 언리얼4 언리얼5 퍼포먼스절약 팁 - 알파채널 사용X 금별 2022.12.06 2133
380 3D 후디니 - Lightning Weapon Slash Mesh 제작방법 금별 2022.12.06 2819
379 언리얼4 언리얼 5.1- 지오메트리 스크립트 : Snow and Icicles 금별 2022.12.05 2331
378 언리얼4 언리얼5 - 사운드 리플 효과 제작방법 금별 2022.12.05 2542
377 2D 게임 텍스쳐 뷰어 무료판 금별 2022.12.05 2461
376 언리얼4 언리얼5를 활용한 모션그래픽 적용 튜토리얼 채널(머트리얼+블루프린트) 금별 2022.12.05 3261
375 2D 섭스턴스디자인 - VFX 텍스쳐 제작방법 및 언리얼 적용영상 금별 2022.11.30 2451
374 유니티 유니티 VFX 그래프 - 캐릭터 파티클로 분해 효과 예제 제작방법 new 금별 2022.11.30 3084
373 유니티 유니티 - 나루토 치도리 VFX 제작방법 금별 2022.11.28 4237
372 유니티 유니티 쉐이더 - 반응형 눈 쉐이더 제작방법(움푹패이는) 금별 2022.11.28 3645
371 유니티 유니티 - 라이트닝 파티클 제작방법(오브젝트 근처에서 튀기는) 금별 2022.11.28 4922
370 언리얼4 언리얼 머트리얼 - 다양한 UV 샘플링 모양 제작방법 금별 2022.11.23 2741
369 언리얼4 언리얼 - 간단한 UV disturbance 생성예제 금별 2022.11.23 2355
368 2D 섭스턴스 디자인 - 섭디에서 시퀀스 이미지 제작방법 금별 2022.11.23 3303

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand