|
SoulBlade
|
 |
« Reply #780 on: June 11, 2012, 04:40:32 PM » |
|
Update: more experiments with lighting, this time i'm recording the direction the light comes from so i can attentuate light that travels around corners more.  Hey man, I really like the work you're doing. I was just messing with lighting on my own game; you might benefit from what I was doing. I remember you saying you're using SFML; I am as well. For dealing with the shadows on the tiles, what I did was create a shadow render texture based on the tile world on screen. So...I'm not sure how you're managing your tiles, but if you use a single render texture for them, you could put the texture onto a sprite, recolor the sprite to black, and draw it to a new shadow render texture. Apply a radial blur shader to it, and it creates a convincing "gradiant" effect that I think you're looking for. If you want to get it more blocky, apply a shadow that pixelates the shadows and it would produce the same effect you're making there, very, very, very fast and without storage in individual tiles. Not sure what your method is, but I'm sure it works really well, too. Just thought I'd help out a little -- really like your style  .
|
|
|
|
|
Logged
|
|
|
|
|
eigenbom
|
 |
« Reply #781 on: June 11, 2012, 04:52:04 PM » |
|
hey soulblade, thx for the tip. how does your method cope with very large worlds? and if it's just image-based lighting, how do you factor in lighting that comes in from off-screen?
|
|
|
|
|
Logged
|
|
|
|
|
SoulBlade
|
 |
« Reply #782 on: June 11, 2012, 05:11:44 PM » |
|
hey soulblade, thx for the tip. how does your method cope with very large worlds? and if it's just image-based lighting, how do you factor in lighting that comes in from off-screen?
Well my world is infinitely-sized and it works really well. It's updated every frame using the same image that the tiles use. So, for lighting the comes in from off-screen, all you need to do is manage a "null map" (I'm sure it has a real name, I just made that up). The null map is all white, and where there are holes, you make that part transparent. You multiply this map against the shadow map, and it creates holes in the shadow map that you can see through. This can be done pretty easily using the SFML blend mode MULT. If you manage the null map properly, you can create all the lighting holes in the shadow map you need from offscreen and on screen sources.
|
|
|
|
|
Logged
|
|
|
|
|
eigenbom
|
 |
« Reply #783 on: June 11, 2012, 05:18:27 PM » |
|
well it sounds cool, but i'm not quite following you. in any case, do you have any screenshots of it in action? cheers 
|
|
|
|
|
Logged
|
|
|
|
|
eigenbom
|
 |
« Reply #784 on: June 11, 2012, 05:39:25 PM » |
|
Rage, rage against the dying of the light. 
|
|
|
|
|
Logged
|
|
|
|
|
SoulBlade
|
 |
« Reply #785 on: June 11, 2012, 05:41:40 PM » |
|
well it sounds cool, but i'm not quite following you. in any case, do you have any screenshots of it in action? cheers  Yeah, click on my signature bunny link. First video is the lighting I'm talking about in action, but it has many more elements then what I was talking about here going on. With some shader coding it can be changed to work for lots of scenarios pretty well. If you like the effect I could try to explain it a little more thoroughly.
|
|
|
|
|
Logged
|
|
|
|
|
eigenbom
|
 |
« Reply #786 on: June 11, 2012, 05:46:49 PM » |
|
well it sounds cool, but i'm not quite following you. in any case, do you have any screenshots of it in action? cheers  Yeah, click on my signature bunny link. First video is the lighting I'm talking about in action, but it has many more elements then what I was talking about here going on. With some shader coding it can be changed to work for lots of scenarios pretty well. If you like the effect I could try to explain it a little more thoroughly. aw nu, i've got signatures turned off. guess its time for them to come back. cheers, i'll check out the links. 
|
|
|
|
|
Logged
|
|
|
|
|
eigenbom
|
 |
« Reply #787 on: June 12, 2012, 12:02:53 AM » |
|
Update: More lighting work, I've split the algorithm up into a number of passes, so it first performs light propagation within the 16x16 subchunks, then light is diffused between subchunks and another propagation step is done. Still a few bugs to iron out.. this stuff is doing my head in.  The good thing is is that it will be generated on demand, and will only be recomputed (locally) if blocks are changed.  Also, I'm on hiatus for 2 weeks, holiday time... 
|
|
|
|
|
Logged
|
|
|
|
|
SoulBlade
|
 |
« Reply #788 on: June 12, 2012, 12:33:53 AM » |
|
Looks great, looking forward to seeing it in action.
|
|
|
|
|
Logged
|
|
|
|
|
peous
|
 |
« Reply #789 on: June 12, 2012, 05:47:57 AM » |
|
looks promising! maybe some materials would let the light pass more than others ?
|
|
|
|
|
Logged
|
|
|
|
|
eigenbom
|
 |
« Reply #790 on: June 12, 2012, 07:03:46 PM » |
|
Update: the light algorithm seems to work alright now, although i'm sure there's some more edge cases i haven't stumbled upon, and I have no iea about its performance. I'm also doing a final blur pass which removes some of the awful artifacts..  And I'm not sure whether posterising it is still the way to go, but I'll have to wait until its all composited together to see how it'll look.. 
|
|
|
|
|
Logged
|
|
|
|
|
eigenbom
|
 |
« Reply #791 on: June 12, 2012, 09:37:16 PM » |
|
more tweakage 
|
|
|
|
|
Logged
|
|
|
|
|
BlueSweatshirt
|
 |
« Reply #792 on: June 12, 2012, 10:00:57 PM » |
|
Stop tweaking! You... you junkie!
That looks really great
|
|
|
|
|
Logged
|
|
|
|
|
eigenbom
|
 |
« Reply #793 on: June 12, 2012, 10:30:54 PM » |
|
I started a new art topic over here to discuss the lighting and terrain. Fly there now and see pics! @jack (in garth's voice) i like to tweak 
|
|
|
|
|
Logged
|
|
|
|
|
DustyDrake
|
 |
« Reply #794 on: June 13, 2012, 08:04:14 AM » |
|
more tweakage  Yes. That looks beautiful and amazing
|
|
|
|
|
Logged
|
|
|
|
|