April 4, 2018
This will be the first time I’m writing about Trapped In Bleak Manor on this blog rather than the one I keep for school, although the game itself is well on its way in terms of art and development. We only have a few weeks left until we’re out of our production stages. It’s a VR experience escape room, which two of us pitched back in January. I’d been wanting to work on a VR game for a while (since we’d bought our headset), so this seemed like a good opportunity to start.
My most recent issues in Unity was with glass materials and their opacity. Transparency in Substance Painter is pretty straight-forward and the 3D modellers/texturers know exactly what they’re expecting to see. However, in Unity the textures don’t always look like that. I spent hours looking into the issues on this topic and I know that I’m not alone in my confusion. While it seems like a lot of people simply download a material package from the Unity store, I wanted to see if their was an in-engine solution I could use instead.
There are two objects in the game that have glass, so I tried a different solution for each one. Eventually I’d like to actually write my own shader for these, but the modellers knew in advance to set up their models a certain way so I could access the meshes that needed glass materials.
In the first instance, on the cabinet, I tried out a standard fade setup on the shader:
I could then adjust the smoothness on the metallic alpha for how reflective we wanted the glass (not extremely). I also wanted to have a slight blue tint to the glass (adjusted on the albedo) to match what the 3D modeller had shown in Substance Painter.
On the lamp, I tried out one of the legacy shaders to keep the dirt really visible:
With the transparent diffuse shader, I could adjust the render queue so it would be on the transparent pass and be rendered before the opaque materials. This was really important in this fix, otherwise the material just wouldn’t show up correctly during gameplay.
As a result, you can see the transparency works fine. However, it would be good to further understand why the team’s textures don’t transfer very well from Substance to Unity.
In other news, I’m also learning more about particle systems during this project. Having made a little flame particle system for the lamp, I then had to look into constraining the system to remain within the glass.
I’ve not worked a ton with the intricacies of particle systems, so it was the first time I looked into the kill-outside-trigger option. Using a capsule collider within the lamp glass, I could kill any particles that went outside it.
A very simple solution for something that worked really well on an object like this; I’ve found, while working on this project, I have to approach gameplay a lot differently that I normally would. In many games, the lamp wouldn’t be able to rotate around while being held. In VR, that’s obviously different, since the player can manipulate the object any way they want.
I’d like to continue to improve this little particle system as practice more than anything else, but so far I’ve received positive feedback about the way the lamp (and thus the particles and lighting that go with it) works in the game.