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



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

금별 0 263 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.

 

994E824B5D5C011E16BD68

 

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!

 

99957B4B5D5C01221418B7

 

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:

 

9950E64B5D5C0126166CBC

 

 

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


번호 포토 분류 제목 글쓴이 날짜 조회
공지 외국 교육 이펙트 튜토리얼 모음(사이트/유튜브/비메오등등..) 댓글+4 금별 2018.05.12 1637
공지 이펙트 추천 사이트/블로그 댓글+5 금별 2018.05.12 2483
188 언리얼4 Plexus effect with Particle Attribute Reader | Unreal Engine Niagara Tutorials | UE4 Niagara Plexus ashif 05.26 11
187 언리얼4 Fish Flock | Unreal engine 4.25 Niagara tutorial | UE4 Niagara Particle Attribute Reader ashif 05.23 17
186 언리얼4 UE4 Niagara Sci fi Tank ashif 05.21 26
185 언리얼4 UE4.25 Niagara Effects Pack 05 in Martketplace ashif 05.20 24
184 언리얼4 Portal Effect in Unreal Engine 4 inspired from Unreal Engine 5 Portal | UE4 Niagara Portal ashif 05.19 43
183 언리얼4 Birds Flock | Unreal Engine Niagara Tutorials | UE4 Niagara Bird Flock ashif 05.18 27
182 언리얼4 Unreal Engine Niagara Tutorials ashif 05.17 26
181 유니티 유니티 - 기어즈5 Hammer of Dawn 이펙트 만들기 금별 05.16 60
180 유니티 포토샵으로 디졸브 쉐이더를 사용해 2D 툰이펙트 제작팁 댓글+1 금별 05.16 114
179 언리얼4 Snowfall Scene | Unreal Engine Niagara Tutorials | UE4 Niagara Snowfall ashif 05.16 24
178 언리얼4 Rotate Vector & Sine |Unreal Engine Niagara Tutorials | UE4 Niagara Rotate Vector and Sine ashif 05.15 20
177 언리얼4 Insect Flock in UE4 Niagara | Inspired From UE5 Demo ashif 05.14 21
176 언리얼4 Magical Lamp and Genie Effect | Unreal Engine Niagara Tutorials | UE4 Niagara magical Lamp Genie ashif 05.13 29
175 언리얼4 Cannon Shot Effect | Unreal Engine Niagara Tutorials | UE4 Niagara Cannon Shot ashif 05.10 63
174 언리얼4 Lightning Creature Effect | Unreal Engine Niagara Tutorial | UE4 Niagara Lightning ashif 05.07 67
173 언리얼4 Fire Creature Effect | Unreal Engine Niagara Tutorial | UE4 Niagara Fire ashif 05.04 71
172 언리얼4 Volumetric Sky Quick Review in Unreal Engine 4.25 ashif 05.01 50
171 언리얼4 Egg Burst Effect | Unreal Engine Niagara Tutorial | UE4 Niagara Egg Explode ashif 04.30 54
170 언리얼4 Custom Attractor Force | Unreal Engine Niagara Tutorial | UE4 Niagara Custom Force ashif 04.27 49
169 언리얼4 Mesh Particle Flow | Unreal Engine Niagara Tutorial | UE4 Niagara Mesh Particle Flow ashif 04.25 58
168 언리얼4 Hearthstone Effect Tutorial | Unreal Engine Niagara Tutorial | UE4 Niagara Hearthstone Effect ashif 04.21 64
167 언리얼4 Toon Muzzle Flash and Bullet Hit Impact | Unreal Engine Niagara Tutorial | UE4 Niagara Muzzle ashif 04.18 76


Banner
Facebook Twitter GooglePlus KakaoStory NaverBand