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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
1319 언리얼4 Beam Impact FX in Unreal Engine 5 Niagara ashif 14:13 17
1318 언리얼4 Fire Beam from Ground in Unreal Engine 5 Niagara ashif 04.10 23
1317 언리얼4 Arcane Ruin FX in Unreal Engine 5 Niagara ashif 04.09 38
1316 언리얼4 Arc Slash FX in Unreal Engine 5 Niagara ashif 04.09 33
1315 언리얼4 【UE5+후디니】UV 커스텀 무기 디졸브 기반 빠른 모델 제작_파트 2 금별 04.09 35
1314 언리얼4 【UE5+후디니】UV 커스텀 무기 디졸브 기반 빠른 모델 제작_파트 1 금별 04.09 37
1313 언리얼4 【UE5+후디니】루빅 큐브형태 애니메이션 연출 생성과정(한글자막) 금별 04.09 35
1312 언리얼4 【UE5+후디니】Stylized형태 검기을 생성 제작과정(한글자막) 금별 04.09 34
1311 언리얼4 【UE5+후디니】 동적 디졸브 구쉴드 생성 과정(한글자막) 금별 04.09 33
1310 언리얼4 Arcane Magic Lightning Eruption FX in Unreal Engine 5 Niagara ashif 04.05 73
1309 언리얼4 언리얼 - HLSL 커스텀노드_소벨 외곽선 추출 금별 04.04 80
1308 언리얼4 언리얼 - HLSL 커스텀노드_픽셀화 효과 제작과정 금별 04.04 68
1307 언리얼4 AOE Slam FX in Unreal Engine 5 Niagara ashif 04.01 81
1306 언리얼4 Illugen 활용 절차적 지면 크랙 효과 텍스처 생성(한글자막) 금별 04.01 108
1305 언리얼4 언리얼 - 파티클 원형 궤도(Circular Orbit) 위에서 자동 정렬방법(한글자막) 금별 04.01 114
1304 언리얼4 언리얼 - 간단한 머트리얼 디졸브를 구현하는 세 가지 방법(한글자막) 금별 03.22 215
1303 언리얼4 언리얼/후디니 -VAT 이펙트 툴체인 40분 설정: Niagara 워크플로우를 구축 방법(한글자막) 금별 03.22 177
1302 언리얼4 언리얼5 - 기본 스트라이프 렌더러 재질 효과 작성 방법(한글자막) 금별 03.22 151
1301 언리얼4 언리얼5 - 나이아가라는 입자를 나선형으로 움직이며 타깃에게 공격방법(한글자막) 금별 03.22 166
1300 언리얼4 언리얼5 - 나이아가라 입자의 원형 운동을 수동으로 조작 방법(한글자막) 금별 03.22 123
1299 언리얼4 언리얼5 - 나이아가라 입자를 특정 순서로 발사하여 적을 공격 방법(한글자막) 금별 03.22 136
1298 언리얼4 언리얼5 - 나이아가라 원형으로 입자를 발사해서 타깃에게 움직이기(한글자막) 금별 03.22 117

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand