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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
56 유니티 유니티 쉐이더 그래프 - 꼬여지는듯한 착각의 쉐이더 금별 2020.03.19 1845
55 유니티 유니티 - 마스크 디스토션 림 쉐이더그래프 금별 2020.03.05 3204
54 유니티 유니티 이펙트 팁 - RzFX Flow Trail in Unity 금별 2020.02.27 3882
53 유니티 Converting some code shaders to ShaderGraph 댓글+3 금별 2020.02.27 1297
52 유니티 기적의 셰이더 그래프 '어떤 노드든 이해시켜 드립니다 금별 2020.02.18 2918
51 유니티 유니티 셰이더&렌더링 에센스(retr0) 금별 2020.02.16 1438
50 유니티 유니티 이펙트 팁 - 아주 간단히 보는 포털제작팁 댓글+1 금별 2020.02.10 1785
49 유니티 유니티 - Custom Vertex Stream and Shadergraph/Amplify Shader 금별 2019.12.29 5610
48 유니티 유니티 쉐이더 팁 - Rime 스타일의 폭포 제작 댓글+2 금별 2019.11.26 3720
47 유니티 유니티 이펙트 팁 - 데스스트랜딩 홀로그램 효과 참고해 만들기 금별 2019.11.19 3036
46 유니티 유니티 - 스타게이트 효과 참고영상 금별 2019.10.29 3599
45 유니티 유니티 - 2d Raymarched Smoke 댓글+5 금별 2019.10.26 1555
44 유니티 유니티 이펙트 팁 - 포털제작 금별 2019.10.19 4886
43 유니티 유니티 - 포탈이펙트 예제와 제작과정 금별 2019.09.09 5847
42 유니티 유니티 - Stylized 폭포 제작하기 금별 2019.09.07 8531
41 유니티 유니티 - 원통형 메쉬에 토네이도형 uv 흐름제어 금별 2019.08.30 1804
40 유니티 유니티 이펙트 제작과정 - 사슬로 감싼 폭발형태 제작 금별 2019.08.30 4773
39 유니티 마법적 구슬형태 제작 금별 2019.08.30 1938
열람중 유니티 유니티 버텍스 옵셋 효과 예제 Juane Gray 금별 2019.08.20 1661
37 유니티 Skeleton Mage Summon With Shaders and Textures 금별 2019.08.20 1357
36 유니티 유니티 쉐이더 - 쉐이더그래프/앰플리파이 쉐이더에서의 커스터 버택스 스트림 사용 금별 2019.08.20 5176
35 유니티 유니티 쉐이더 그래프 - Weaving Ring Tutorial 2 댓글+1 금별 2019.08.12 1629

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand