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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
1339 언리얼4 Ice Powerup Aura FX in Unreal Engine 5 Niagara ashif 05.05 14
1338 언리얼4 Horror scene FX in Unreal Engine 5 Niagara ashif 05.04 29
1337 언리얼4 언리얼 - 03 나이아가라 트레일 매직 매트릭스_1단계 - 스트립 방출 금별 05.04 49
1336 언리얼4 언리얼 - 02 나이아가라 트레일 매직 매트릭스_2단계 -스트립 트리거 매트릭스 금별 05.04 37
1335 언리얼4 언리얼 - 02 나이아가라 트레일 매직 매트릭스_1단계 - 스트립 방출 금별 05.04 40
1334 언리얼4 언리얼 - 01 나이아가라 트레일 매직 매트릭스_2단계 - 스트립 트리거 매트릭스 금별 05.04 41
1333 언리얼4 언리얼 - 01 나이아가라 트레일 매직 매트릭스_1단계 - 스트립 방출 금별 05.04 43
1332 언리얼4 언리얼 - 00 나이아가라 트레일 매직 매트릭스 효과: 초보자를 위한 속성 금별 05.04 38
1331 언리얼4 Heal Potion FX in Unreal Engine 5 Niagara ashif 05.03 69
1330 언리얼4 Heal Dome Shield FX in Unreal Engine 5 Niagara ashif 05.03 63
1329 언리얼4 언리얼 - 유성우 효과 제작과정(한글자막) part3 금별 05.02 82
1328 언리얼4 언리얼 - 유성우 효과 제작과정(한글자막) part2 금별 05.02 69
1327 언리얼4 언리얼 - 유성우 효과 제작과정(한글자막) part1 금별 05.02 74
1326 언리얼4 언리얼 - 나이아가라 파티클 패스 애니메이션 제작팁 금별 04.29 113
1325 언리얼4 【UE5+Houdini】리듬 댄스 이페트 제작과정 파트 2 금별 04.29 94
1324 언리얼4 【UE5+Houdini】리듬 댄스 이페트 제작과정 파트 1 금별 04.29 91
1323 언리얼4 Gilded Aura FX in Unreal Engine 5 Niagara ashif 04.28 89
1322 언리얼4 Floating Rocks FX in Unreal Engine 5 Niagara ashif 04.26 116
1321 언리얼4 【UE5】거품 재질 만드는 법 금별 04.25 192
1320 언리얼4 【UE5】래디얼 블러를 구현하자! -Niagara 편- 금별 04.25 179
1319 언리얼4 【UE5】래디얼 블러를 적용해 보자! -Sequencer 편- 금별 04.25 154
1318 언리얼4 【UE5】래디얼 블러를 만들어 보자! -준비 편- 금별 04.25 169

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand