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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
271 유니티 유니티 셰이더그래프 - 반응형 파티클 제작과정(한글자막) 금별 04.19 42
270 유니티 유니티 - 앰플리파이셰이더 활용한 극좌표 소용돌이 형태 제작과정(한글자막) 금별 04.18 43
269 유니티 유니티 - 셰이더그래프 활용한 UI에 적용동 스크롤버튼 제작과정(한글자막) 금별 04.18 41
268 유니티 유니티 - Stylized 물속성 검기 VFX 제작과정(중국어/AI한글자막) 금별 04.16 78
267 유니티 유니티 - Stylized 회오리 VFX 스킬 제작과정 금별 04.16 46
266 유니티 유니티 - Stylzied 검기 제작과정(중국어/AI한글자막) 금별 04.16 35
265 유니티 유니티 - 흐르듯 사라지는 2D 카드 이펙트/트레일 제작과정 금별 04.10 143
264 유니티 유니티/포토샵 - 불속성/물속성 소드 슬래시 간단 제작과정(한글자막) 금별 03.19 213
263 유니티 유니티 - 2D 형태 충격파 궁극기 제작과정 금별 03.17 215
262 유니티 유니티 셰이더 그래프 - 글리치 효과 제작과정 금별 03.10 172
261 유니티 유니티 셰이더 그래프 - 가까운 거리에 따른 오퍼시티 변화 셰이더효과 제작과정(한글자막) 금별 02.28 163
260 유니티 유니티 앰플리파이 셰이더 - 2D 형태 Sci-fi 파티클 테이링 효과 예제 및 제작노드 금별 02.26 135
259 유니티 유니티 - 카툰풍 핵폭발 효과 제작과정(AI한글자막) 금별 02.26 425
258 유니티 유니티 셰이더 그래프 - 간단한 지형스캔 효과 제작방법(한글자막) 금별 02.20 149
257 유니티 유니티 앰플라파이 셰이더 - 입체적 카드 효과 제작과정 금별 02.14 459
256 유니티 유니티 셰이더 그래프 - 2D 카툰풍 구체아우라 확산효과 제작과정 금별 02.07 388
255 유니티 유니티 - 초보자도 이해하는 URP와 성능, 그리고 모바일까지 금별 02.03 177
254 유니티 유니티 셰이더 그래프 - 오디오 비주얼라이저 효과 제작과정 금별 02.02 141
253 유니티 유니티/후디니 - 빔 이펙트 제작과정 금별 01.29 236
252 유니티 유니티 셰이더 그래프 - Zelda: Breath of the Wild의 원격 폭탄 만들기(한글자막) 금별 01.27 229
251 유니티 유니티 - 부분 화면 흔들기 셰이더 제작방법 금별 01.22 213
250 유니티 유니티 앰플리파이 셰이더 - 병의 출렁이는 액체셰이더 제작과정 금별 01.16 199

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand