Researching on neon light tube bending for Neon Atelier
Our VR project Neon Atelier aims at faithfully present neon light craftmanship in a safe, virtual environment. One crucial procedure in neon light making is about bending torched glass tubes into desired shapes. Such malleability of glasswork really challenges our vision about 'a faithfully representation.
Our initial attempt for a virtual tube implementation is to rely on Bezier curve, with its capability to represent curves in a mathematical way. We thought about an implementation that begins a glass tube as straight line, adding nodes to it as it collides with the collider flames, plus allowing it to bended into the desire shape.
However, it was not long before we were halted by an inconvenient nature of Bezier curves - its length cannot be calculated mathematically. (A Primer on Bézier Curves, n.d.) The best we can get is a rough estimation by marching through curves step by step. This fundamentally challenged our expectation to maintain Bezier-based tube's length as player bend it. That is requires us to first get the curve's length, then adjust the nodes of the bended section to fit the tube's length. We have no idea how our Quest 3 could withstand such extortion, if we are to march through tube from head to toe for every frames of hands motion plus with every probing in node adjustment. We simply will not gamble on it.
We then spent a bit of time search for replacement. The Joint component in Unity is simply unstable for the job. An simulation system at molecular level is way beyond our math and physics knowledge (and probable also the capability of Quest 3). With these in mind, we considered to take step backward - an full-fledge free form glass tube simulation is obviously beyond our capability.
From that point on, we began to reimagine Neon Atelier's light tube bending as a step by step progress instead of free forming sandbox. Our light tube will now be implemented with a predefined sets of bending section, with animation transition one after one. The player will perform the each bending step as hinting by the game. When the player's grip angle get approximate an predefine range, the tube will be snap to the position and proceed to next crafting step. That says, instead of taking it as kneading a dough, we now think the light tube bending part more similar to Cooking Mama instead.
The implementation of this new approach is leaning more to the 3D modeling side because of the predefined transition animations. Our light tube is now constructed with array of section following the shape of a reference spline object (Array modifier and Bend modifier in Blender). For each of the bending step, we use a Shape Key to store to the tube shape. The animation of bending will then be presented by interpolating between consecutive Shape Keys (the terminology of this is called blending shape animation).
This also requires us to have a bit of extra implementation on the Unity side, as its native Blend Shape feature simply mix up all the Shape Keys together, lacking to the step by step transition that we want. With our custom components, each Shape Keys could now proceed accordingly and is ready to for our upcoming game logic to bind to.
While our Neon Atelier project is still at a very early stage, it has already been quite a journey for us. The transition from free form editing to step by step guidance is not smaller matter to us. We will keep our best effort to faithfully present the neon light making process.
We are looking forward to release more updates soon.🙂
_
Reference: