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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
359 언리얼4 언리얼4 나이아가라 - 매직 포털 이펙트 제작방법 금별 2022.11.14 2315
358 언리얼4 언리얼 머트리얼 - 쉐이더 토이에서 응용한 간단한 레이더 제작방법 금별 2022.11.14 2270
357 언리얼4 언리얼 머트리얼 - 쉐이더 토이에서 응용한 원형 로딩 스피너 제작과정 금별 2022.11.14 2321
356 언리얼4 언리얼 나이아가라 - UI에 이펙트 붙이기 금별 2022.11.10 4235
355 유니티 유니티 앰플리파이 쉐이더 - 라이트닝 셰이더 제작 과정 금별 2022.11.05 3087
354 언리얼4 언리얼5 - 간단한 프로즌 효과 제작방법 금별 2022.11.05 3421
353 유니티 유니티 - 레이마칭을 활용한 블랙홀 제작방법 금별 2022.11.03 3129
352 언리얼4 언리얼4 나이아가라 - 흩뿌려지는 형태의 디졸브 제작방법 금별 2022.11.03 2980
351 언리얼4 언리얼4 나이아가라 - 파티느낌의 리본이펙트 제작방법 금별 2022.11.03 2791
350 유니티 유니티 에너지볼(노바 쉐이더) 제작영상 및 자료 금별 2022.10.26 3693
349 언리얼4 [한글]언리얼5 - Location of Age(Initial Location) 나아가는 입자 배치하기 금별 2022.10.26 2461
348 언리얼4 [한글]언리얼 - Dust FlowMap concept Tutorial 먼지 플로우맵 효과1 제작튜토리얼 금별 2022.10.26 3088
347 유니티 유니티 앰플리파이 쉐이더 - 흑백처리효과[grabpass] 제작방법 금별 2022.10.24 3296
346 유니티 유니티 쉐이더그래프 - 흑백처리효과[grabpass] 제작방법 금별 2022.10.24 6090
345 2D [텍스쳐 페인터]Flame Painter 10주년 할인(10달러) 금별 2022.10.24 2479
344 언리얼4 언리얼 나이아가라 - 디졸브 제작 튜토리얼 금별 2022.10.24 2626
343 언리얼4 [오프라인특강영상]언리얼4 이펙터가 알아야할 랜더링 오프라인 특강 금별 2022.10.23 2787
342 언리얼4 언리얼 이펙터 기본강의 - 색감과 타이밍[한글이론] 금별 2022.10.23 2719
341 언리얼4 언리얼 - 나이아가라 흡수 효과 제작방법 금별 2022.10.20 3859
340 언리얼4 언리얼 - 게임에서 VAT를 활용하는 방법(GIC 폴란드 컨퍼런스) 금별 2022.10.16 2733
339 언리얼4 언리얼 - 횡으로 생성되는 헥사곤 타일 연출예제(노드포함) 금별 2022.10.14 2606
338 언리얼4 언리얼 간단팁 - 원형 UV 심 밉맵 모드변경으로 수정하는팁 금별 2022.10.13 2721

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand