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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
222 2D 포토샵 - 간단 불 시퀀스 제작방법 금별 2023.04.08 1599
221 언리얼4 언리얼4 머터리얼 팁 - 루핑되는 액체 메쉬 머터리얼 만들기 금별 2020.02.28 1605
220 언리얼 언리얼4 - Unifrom Circle Spawner Tutorial 금별 2019.01.14 1608
219 3D Visual Effects Bootcamp: The Rise of Realtime 금별 2020.03.26 1608
218 2D 이펙트 이미터별 요소 영어용어정리 댓글+1 금별 2022.09.15 1612
217 언리얼4 언리얼 - 디졸브 머트리얼 노드 예제 금별 2022.02.17 1613
216 언리얼4 언리얼4 튜토리얼 - Explosions for Games (UE4 Particle Tutorial) 금별 2020.01.20 1620
215 유니티 유니티 앰플리파이 쉐이더 - 용해화 스타일 하프톤 쉐이더 제작방법(중국어) 금별 2022.08.23 1623
214 2D [간단팁]라이트닝 효과 제작원리 금별 2022.09.03 1626
213 유니티 유니티 앰플리파이 쉐이더 - 카툰풍 폭파 이펙트 제작방법(중국어) 금별 2023.05.15 1635
212 언리얼4 언리얼 - 나이아가라 흡수 효과 제작방법 금별 2022.10.20 1635
211 유니티 유니티 - 2d Raymarched Smoke 댓글+5 금별 2019.10.26 1643
210 유니티 유니티 쉐이더 그래프 - Remapping Tech Art Toolbox 사진동영상new 금별 2022.03.04 1657
209 언리얼4 언리얼4 - 방사형 그라디언트와 외적 사용한 굴절링 제작노드 예제 금별 2021.12.14 1658
208 2D 섭스턴스 디자인 - VFX Smoke Texture Trail new 금별 2022.07.07 1658
207 유니티 유니티에서 JangaFX의 VectorayGen을 공식지원 금별 2018.11.11 1663
206 유니티 유니티 - 달 움직임 쉐이더 표현 금별 2021.12.30 1667
205 언리얼4 언리얼 - WPO를 활용한 각면의 회전 효과 금별 2022.03.14 1667
204 유니티 유니티 - 바닥 크랙/흩날림 효과 제작과정(중국어) 금별 2022.02.17 1668
203 언리얼4 언리얼4 - 페이크 색수차 효과(facking chromatic aberration) 금별 2022.01.24 1669
202 언리얼4 언리얼4 튜토리얼 - 심리스 형태의 Animated 노이즈제작 금별 2020.01.31 1676
201 유니티 [NDC 2018] 게임 이펙트를 시작하는 법 금별 2019.07.18 1680

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand