I’m thinking about making a stealth game, similar to the old classic Thief games from Looking Glass Studios, where light falling on the character determens how visible you are. I’ve looked around on the internet and the forums and most people suggest that it is not worth the computation time and that using Colliders and “Shadow Volumes” instead is a better way of doing it. But I want to have dynamic lights like guards walking around with tourches and stuff like that.
So I was thinking. Isn’t there a way to store the light information from Unity (Direct and Indirect Illumination) in the vertices of the character mesh as vertex colours, and then calculate the average Light Level of the character? I mean, the lighting information is allready there for the rendering and a shader dealing with vertex colours should be pretty fast (especially on PC/consoles), right? To improve performance perhaps a low poly proxy mesh for the character could be used instead, and perhaps using multiple meshes for different body parts to determin if only certain body parts are in light or shadow.
What do you think? I’m a beginner programmer with some intermediet knowledge of C# and basic knowleadge of shaders, so please keep the discussion on a not too technical level. I’m not currently looking for a specific solution, but rather tips, ideas and inspiration for me to play around with this concept in an effort to learn more about game development in Unity - I like a challange!
If you feel inspired and want to test this out yourself, feel free to do so, and please share your results and experience with it.
So for one thing, a more concrete question, how do I get the lighting information from the renderer and store it as vertex colours in my character mesh?
Feel free to add your own thoughts and ideas on the subject matter, let’s have a creative discussion!
Thanks!