Shadow(s) once more..
I've said earlier, I do have shadows already but only cast from one light source. I'm gonna need some more of them lights in this game!
A few days ago I've started to see what I could come up with; it took me some days and today I've made two lights casting two shadows for each object but it was expensive, too expensive that it hurts.
My game's frame rate per second is ordinary somewhere around 98-100 FPS but when I implemented the second shadow casting light source (spot light) it dropped down to 60-67 FPS! That I can't tolerate so I will have to find a better way than what I've been working on this far.
What I'm doing now is; I'm rendering my 3D scene to a back buffer 'Shadow Map' from the light's view, one for each light and then merging them together to one Shadow Map that is sent to the Shader to calculate the shadows for the scene and all of its objects.
From the beginning I only had one light source, now I have two and that made a huge impact because the drop in FPS.
Now I'm working on a new approach; I'm going to try to render all lights at the same time from within the Shader to generate only one Shadow Map, several lights (starting with two) spotlights at the same time dynamically by using math.. and.. my head. Oh Lord, help me Jesus my brain is going to hurt again, I love it.
Wish me luck and I'll be back for more storys to tell
'No image this time, try to fit one next time'.
Kommentarer
Skicka en kommentar