Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Lightmapping/Shadows (https://forums.graalonline.com/forums/showthread.php?t=134257859)

12171217 02-03-2010 06:57 AM

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.

cbk1994 02-03-2010 07:00 AM

That's really, really cool. Excellent work.

12171217 02-03-2010 07:05 AM

Quote:

Originally Posted by cbk1994 (Post 1553910)
That's really, really cool. Excellent work.

Thanks!

maximus_asinus 02-03-2010 07:10 AM

That is awesome, pure awesome. Would rep you if I could.

12171217 02-03-2010 07:27 AM

Thanks max :)

I'd like to see some servers start using solutions like this for indoor levels..

Clockwork 02-03-2010 09:10 AM

Very nice :D!

coreys 02-03-2010 09:18 AM

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...

12171217 02-03-2010 01:04 PM

Quote:

Originally Posted by coreys (Post 1553919)
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...

What's extremely annoying is that you never seem to read my posts..

Admins 02-03-2010 03:42 PM

Looks pretty impressive :)
Wondering for what you need requesturlfromgamefile(), is the lightmap generator running on a webserver?

Immolate 02-03-2010 06:42 PM

Interesting. Really interesting.

Crow 02-03-2010 08:27 PM

Quote:

Originally Posted by Stefan (Post 1553940)
Looks pretty impressive :)
Wondering for what you need requesturlfromgamefile(), is the lightmap generator running on a webserver?

I suppose it is. I, personally, wouldn't want to code something that converts raw image data to PNG in GS2.

Tigairius 02-03-2010 09:02 PM

Nice stuff :) Would like to see the code for this.

Immolate 02-03-2010 09:28 PM

Quote:

Originally Posted by Tigairius (Post 1553980)
Nice stuff :) Would like to see the code for this.

I asked too but I realised it said PM him for it. It would be nice if there was a public release in the Code Gallery though.

cbk1994 02-03-2010 10:03 PM

Quote:

Originally Posted by Stefan (Post 1553940)
Looks pretty impressive :)
Wondering for what you need requesturlfromgamefile(), is the lightmap generator running on a webserver?

He said last night he's using PHP and GD to generate the image.

coreys 02-03-2010 11:10 PM

Quote:

Originally Posted by 12171217 (Post 1553928)
What's extremely annoying is that you never seem to read my posts..

Sorry, missed that.

Quote:

Originally Posted by cbk1994 (Post 1553990)
He said last night he's using PHP and GD to generate the image.

I'm considering using some Python code on a webserver to do image generation remotely.


All times are GMT +2. The time now is 11:16 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.