Neon Atelier December Progress - Neon Light Shaders
December had been yet another hardworking monthly for our team. While our course on the semester wrapped up as November passed, our early December was still preoccupied by exams and the Phrase 1 report of this project. Fortunate of us, we got half month of winter break after that, giving us time to spearhead on the project's progress.
Our progress of the month centered around the core element of Neon Atelier - the neon light itself. While our earlier implementation for the prototype only play with the shapes and VR interaction of the tube, this time we move on the its shiny visual and more. In order to implement this, we had leveraged Unity's Shade Graph module so that we can implement custom visual materials with the convenient of node-based scripting, as compared to traditional code by HLSL shader writing.
Our neon shader begin with its glassy material. While the basic reflection is already built into Unity's Lit material base, the refraction through to the clear glass tube is craft by reading from the game's frame buffer and shifted it according to the polygon's normal vector of the tube. The lighting on the material is implement with the boolean trigger lit, and the lit-on colors defined via the rawLitCol and the injectedLitCol (the two colors are for before and after neon gas injection, which a topic our future implementation).
One interesting fact about neon light is that its color is often only partially contributed by the neon gas, due to the limited option of such gases. More sophisticated colors are instead formed by overlaying the lighten up gas with fluorescent coating on the tubes' lining. To take this accounted in Neon Atelier, our custom neon shader exposed a set of optional color parameters (hasFluoscent, fluoCol)for defining the fluorescent coating.
We also implement a TorchAtEndShaerController script, which work very similarly to TorchSectionShaderController. However, this script is dedicated for update the torching visual at the welding end of electrodes and neon tube. The automated subdivision generation is irrelevant in this case, and hence stripped down to avoid confusion.