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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
408 언리얼4 언리얼5 나이아가라 - Shading Niagara Fluids(꿀 느낌) 금별 2023.01.26 2436
407 언리얼4 언리얼 - 레트로 TV 스크린 효과 제작과정 금별 2023.01.25 2647
406 유니티 유니티 VFX 그래프 - 포켓몬 이빨 공격효과 예제 제작과정 금별 2023.01.12 3891
405 2D 섭디/유니티 - POM(ParallaxOcclusionMapping)활용 바닥 크랙 제작방법 금별 2023.01.10 3740
404 언리얼4 언리얼 - 검소환 공격효과 예제 part1 금별 2023.01.10 3212
403 언리얼4 언리얼 나이아가라 - 디졸브 활용 소환수 공격 제작과정 금별 2023.01.10 3674
402 유니티 유니티 VFX 그래프 - 효과적인 데칼 제작 셋업 방법 금별 2023.01.05 5186
401 유니티 유니티 - Creative Damage Decals & VFX 금별 2023.01.05 2865
400 언리얼4 언리얼 - VFExtra TextureMaker Demo 금별 2022.12.29 2713
399 언리얼4 언리얼 - 물 회오리 효과 제작방법 금별 2022.12.25 2960
398 언리얼4 언리얼 - 머트리얼만으로 구성된 트랜지션 효과 예제 및 제작노드 금별 2022.12.23 2975
397 3D 후디니 - 카툰풍 2D 화염 효과 제작방법 금별 2022.12.18 3473
396 언리얼4 언리얼 나이아가라 - 디졸브 엣지에 파티클 생성방법 금별 2022.12.16 2951
395 언리얼4 Baker in Unreal Engine 5.1 Niagara Tutorial | Download Files ashif 2022.12.15 2538
394 유니티 유니티 VFX 그래프 - 리얼한 포털효과 제작방법 금별 2022.12.14 3533
393 유니티 유니티 VFX 그래프 - Kassadin Slash 제작방법 금별 2022.12.14 4116
392 유니티 유니티 쉐이더 그래프 - Gradients 2D Sky Tutorial 금별 2022.12.12 2944
391 언리얼4 언리얼 - Hit 플레어 간단 제작과정 금별 2022.12.11 2909
390 언리얼4 언리얼 - 간단 반구 폭파 간단 제작예제 금별 2022.12.11 3414
389 언리얼4 언리얼 - 디지털 웨이브 간단 제작예제 금별 2022.12.11 3977
388 언리얼4 언리얼 - 광역 마법진 간단 제작예제 금별 2022.12.11 3883
387 3D 3dsmax에서 UV polar coordinate의 불규칙 모델 구현 금별 2022.12.11 3076

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand