OblivionSkull21
Member
Sorry if this seems like it belongs in the Advanced Programming section.
I have a concept that I'm wanting to try to accomplish, but I'm lost on how to do it.
I currently have a day/night cycle that involves a black "darkness" moving across the screen from left to right to represent sunrise/sunset and covering the room in darkness to simulate "night time".
When the darkness reaches the light source, the light's glow gradually gets drawn from left to the right, following the movement of the darkness until the whole glow is visible, like so:
I am using a surface and some very complex code to do all this. Right now I have it so that the player is subtracted from the surface and not covered by darkness at any point, though I think I want to get rid of that.
What I would like is for the player to only get light if they approach a light source, but I want that light source to change the player's color. For example, if they're standing next to the orange glow, I would want the glow to be drawn on top of them. This is all fine and dandy, because all I have to do is get rid of the player's subtraction from the surface and voila, the glow is covering the player, like so:
HOWEVER, to be more realistic, I don't want the glow to effect the player unless they are behind/above the light, or any part of their body is visibly facing the light. What I mean is, I wouldn't want the player's back to turn orange because their back isn't facing the light, their front is... make sense?
So, I wouldn't want something like this:
The problem is, I have no idea how to accomplish this. All the glows and the darkness are drawn on one surface, with the actual light source (the fire) being subtracted (cut out) from that surface. I guess I would want the player to be subtracted as well, but only if they're in the glow and behind the light source, as I would still want the darkness to cover them elsewhere.
What are your ideas? Perhaps I could try separating the glows and the darkness into two surfaces and just subtract the player from the glow surface, only if they're behind it?? But I'm not sure...
OR, a bigger question... am I being too nitpicky with the realism? Does this whole issue really matter????
I have a concept that I'm wanting to try to accomplish, but I'm lost on how to do it.
I currently have a day/night cycle that involves a black "darkness" moving across the screen from left to right to represent sunrise/sunset and covering the room in darkness to simulate "night time".
When the darkness reaches the light source, the light's glow gradually gets drawn from left to the right, following the movement of the darkness until the whole glow is visible, like so:
What I would like is for the player to only get light if they approach a light source, but I want that light source to change the player's color. For example, if they're standing next to the orange glow, I would want the glow to be drawn on top of them. This is all fine and dandy, because all I have to do is get rid of the player's subtraction from the surface and voila, the glow is covering the player, like so:
So, I wouldn't want something like this:
What are your ideas? Perhaps I could try separating the glows and the darkness into two surfaces and just subtract the player from the glow surface, only if they're behind it?? But I'm not sure...
OR, a bigger question... am I being too nitpicky with the realism? Does this whole issue really matter????