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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
1277 언리얼4 Niagara VFX in UE5 Widget UI WITHOUT Plugins! (Quick & Easy Method) ????️✨???? ashif 12.13 9
1276 언리얼4 Isometric Level Up Aura VFX in UE5 Niagara! (Rainbow Tube, Stars & Upward Flow Tutorial) ????⬆️✨ ashif 12.12 15
1275 언리얼4 Celestial Beam VFX in UE5 Niagara! (Rays, Dissolving Ring & Curl Noise) ????✨⬇️ ashif 12.11 27
1274 2D 섭스턴스 디자인 - 움푹 파인 바닥 절차적 제작과정(한글자막) 금별 12.10 48
1273 언리얼4 언리얼 - Stylized 파도/물보라 제작과정 part3(한글자막) 금별 12.10 47
1272 언리얼4 언리얼 - Stylized 파도/물보라 제작과정 part2(한글자막) 금별 12.10 32
1271 언리얼4 언리얼 - Stylized 파도/물보라 제작과정 part1(한글자막) 금별 12.10 40
1270 언리얼4 언리얼 - 나이아가라 나선형 파티클 구현 과정 금별 12.04 97
1269 언리얼4 Create a Bubble Shield VFX in UE5 Niagara! (Character Defense & Multi-Layer Bubbles) ????️ ashif 12.02 113
1268 언리얼4 언리얼 - 흡입형 화면이 빨려들어가는 느낌 스크린 이펙트 제작과정(한글자막) 금별 12.02 145
1267 언리얼4 언리얼 - 물결무늬 에너지 실드 소재 제작과정(한글자막) 금별 12.02 121
1266 2D 포토샵 - 빛 효과 텍스쳐 간단 제작방법팁 금별 12.02 121
1265 3D 후디니 - COP 활용한 검기 텍스쳐 생성 과정(한글자막) 금별 11.24 199
1264 유니티 유니티 - ASE 활용 포털 조각 분리 및 트위스트 애니메이션 제작과정(한글자막) 금별 11.24 192
1263 언리얼4 언리얼 - 나이아가라 파티클 위치 및 곡선(Arc) 제어과정 금별 11.24 206
1262 언리얼4 언리얼5 - 나이아가라 객체 회전 예제 금별 11.24 188
1261 유니티 유니티 - (퀵팁) 간단한 파티클 orbit 움직임제어팁 금별 11.20 195
1260 언리얼4 Create a Multi-Layer Ribbon Trail VFX in UE5 Niagara! (Advanced Color & Edge Material) ????〰️✨ ashif 11.18 141
1259 언리얼4 언리얼5.7기준 - 나이아가라의 확장성 및 모범 사례 금별 11.17 222
1258 언리얼4 언리얼 - Niagara로 스플라인을 따라 발사되는 파티클 제작하기 금별 11.17 202
1257 언리얼4 언리얼5 - 오브젝트를 풍경에 혼합하기: 런타임 가상 텍스처 사용법 금별 11.17 214
1256 언리얼4 언리얼5 - 동적 SubUV 데칼(Decal) 제작하기 금별 11.17 180

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand