Byron has been on holiday for two weeks. He’s back and he helped me get my shadows back! Thank you, Byron! I gave him a batch of my nearly-toxically-hot chili, which he loved! I figure it’s a fair exchange of expertise.
Turned out it was some kind of bug in how Unity stores and handles what are called “prefabs.” Prefabs are objects that can contain all kinds of features and programming that can be saved and re-used. Each slab in my scene is an instance (or copy) of a prefab; they’ve each had its color and size tweaked when it first appears, but they’re all spawned from one master prefab. As I mentioned in the last blog post, there are two different kinds of material I’ve been working with – one that is opaque and can cast shadows, and one that allows for transparency but can’t cast shadows. Well, the prefab has an opaque material, but as soon as an instance appears in the scene, the material has changed to the transparent one. There wasn’t any programming that was causing that switch to happen, so for a short while I was flummoxed. Then while the game wasn’t running, I manually added a copy of a prefab into the scene, and lo and behold, it was transparent! So I just changed it back to opaque and changed this instance into a new prefab in place of the old one. Bug, not a feature. Anyway, here it is in all its shadowy glory:
The other thing I did was add two lights with different shadow intensities, and rotated them in opposite directions. So you get this interplay of multiple shadows of multiple densities playing off the surfaces of each slab. And below is my inspiration for this effect, from the title sequence from “Skyfall:”
Eventually the scene will change direction, both conceptually and literally. In preparation for this, I started playing with changing a set of colors – the background color, the color of the ambient light, and the color of the background fog. All three change simultaneously, and the actual change will be very slow, but for the purposes of prototyping and experimentation, I’ve shortened the duration:
I’m very close to finishing this part of the sequence, and I’m feeling really excited. Today was a productive day, and I hope to get a lot more done before the week is over, since I will be suspending production while the family is in town. Next up… sound!
No music this time as I was working next to Byron all day and we were just cracking jokes and showing each other stupid Twitter memes. But Byron is working on an awesome procedural music system for his game, which he has very generously offered to let me use on this project. Early results for his work on this have been extremely promising and fun, and I’d be a fool not to accept his offer!