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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
393 유니티 유니티 VFX 그래프 - Kassadin Slash 제작방법 금별 2022.12.14 3812
392 유니티 유니티 쉐이더 그래프 - Gradients 2D Sky Tutorial 금별 2022.12.12 2651
391 언리얼4 언리얼 - Hit 플레어 간단 제작과정 금별 2022.12.11 2690
390 언리얼4 언리얼 - 간단 반구 폭파 간단 제작예제 금별 2022.12.11 3159
389 언리얼4 언리얼 - 디지털 웨이브 간단 제작예제 금별 2022.12.11 3691
388 언리얼4 언리얼 - 광역 마법진 간단 제작예제 금별 2022.12.11 3676
387 3D 3dsmax에서 UV polar coordinate의 불규칙 모델 구현 금별 2022.12.11 2872
386 언리얼4 언리얼 - 저렴한 포그 제작방법[Depth-mask post process] 금별 2022.12.10 2335
385 유니티 슬래밍 AoE를 만드는 방법 - CGM Summer 22 금별 2022.12.07 2737
384 언리얼4 언리얼5 - 폴더에서 특정폴더/파일삭제후 성능을 즉시 향상시키는 방법 금별 2022.12.06 2400
383 언리얼4 언리얼5 - 아틀라스 마스터 머티리얼을 만드는 방법 금별 2022.12.06 4767
382 언리얼4 언리얼5 - 텍스쳐 메모리 절약팁(블루 채널 사용 간소화) 금별 2022.12.06 3885
381 언리얼4 언리얼5 퍼포먼스절약 팁 - 알파채널 사용X 금별 2022.12.06 2156
380 3D 후디니 - Lightning Weapon Slash Mesh 제작방법 금별 2022.12.06 2861
379 언리얼4 언리얼 5.1- 지오메트리 스크립트 : Snow and Icicles 금별 2022.12.05 2360
378 언리얼4 언리얼5 - 사운드 리플 효과 제작방법 금별 2022.12.05 2572
377 2D 게임 텍스쳐 뷰어 무료판 금별 2022.12.05 2483
376 언리얼4 언리얼5를 활용한 모션그래픽 적용 튜토리얼 채널(머트리얼+블루프린트) 금별 2022.12.05 3341
375 2D 섭스턴스디자인 - VFX 텍스쳐 제작방법 및 언리얼 적용영상 금별 2022.11.30 2477
374 유니티 유니티 VFX 그래프 - 캐릭터 파티클로 분해 효과 예제 제작방법 new 금별 2022.11.30 3111
373 유니티 유니티 - 나루토 치도리 VFX 제작방법 금별 2022.11.28 4289
372 유니티 유니티 쉐이더 - 반응형 눈 쉐이더 제작방법(움푹패이는) 금별 2022.11.28 3689

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand