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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
425 유니티 쿠파 유니티이펙트 취업 클래스 실제강의 파도,워터 쇼크웨이브 간단 제작과정 금별 2023.03.04 2750
424 언리얼4 언리얼5 - 스파크 라이트닝 제작과정 금별 2023.03.01 1885
423 언리얼4 언리얼 - 외곽이 꿀렁되는 UMG 머트리얼 금별 2023.02.28 2338
422 유니티 유니티 - 캐릭 도트화 ScreenPosition 적용 제작과정예제 금별 2023.02.20 2022
421 유니티 유니티 - 쿠파 취업 클래스 실제강의 파도,워터 쇼크웨이브 압축 제작과정 금별 2023.02.20 2188
420 언리얼4 언리얼 - UV 축을 보여주는 머티리얼 함수 금별 2023.02.19 2970
419 언리얼4 언리얼 - 디지털 트랜지션 효과 제작방법 금별 2023.02.17 2146
418 언리얼4 언리얼 - Procedural Hex Tiling Material 금별 2023.02.17 1698
417 언리얼4 언리얼5 - 원신느낌의 Wenti's 원소폭파 제작과정 금별 2023.02.13 2540
416 3D 마야 - 윈드 메쉬 제작방법 금별 2023.02.13 2326
415 유니티 유니티 - 캐쥬얼 신체절단 피튀김 간단제작과정 (혐짤은 아님) 금별 2023.02.02 2478
414 언리얼4 언리얼 - Value erosion_Normalized 금별 2023.02.02 1879
413 언리얼4 언리얼5 나이아가라-촉수 제작 튜토리얼 금별 2023.02.01 1914
412 언리얼4 언리얼5 나이아가라-물고기떼 제작 튜토리얼 금별 2023.02.01 2006
411 언리얼4 언리얼5/섭디 - 커스터마이징과 수축 가능한 별 쉐이더 제작방법 금별 2023.02.01 2036
410 언리얼4 린반의 언리얼 이펙트 강의 가이드 V 1 금별 2023.01.28 1880
409 유니티 유니티 VFX 그래프 - 야스오 윈드월 이펙트 제작과정 금별 2023.01.26 1928
408 언리얼4 언리얼5 나이아가라 - Shading Niagara Fluids(꿀 느낌) 금별 2023.01.26 1697
407 언리얼4 언리얼 - 레트로 TV 스크린 효과 제작과정 금별 2023.01.25 1624
406 유니티 유니티 VFX 그래프 - 포켓몬 이빨 공격효과 예제 제작과정 금별 2023.01.12 2541
405 2D 섭디/유니티 - POM(ParallaxOcclusionMapping)활용 바닥 크랙 제작방법 금별 2023.01.10 2622
404 언리얼4 언리얼 - 검소환 공격효과 예제 part1 금별 2023.01.10 2210

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand