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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
113 언리얼4 언리얼4 이펙트 팁 - 쇼크웨이브 제작 댓글+1 금별 2020.02.19 3241
112 유니티 기적의 셰이더 그래프 '어떤 노드든 이해시켜 드립니다 금별 2020.02.18 2994
111 유니티 유니티 셰이더&렌더링 에센스(retr0) 금별 2020.02.16 1491
110 3D [아르카도님 번역]【CAPCOM RE 2019】데빌메이크라이5에 VFX해설 금별 2020.02.10 1671
109 유니티 유니티 이펙트 팁 - 아주 간단히 보는 포털제작팁 댓글+1 금별 2020.02.10 1837
108 언리얼4 언리얼4 이펙트 팁 - 윈터 미믹 제작과정 금별 2020.02.07 3922
107 2D Kayleigh Pinhay - Weapon VFX concepts 금별 2020.02.07 3427
106 언리얼4 언리얼4 쉐이더 튜토리얼 - 홀로 글리치 효과 제작 금별 2020.02.04 2899
105 언리얼4 언리얼4 머터리얼 튜토리얼 - 수학을 활용한 쉐입형태 제작 금별 2020.02.04 1565
104 언리얼4 언리얼4 머터리얼 팁 - 월드 공간에서 스피어 마스크를 사용 금별 2020.02.02 2243
103 언리얼4 언리얼4 머터리얼 튜토리얼 - 흐르는 노이즈 머터리얼 제작 금별 2020.02.02 2457
102 언리얼4 언리얼4 튜토리얼 - 심리스 형태의 Animated 노이즈제작 금별 2020.01.31 1653
101 언리얼4 언리얼4 - 바다 파도 쉐이더 라이브 스트림 튜토리얼 금별 2020.01.24 3014
100 언리얼4 언리얼4 튜토리얼 - Explosions for Games (UE4 Particle Tutorial) 금별 2020.01.20 1601
99 언리얼4 언리얼4 팁 - 얼음물 유리잔 쉐이더 제작 댓글+1 금별 2020.01.20 2842
98 언리얼4 언리얼4 팁 - 회오리 표현 금별 2020.01.20 2675
97 언리얼4 [GDC]Stylized Games을 위한 VFX 아트 디렉팅 금별 2020.01.20 1515
96 2D Stylized Animated 2D 이펙트: 팁과 트릭 금별 2020.01.20 4217
95 언리얼4 Making-of: VFX 고스트리콘 브레이크 포인트 금별 2020.01.20 2259
94 언리얼4 언리얼4 팁 - UNREAL 4 TIPS AND TRICKS 금별 2019.12.29 1709
93 유니티 유니티 - Custom Vertex Stream and Shadergraph/Amplify Shader 금별 2019.12.29 5677
92 언리얼4 언리얼4 - 호박 폭발 이펙트 참고 및 노드예제 금별 2019.12.09 3051

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand