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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
1345 언리얼4 Poison Spell AOE in Unreal Engine 5 Niagara ashif 05.17 42
1344 언리얼4 언리얼 - Niagara에서 정적 메시를 사용하여 사용자 지정 파티클 모양 만들기 금별 05.17 57
1343 언리얼4 언리얼 - 포스트 프로세스 2D 페이지 넘김 효과 머트리얼 예제 금별 05.17 43
1342 언리얼4 언리얼 - AI 활용 블랙홀 셰이더를 업그레이드(한글자더빙) 금별 05.17 41
1341 언리얼4 Poison AOE FX in Unreal Engine 5 Niagara ashif 05.16 47
1340 언리얼4 Lightning Trap FX in Unreal Engine 5 Niagara ashif 05.13 67
1339 유니티 유니티 - 호박(Amber) 셰이더 제작과정(한글자막) 금별 05.12 90
1338 언리얼4 언리얼 - HLSL 심층 설명 4_레이마칭 활용 평면정사각형 메시 3D 구체로 변형 금별 05.12 101
1337 언리얼4 언리얼 - HLSL 심층 설명 4 -UV 좌표를 레이어로 반복 쌓아 깊이감 있는 오목볼록 효과 구현(한글자막) 금별 05.06 200
1336 언리얼4 언리얼 - HLSL 심층 설명 3 -큰 원의 궤적을 따라 작은 원 배치효과(한글자막) 금별 05.06 171
1335 언리얼4 언리얼 - HLSL 심층 설명 2 -원형(Circle) 기반 쉐이더를 구현(한글자막) 금별 05.06 160
1334 언리얼4 언리얼 - HLSL 심층 설명 1 - 그라데이션 변화 도구 구현(한글자막) 금별 05.06 188
1333 언리얼4 언리얼 - 03 나이아가라 트레일 매직 매트릭스_1단계 - 스트립 방출 금별 05.04 192
1332 언리얼4 언리얼 - 02 나이아가라 트레일 매직 매트릭스_2단계 -스트립 트리거 매트릭스 금별 05.04 147
1331 언리얼4 언리얼 - 02 나이아가라 트레일 매직 매트릭스_1단계 - 스트립 방출 금별 05.04 165
1330 언리얼4 언리얼 - 01 나이아가라 트레일 매직 매트릭스_2단계 - 스트립 트리거 매트릭스 금별 05.04 156
1329 언리얼4 언리얼 - 01 나이아가라 트레일 매직 매트릭스_1단계 - 스트립 방출 금별 05.04 146
1328 언리얼4 언리얼 - 00 나이아가라 트레일 매직 매트릭스 효과: 초보자를 위한 속성 금별 05.04 218
1327 언리얼4 언리얼 - 유성우 효과 제작과정(한글자막) part3 금별 05.02 210
1326 언리얼4 언리얼 - 유성우 효과 제작과정(한글자막) part2 금별 05.02 146
1325 언리얼4 언리얼 - 유성우 효과 제작과정(한글자막) part1 금별 05.02 179
1324 언리얼4 언리얼 - 나이아가라 파티클 패스 애니메이션 제작팁 금별 04.29 217

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand