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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
478 2D 포토샵 - 플레임 히트 텍스쳐 제작방법 금별 2023.05.02 2368
477 유니티 유니티 - 패럴랙스 맵핑을 활용한 데칼제작 예제 금별 2023.05.02 2963
476 유니티 유니티 - 간단 번개 제작방법 금별 2023.04.30 3759
475 언리얼4 언리얼 - 수중 커스틱스 효과 제작방법 금별 2023.04.25 2274
474 언리얼4 언리얼5 - 나이아가라 활용 캐릭에 라이트닝 효과 제작방법 금별 2023.04.25 1853
473 언리얼4 언리얼5 - 뎁스감 있는 레이마칭 텍스쳐 활용 예제 금별 2023.04.24 2503
472 언리얼4 언리얼 5.2 - Crystal, Ice, Gemstone 머트리얼 제작 튜토리얼 금별 2023.04.24 2095
471 언리얼4 언리얼 - 간단 폭포 제작 팁 금별 2023.04.22 3123
470 언리얼4 언리얼5 - HLSL 코드 활용 채널 옵셋 효과 예제(RGB 디더링) 금별 2023.04.21 2604
469 2D 스테이블 디퓨전 - 원형 검기 텍스쳐 제작예제 금별 2023.04.18 2999
468 언리얼4 언리얼 - [기초]Create beautifull VFX 금별 2023.04.18 1956
467 언리얼4 언리얼5 - 캐릭 착지시 먼지 효과 생성 제작과정 금별 2023.04.14 2789
466 유니티 유니티 앰플리파이 쉐이더 - 쉐이더를 활용한 태극문양 제작방법 금별 2023.04.11 3135
465 유니티 유니티 앰플리파이쉐이더 - 구형 프렉쳐 이펙트 제작방법 금별 2023.04.11 3361
464 유니티 유니티 쉐이더 그래프 - Fractured Cube 튜토리얼 금별 2023.04.11 2817
463 유니티 유니티/쉐이더그래프 - Sub Emitters & Rain 금별 2023.04.04 3079
462 언리얼4 언리얼 - 간단 물 잔상 효과 제작방법 금별 2023.04.08 4690
461 2D 포토샵 - 간단 불 시퀀스 제작방법 금별 2023.04.08 4346
460 2D 포토샵 - 간단 발톱형태 스크래치 텍스쳐 제작방법 금별 2023.04.08 3816
459 2D 포토샵 - 간단 카툰 크랙 텍스쳐 제작방법 금별 2023.04.08 2891
458 2D 포토샵 - 간단한 가시형태 아우라 텍스처 제작방법 금별 2023.04.08 3209
457 2D 포토샵 - 심플한 LOL 스타일 스킬서클 제작방법 금별 2023.04.08 2551

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand