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



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

금별 0 4,654 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


번호 포토 분류 제목 글쓴이 날짜 조회
573 언리얼4 언리얼5 - 머트리얼 노드를 텍스처로 변경하는 다양한 방법(맵 변위) 금별 2023.09.09 2561
572 언리얼4 언리얼 - 셰이더 기반 파티클 Velocity 늘리기 금별 2023.09.01 2408
571 2D Cursed Flamed 간단제작 팁 금별 2023.09.01 2361
570 언리얼4 언리얼5.3 - 논 텍스쳐 쉐이더 제작과정 ashif 2023.08.31 2383
569 언리얼4 언리얼5.2 - 우주 공간 포털생성 효과 제작과정 ashif 2023.08.30 2454
568 언리얼4 언리얼5 - Niagara OrbVFX Top tip 에너지구의 표현방법 금별 2023.08.29 2602
567 유니티 유니티공식 - 볼류메트릭 레이마칭 튜토리얼 금별 2023.08.24 2912
566 유니티 유니티 - Stylized 도트화 이펙트 제작과정 금별 2023.08.23 4373
565 유니티 유니티 - 롤 케인 모작 원형 검기 공격 이펙트 제작설명 금별 2023.08.23 3686
564 유니티 유니티 - 귀칼 젠이츠 번개의 호흡 연출예제 제작과정 설명영상 금별 2023.08.21 4392
563 유니티 유니티 - 스텐실을 활용한 포털효과 제작과정 금별 2023.08.20 3059
562 유니티 유니티 - 출렁거리는 Sci-fi 쉴드 쉐이더 예제 제작튜토리얼 금별 2023.08.19 3495
561 언리얼4 언리얼 5.3 - Sparse Volume Textures (VDBs) 금별 2023.08.16 2957
560 언리얼4 언리얼4 캐스캐이드 - 이미터 유지 스폰시간 계산 금별 2023.08.16 2365
559 2D 애펙을 활용한 간단한 카드형 UI 생성 연출 예제 제작과정 금별 2023.08.16 2412
558 언리얼4 언리얼 - 2D->3D로 카메라 벡터 - HLSL 코드 활용 동적 만다라 쉐이더 제작 금별 2023.08.16 2250
557 언리얼4 언리얼 머트리얼 - 타일 그라디언트에서 원형 링 마스크로 변환 금별 2023.08.16 3520
556 언리얼4 언리얼 - 2D 헥사곤 타일 애니메이션 연출 제작노드 금별 2023.08.16 2531
555 언리얼4 언리얼 Material Texcoord 사용법[한국어 라이브 특강] 금별 2023.08.12 2931
554 유니티 유니티 - 빙속성 화살 스킬 제작과정 금별 2023.08.11 3125
553 언리얼4 언리얼5 - 간단한 소용돌이 쉐이더 제작방법 금별 2023.08.11 3329
552 언리얼4 언리얼5 - 데칼 실시간 생성 및 늘어나는 문제 해결 금별 2023.08.11 2819

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand