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



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

금별 0 1,663 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


번호 포토 분류 제목 글쓴이 날짜 조회
211 유니티 유니티 쉐이더 팁 - 스크린스페이스 맵핑을 객체의 월드포지션에 고정시키는 방법을 찾기 위한 사소한 팁 금별 2019.07.14 1900
210 유니티 유니티 앰플리파이 쉐이더 이펙트 - 물속성+불속성 토네이토 금별 2020.07.30 1881
209 유니티 유니티 쉐이더 그래프 - 꼬여지는듯한 착각의 쉐이더 금별 2020.03.19 1861
208 유니티 유니티 쉐이더 그래프 팁 - 꿀렁이는 호수관 만들기 금별 2018.12.19 1841
207 유니티 유니티 쉐이더 그래프(LA 유나이트) - Best practices for Shader Graph 금별 2018.12.19 1832
206 유니티 유니티 - 트레일 이펙트 제작 참고영상 금별 2021.11.01 1829
205 유니티 유니티 - 원통형 메쉬에 토네이도형 uv 흐름제어 금별 2019.08.30 1815
204 유니티 유니티 이펙트 팁 - 아주 간단히 보는 포털제작팁 댓글+1 금별 2020.02.10 1794
203 유니티 유니티 쉐이더 튜토리얼 - 포트나이트형 갤럭시 쉐이더 제작 금별 2019.07.09 1782
202 유니티 유니티 앰플리 - 붕괴 스타레일류 빨려들어가는 트랜지션효과 간단구현 금별 2023.05.08 1778
201 유니티 Z-뎁스로 균열효과 만들기 금별 2018.12.19 1778
200 유니티 유니티 쉐이더 - 정점 쉐이더 애니메이션 입문 [일본자료 번역] 금별 2019.03.12 1721
199 유니티 유니티 - 기어즈5 Hammer of Dawn 이펙트 만들기 댓글+1 금별 2020.05.16 1709
198 유니티 유니티 이펙트 튜토리얼 - 데몬즈 소울 느낌의 자연스러운 디졸브 사라짐 효과 금별 2021.04.01 1707
197 유니티 유니티 - 다크 토네이도 제작과정 금별 2022.05.19 1686
196 유니티 유니티 쉐이더 - 오브젝트 표면 파티클화 효과 제작방법(쉐이더코드포함) 금별 2022.08.18 1682
195 유니티 유니티 앰플리파이 쉐이더 - 노이즈 쉐이더 제작과정(중국어) 금별 2022.08.11 1679
194 유니티 유니티 HDRP에서 소규모 고품질의 영상 제작 - Unite Tokyo 2019 금별 2020.03.29 1675
열람중 유니티 유니티 버텍스 옵셋 효과 예제 Juane Gray 금별 2019.08.20 1664
192 유니티 유니티 앰플리파이 쉐이더 - 나비 효과 구현하기 금별 2022.08.25 1664
191 유니티 유니티 쉐이더 그래프 - Cuphead Fire 금별 2020.10.20 1649
190 유니티 유니티 쉐이더 그래프 - Weaving Ring Tutorial 2 댓글+1 금별 2019.08.12 1632

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand