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



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

금별 0 1,710 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


번호 포토 분류 제목 글쓴이 날짜 조회
235 언리얼4 언리얼4 컴파일링 벤치마크 8코어 vs 16코어 CPU[Unreal Engine 4.25.4] 금별 2020.10.27 1539
234 언리얼4 언리얼5 - 아틀라스 마스터 머티리얼을 만드는 방법 금별 2022.12.06 1545
233 유니티 유니티 VFX 그래프 - 효과적인 데칼 제작 셋업 방법 금별 2023.01.05 1550
232 유니티 유니티 쉐이더 그래프 - Orthographic 뎁스 금별 2020.03.26 1551
231 유니티 유니티 쉐이더 그래프 - 흐르는 강 쉐이더 튜토리얼 금별 2021.04.27 1551
230 언리얼4 [GDC]Stylized Games을 위한 VFX 아트 디렉팅 금별 2020.01.20 1552
229 유니티 유니티 - 검기 이펙트 기본부터 캐릭터에 붙이는 전체제작과정(중국어버젼) 금별 2021.12.12 1563
228 언리얼4 언리얼 - 광역 마법진 간단 제작예제 금별 2022.12.11 1569
227 언리얼4 언리얼 - 동양풍 태극권 아우라 발산 제작과정(중국어) 금별 2022.06.26 1569
226 언리얼4 언리얼4 머터리얼 팁 - 머터리얼만으로 트위스트 구현하기 금별 2020.03.26 1572
225 일반 Optimizing UE4 for Fortnite: Battle Royale - Part 1 댓글+1 insaneoops 2018.05.10 1576
224 2D 포토샵 - 간단 불 시퀀스 제작방법 금별 2023.04.08 1577
223 언리얼4 언리얼4 머터리얼 튜토리얼 - 수학을 활용한 쉐입형태 제작 금별 2020.02.04 1580
222 2D 이펙트 이미터별 요소 영어용어정리 댓글+1 금별 2022.09.15 1588
221 언리얼4 언리얼4 머터리얼 튜토 - 플립북 모션벡터의 비대칭 RowCollumn 카운트 수정 금별 2020.03.19 1588
220 언리얼4 언리얼4 머터리얼 팁 - 루핑되는 액체 메쉬 머터리얼 만들기 금별 2020.02.28 1592
219 언리얼4 언리얼 - 디졸브 머트리얼 노드 예제 금별 2022.02.17 1595
218 3D Visual Effects Bootcamp: The Rise of Realtime 금별 2020.03.26 1599
217 언리얼 언리얼4 - Unifrom Circle Spawner Tutorial 금별 2019.01.14 1605
216 유니티 유니티 앰플리파이 쉐이더 - 용해화 스타일 하프톤 쉐이더 제작방법(중국어) 금별 2022.08.23 1609
215 2D [간단팁]라이트닝 효과 제작원리 금별 2022.09.03 1612
214 언리얼4 언리얼4 튜토리얼 - Explosions for Games (UE4 Particle Tutorial) 금별 2020.01.20 1614

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand