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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
402 유니티 유니티 VFX 그래프 - 효과적인 데칼 제작 셋업 방법 금별 2023.01.05 5119
401 유니티 유니티 - Creative Damage Decals & VFX 금별 2023.01.05 2826
400 언리얼4 언리얼 - VFExtra TextureMaker Demo 금별 2022.12.29 2670
399 언리얼4 언리얼 - 물 회오리 효과 제작방법 금별 2022.12.25 2925
398 언리얼4 언리얼 - 머트리얼만으로 구성된 트랜지션 효과 예제 및 제작노드 금별 2022.12.23 2944
397 3D 후디니 - 카툰풍 2D 화염 효과 제작방법 금별 2022.12.18 3448
396 언리얼4 언리얼 나이아가라 - 디졸브 엣지에 파티클 생성방법 금별 2022.12.16 2905
395 언리얼4 Baker in Unreal Engine 5.1 Niagara Tutorial | Download Files ashif 2022.12.15 2507
394 유니티 유니티 VFX 그래프 - 리얼한 포털효과 제작방법 금별 2022.12.14 3490
393 유니티 유니티 VFX 그래프 - Kassadin Slash 제작방법 금별 2022.12.14 4051
392 유니티 유니티 쉐이더 그래프 - Gradients 2D Sky Tutorial 금별 2022.12.12 2894
391 언리얼4 언리얼 - Hit 플레어 간단 제작과정 금별 2022.12.11 2878
390 언리얼4 언리얼 - 간단 반구 폭파 간단 제작예제 금별 2022.12.11 3363
389 언리얼4 언리얼 - 디지털 웨이브 간단 제작예제 금별 2022.12.11 3924
388 언리얼4 언리얼 - 광역 마법진 간단 제작예제 금별 2022.12.11 3847
387 3D 3dsmax에서 UV polar coordinate의 불규칙 모델 구현 금별 2022.12.11 3051
386 언리얼4 언리얼 - 저렴한 포그 제작방법[Depth-mask post process] 금별 2022.12.10 2500
385 유니티 슬래밍 AoE를 만드는 방법 - CGM Summer 22 금별 2022.12.07 2960
384 언리얼4 언리얼5 - 폴더에서 특정폴더/파일삭제후 성능을 즉시 향상시키는 방법 금별 2022.12.06 2571
383 언리얼4 언리얼5 - 아틀라스 마스터 머티리얼을 만드는 방법 금별 2022.12.06 5044
382 언리얼4 언리얼5 - 텍스쳐 메모리 절약팁(블루 채널 사용 간소화) 금별 2022.12.06 4112
381 언리얼4 언리얼5 퍼포먼스절약 팁 - 알파채널 사용X 금별 2022.12.06 2304

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand