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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
586 언리얼4 언리얼5 - 파티클 브러싱 효과 제작과정 금별 2023.09.17 2577
585 언리얼4 언리얼5 - 스테이블 디퓨전 활용 2D 검 쉐이더 효과 제작과정 금별 2023.09.17 2659
584 언리얼4 언리얼5 - 다양한 논텍스쳐 머트리얼 패턴 제작과정 금별 2023.09.17 2470
583 언리얼4 언리얼5 - 나이아가라 모듈 스크립트 활용 다양한 방사형태 생성방법(나선,파형) 금별 2023.09.17 3025
582 언리얼4 언리얼5 - 빔 형태 사각형라이트 사용법[RectLight] 금별 2023.09.14 2508
581 언리얼4 언리얼5 - 나이아가라 Magic Explosion Effect 제작과정 금별 2023.09.14 2491
580 유니티 유니티 VFX 그래프 - Sci-fi 라인 생성 이펙트 제작과정 금별 2023.09.14 2597
579 2D 섭스턴스 디자인 - 간단한 트레일 텍스쳐 제작과정 금별 2023.09.14 2469
578 유니티 유니티 앰플리파이 쉐이더 - 보호막 이펙트 제작과정 금별 2023.09.12 3994
577 유니티 유니티 앰플리파이 쉐이더 - 스텐실 버퍼 활용 간단 이펙트제작팁 금별 2023.09.12 3046
576 유니티 유니티/맥스 - 간단한 디폼 활용 이펙트 제작팁 금별 2023.09.12 2756
575 언리얼4 유니티 - 수묵화 스타일 이펙트 분석 금별 2023.09.12 4177
574 언리얼4 언리얼5.3 - WPO 활용 디졸브 머트리얼 제작과정 ashif 2023.09.12 2715
573 언리얼4 언리얼5 - 머트리얼 노드를 텍스처로 변경하는 다양한 방법(맵 변위) 금별 2023.09.09 2732
572 언리얼4 언리얼 - 셰이더 기반 파티클 Velocity 늘리기 금별 2023.09.01 2575
571 2D Cursed Flamed 간단제작 팁 금별 2023.09.01 2524
570 언리얼4 언리얼5.3 - 논 텍스쳐 쉐이더 제작과정 ashif 2023.08.31 2536
569 언리얼4 언리얼5.2 - 우주 공간 포털생성 효과 제작과정 ashif 2023.08.30 2621
568 언리얼4 언리얼5 - Niagara OrbVFX Top tip 에너지구의 표현방법 금별 2023.08.29 2760
567 유니티 유니티공식 - 볼류메트릭 레이마칭 튜토리얼 금별 2023.08.24 3073
566 유니티 유니티 - Stylized 도트화 이펙트 제작과정 금별 2023.08.23 4645
565 유니티 유니티 - 롤 케인 모작 원형 검기 공격 이펙트 제작설명 금별 2023.08.23 3875

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand