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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
491 유니티 유니티 쉐이더 팁 - 스텐실 버퍼를 활용한 카드형 포털 효과 금별 2023.05.10 3063
490 유니티 유니티 URP/HDRP - 스크린 공간·렌즈 플레어로 편하게 반짝 반짝 표현하기 금별 2023.05.08 4794
489 유니티 유니티 앰플리 - 웨이브 디폼 형태의 옷가락 날리는 효과 구현 예제 금별 2023.05.08 3249
488 유니티 유니티 앰플리 - 붕괴 스타레일류 빨려들어가는 트랜지션효과 간단구현 금별 2023.05.08 5332
487 유니티 유니티 - 불,얼음,전기 속성 텍스쳐 구성 팁 금별 2023.05.08 4212
486 유니티 유니티 VFX 그래프 - Six-way lighting workflow new 금별 2023.05.04 3004
485 언리얼4 언리얼5 퀵팁 - VFX 아티스트들이 가장 많이 사용하는 5가지 UV 트릭 금별 2023.05.04 2872
484 언리얼4 언리얼5 퀵팁 - 텍스쳐를 나선형으로 만들기(polar coordinates) 금별 2023.05.04 3421
483 언리얼4 언리얼 - Drawing Locations to a Render Target 금별 2023.05.04 1958
482 2D 포토샵 - 간단한 노이즈 3종 제작방법 금별 2023.05.02 4614
481 2D 포토샵 - 간단한 플레어 텍스쳐 제작방법 금별 2023.05.02 2276
480 2D 포토샵 - 간단한 빔텍스쳐 제작방법 금별 2023.05.02 2352
479 2D 포토샵 - 간단한 소용돌이 형태 텍스쳐 제작방법 금별 2023.05.02 3110
478 2D 포토샵 - 플레임 히트 텍스쳐 제작방법 금별 2023.05.02 2410
477 유니티 유니티 - 패럴랙스 맵핑을 활용한 데칼제작 예제 금별 2023.05.02 3029
476 유니티 유니티 - 간단 번개 제작방법 금별 2023.04.30 3840
475 언리얼4 언리얼 - 수중 커스틱스 효과 제작방법 금별 2023.04.25 2348
474 언리얼4 언리얼5 - 나이아가라 활용 캐릭에 라이트닝 효과 제작방법 금별 2023.04.25 1913
473 언리얼4 언리얼5 - 뎁스감 있는 레이마칭 텍스쳐 활용 예제 금별 2023.04.24 2579
472 언리얼4 언리얼 5.2 - Crystal, Ice, Gemstone 머트리얼 제작 튜토리얼 금별 2023.04.24 2161
471 언리얼4 언리얼 - 간단 폭포 제작 팁 금별 2023.04.22 3181
470 언리얼4 언리얼5 - HLSL 코드 활용 채널 옵셋 효과 예제(RGB 디더링) 금별 2023.04.21 2673

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand