Feb 1, 2018 - Lightsaber Updates

Sparks and hot metal shader

Triggering sparks seemed tricky at first because I thought I would have to spawn them in the OnTriggerEnter *and* OnCollisionEnter methods. This is because the blade switches from collider to trigger depending on its speed. But then I hit a snag in OnCollisionEnter, maybe something to do with the fact that the blade doesn't have a rigidbody on it... What I ended up doing was way easier. I used a Physics.Raycast in the Update loop. I'm firing a ray from the hilt along the blade to the tip, and when it hits a collider it triggers the sparks. There's some logic in there so it doesn't trigger all the time but it's minimal.

Cut surface materials went through multiple phases during the past week.  The latest version has the cut surface emit a glow that starts our yellow and then turns red before it fades out, basically behaving like hot metal.  I've gotten to a point where I think I need to upgrade to some more realistic looking materials.

Here's a closer look at the material from cut to cool down:


Other minor updates:

1) blade colliding with the floor is no longer an issue

2) object pooling for sparks and sound effects

3) tracking of multiple cuts simultaneously by building a dictionary of each trigger event

4) handling of cuts that produced an empty mesh and a full mesh which would result in broken materials

5) balance blade/target mass so there's better interaction- maybe targets are too low because they behave like balsa foam but it's still pretty satisfying to watch them fly around

6) cut objects repel each other after each cut, much more satisfying

7) attempting to handle the rejection of cuts (i.e. if the blade dips in and out of one side of an object it shouldn't cut it) I don't think this is working.

8) sparks have lights - I like this but maybe the sparks should hang around longer in the end it will depend on performance issues

Wish list:

1) Rewrite the "capping" algorithm.  This is a function that fills in the hole left after a cut is performed. I think it produces problematic geometry. I also think it's heavier than it needs to be. I've been looking into Delaunay Triangulation but my head hurts when I do that...

2) Optimize cutting algorithm. The current algo takes too long. It also goes back and flips backward facing tris but I think I can avoid this by rearranging the vertices in the list.

3) Optimize/Manage multiple cuts happening simultaneously. See if scheduling each cut sequentially helps reduce lag and isn't too distracting. Find ways to use an IEnumerator (coroutine) whenever possible.

Anyway, here's the latest video of my progress:



Materials

I've decided to look into solutions for 3d painting textures and I've narrowed my focus on Allegorithmic's Substance Painter for now. I've just started evaluating it. Hopefully I'll have something to show in my next update!



What I'm playing

Serious Sam 3 VR has been pretty fun except now I'm stuck in one area, but I still love it. I'm also still playing Gorn every day. It has become part of my daily workout routine LOL!



What I'm watching 

GDC talk about how they made the "huddle" in the amazing game, Inside. Don't watch this or google it unless you want the game spoiled for you. You should play Inside if you haven't already.

I waited a full year for this video to come out. These guys are mad geniuses!




Off Topic:

Finally! One of the feature films I worked on has been nominated for an Academy Award! 



Comments

Popular Posts