![]() |
Lightmapping/Shadows
My experiments with lightmapping that will hopefully be finished soon.
Right now the editor supports RGBA values for each light and a falloff value. I want to add support for multiple equations for falloff, such as inverse square, etc. There's more to be added later, such as proper anti-aliasing, support for custom resolution lightmaps (Right now it's half resolution of a Graal level, which is 512x512), but whatever! Here's a video showing the editor and lightmap compiling. Note: I clipped the compiling time. It took 19 seconds in that instance (The compiler's not optimized at all at the moment.) and the editing time was sped up by a factor of two. Also, the software I was using to record raped my video. It's 8-bit =( When you click render, it does the proper calculations and bakes the lights into two PNG files; a colored light map, and a shadowmap, saved as levelName_lightmap.png and levelName_shadowmap.png. Lights blend correctly with one another as well. Also, I can't release this until V6 is released, as I need to use the requesturlfromgamefile function for this to work 100% properly. That function isn't available in the V5 client. umm to-do list: 1) More falloff equations. 2) Spotlights. 3) Custom resolution lightmaps. 4) Fake walls in the editor, and likewise ignoring walls. Oh, if anyone wants this, PM me, I guess. |
That's really, really cool. Excellent work.
|
Quote:
|
That is awesome, pure awesome. Would rep you if I could.
|
Thanks max :)
I'd like to see some servers start using solutions like this for indoor levels.. |
Very nice :D!
|
Perhaps you should add in your light-map editor the ability to select tiles and declare them as walls and use that in your lighting algorithm to add some more realism? Only walls facing down, of course, since those are the ones you can see...
|
Quote:
|
Looks pretty impressive :)
Wondering for what you need requesturlfromgamefile(), is the lightmap generator running on a webserver? |
Interesting. Really interesting.
|
Quote:
|
Nice stuff :) Would like to see the code for this.
|
Quote:
|
Quote:
|
Quote:
Quote:
|
Quote:
Unfortunately, the light only collides with tiles because of this; I couldn't trust appending 512x512 bytes of GET data to get a half-res collision map, so I simply did 4096 bytes; the tile map. If you could enable POST on Testbed, though, instantly solved! With a release, I'd like to host a central, PHP-powered hub for lightmap generation. Might as well go the extra mile; V6 isn't seeing a release soon and I need the requestfilefromblahblahblah function before release.. Also, is there a way to add more GUIControl elements to the scripted RC? Having access to this simply by opening scripted RC and having a simple weapon script that a server manager could install as a sort of "plugin" would be awesome. |
Actually a really good idea to use a webserver to generate things like this. You should also release the PHP code so people can put it on their own webserver so you don't have all that stress on whatever server you're using.
|
Quote:
|
Quote:
Also the plugin thing: http://forums.graalonline.com/forums...ad.php?t=87384 |
Quote:
Might've been because I was using those panel display things; I could always try just writing the PNG information directly from an array, but then the max loop limit still comes into play, and I feel the PHP server is the most elegant solution. |
Quote:
If you're still looking for some performance improvements, and you're familiar with Python, the Python Imaging Library should be much faster than GD (PIL is written in C). If not, I hear imagemagick is faster than GD. |
Quote:
|
For increasing the loop limit there is obj.maxlooplimit, for using TSockets you need to contact me for enabling them on your server (need the host/ip and port range).
|
Quote:
|
Just set the variable in onCreated? this.maxlooplimit = 100000; or so, default is 10000
|
Makes me think of this:
|
Quote:
|
Incredible. Props!
|
Quote:
|
Quote:
|
Nice work
|
I was thinking about rewriting this for Google's AppEngine in Python, but I'll definitely need socket support this time around. How do you go about enabling that on your own server? Or on Testbed? Can the server owner do it?
|
Quote:
|
Quote:
|
All times are GMT +2. The time now is 03:08 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.