View previous topic :: View next topic |
Author |
Message |
danjo Member
Joined: 20 Sep 2007 Posts: 21
|
Posted: Sat Nov 03, 2007 2:30 am Post subject: cant seem to get this lightmap to work.. |
|
|
for some reason it wont soften the edges/fade out.
the settings i have:
would this be because its not a very big area/model?
(that lit section is 40units x 40units)
[edit]
as a workaround, i ended up making multiple lights for the source, 1 with low intensity and larger range with another with higher intensity and smaller range. |
|
Back to top |
|
|
danjo Member
Joined: 20 Sep 2007 Posts: 21
|
Posted: Sat Nov 03, 2007 5:12 am Post subject: |
|
|
this is the final ingame look..
|
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Sat Nov 03, 2007 6:16 am Post subject: |
|
|
That's because DeleD uses OpenGL's lighting arguments for REALTIME lights, and then mixes it with a hard cutoff. Normally, your light would falloff properly from the start point, to the cutoff limit.
As you can see in your settings dialog, by the time you get to your 50 unit cut off point, the light itself is still at around 80% of it's total brightness.
You will have to play with the quadric attenuation value, and the range, until you can get something that appears to fall off right around the range, but it will never be perfect, and you will mostly always have a hard light edge, unfortunately.
edit This is what I mean by making a proper attenuation to fit your light.
_________________
|
|
Back to top |
|
|
danjo Member
Joined: 20 Sep 2007 Posts: 21
|
Posted: Sat Nov 03, 2007 10:24 am Post subject: |
|
|
ah - that makes sense. ty |
|
Back to top |
|
|
Mr.Fletcher DeleD PRO user
Joined: 07 Aug 2004 Posts: 1772 Location: Germany
|
Posted: Sat Nov 03, 2007 11:03 am Post subject: |
|
|
That looks like an interesting game, could you present it briefly in the user projects forum? _________________ Behold! The DeleD Wiki! Please help us expanding it
DeleD on IRC |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sun Nov 04, 2007 8:59 am Post subject: |
|
|
Yeah, that game looks great! We want to know all about it!
To expand a little on Daaark's great explanation, the 'range' parameter is indeed a little confusing. At first, we only had the OpenGL lighting formula, then we added the range as a way of optimizing the lighting of a map with a lot of lights: any light beyond the range is simply disregarded. So it's not really a lighting parameter, and it should always be kept at a fairly bigger number than any distance you would ever have the light shine, because it cuts it off abruptly and ugly.
This turned out to be a rather poor design decision, as the OpenGL attenuation parameters are not very intuitive, people see a range parameter that looks like it'll do exactly what they want, and then they run into the exact same artifacts as you did in the first post.
We will rewrite the light parameters at some point (with backwards compatability), to make them more intuitive. Probably with only a min. and max. range, and a linear or exponential falloff in between. It's not on the immediate planning, but it is very clear that it needs to be done. |
|
Back to top |
|
|
danjo Member
Joined: 20 Sep 2007 Posts: 21
|
Posted: Mon Nov 05, 2007 2:52 am Post subject: |
|
|
when i realized from daaark's post, that the range is actually the red dotted line, i was able to fiddle with settings until i got the line to curve down to zero as close to that red line as possible.
you can see from my first settings the range was cutting off very early (thus leaving a sharp edge)
it still works ok, just that it requires more tweaking to get what you want.
with large ranges, its a lot simpler to get it right.
just a sidenote regarding lightmapping.
i have Giles aswell, which i started off using, becuase it was a lot faster than Deled. problem was it gave some odd results sometimes, whereas Deled, never failed - Just is SLOW ZZZZzzz..
on one level it took around 20 mins to Lightmap O_o and i have a VERY fast PC.. |
|
Back to top |
|
|
jwatte DeleD PRO user
Joined: 26 Apr 2006 Posts: 513
|
Posted: Mon Nov 05, 2007 3:23 am Post subject: |
|
|
It is possible to do hardware accelerated light mapping. Render the scene from the point of view of the light, as if you were rendering a cube map. Render depth into the buffer. Then, when sampling the light map, simply compare the distance to light with the depth stored in the buffer. Works best with R32F format render targets :-)
I bet you could get render time down to well under a second per light using this technique. If the light mapping is important in DeleD, I think they should work on this, right after fixing the COLLADA exporter :-) |
|
Back to top |
|
|
|