[IDEA]Offline Lightmap Creation

All other topics around Descent and D2X-XL

Moderators: Frustikus, simX, Aus-RED-5

materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

[IDEA]Offline Lightmap Creation

Postby materialdefender » Thu Aug 30, 2012 2:25 pm

This project aims at creating high quality lightmaps and many new textures for the Descent I + II single player campaigns.

This post will be used to post updated screenshots from time to time. Status updates wil be done in new posts.

Note that the current pictures are not ingame shots but done in 3dsmax, which will be used for creating the lightmaps. I'm pretty confident though that it will be possible to get a final result very close to these images.

The project will be done when (and if) it's done.

d1l1_1.jpg
d1l1_1.jpg (112.76 KiB) Viewed 7799 times

d1l1_3.jpg
d1l1_3.jpg (150.34 KiB) Viewed 7799 times

d1l4_3.jpg
d1l4_3.jpg (84.28 KiB) Viewed 7799 times
Last edited by materialdefender on Sun Sep 09, 2012 1:25 am, edited 5 times in total.
Sirius
Posts: 1990
Joined: Tue Sep 25, 2007 10:29 pm
Location: Bellevue, WA
Contact:

Re: [IDEA]Offline Lightmap Creation

Postby Sirius » Thu Aug 30, 2012 4:21 pm

DLE allows you to save geometry out to an ASCII block format (.BLX). I think that actually contains all the information you're looking for.

Edit: Kind of sounds like most of what you need is specs... it shouldn't be impossible to save data from an external program into something that D2X-XL can read for lightmaps. You'd need to write a converter, though...
materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

Re: [IDEA]Offline Lightmap Creation

Postby materialdefender » Thu Aug 30, 2012 5:29 pm

Sirius wrote:DLE allows you to save geometry out to an ASCII block format (.BLX). I think that actually contains all the information you're looking for.


Sounds like a good starting point, I even found .BLK specification on the net. But apparently I'm too stupid to do an export from DLE-XP :? . I can't find an export function. I will keep searching though. Apart from that, I'm not sure whether the data from the editor already contains the lightmap UVs. I guess those are generated on the fly in D2X-XL.

Of course I could generate unique UVs in 3dsmax (although the built in UV-flatten function sucks, wastes far to much texture space), but then those UVs had to be brought into D2X-XL.

Btw. The level I used for the test images was converted with an acient DXF converter which is of no use for the "real thing" since it only exports raw geometry.

Bottom line is, it would be of great help if karx11erx could do some parts of this work. He already figured things out long ago and could most likely do in hours what would cost me days. Let's hope he has a heart... :wink:
Sirius
Posts: 1990
Joined: Tue Sep 25, 2007 10:29 pm
Location: Bellevue, WA
Contact:

Re: [IDEA]Offline Lightmap Creation

Postby Sirius » Sun Sep 02, 2012 7:06 am

It's called "Save block" I think - under one of the menus. You most likely need to mark the cubes you want to save first though - Alt+M should do that for the whole level.
materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

Re: [IDEA]Offline Lightmap Creation

Postby materialdefender » Sun Sep 02, 2012 8:37 am

Actually it's 'Copy Block'. Due its place in the 'Edit' menu and its name that function looks so much like an internal copy routine at first glance that it didn't even occur to me that it could export data. I'm a little less embarrassed now...

The exported file seems indeed to be of great help, thanks for the hint. The basic things, geometry, textures, and according UVs should be no big deal. Lightmap UVs aren't included though, just as I guessed. What I don't understand for now is how the lighting information is encoded. There is only a single integer value vor each segment, which is not what I would have expected. Hopefully a bit of experimenting and digging into DLE-XPs source code will shed some light on how this works.

Edit: maybe a level artist could try to explain the lighting concept in brief. That would help alot.

Edit2: I should start looking a bit closer, before I post something here... Actually lighting values for each vertex are included alongside with the UVs.
Last edited by materialdefender on Sun Sep 02, 2012 10:32 am, edited 1 time in total.
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: [IDEA]Offline Lightmap Creation

Postby karx11erx » Sun Sep 02, 2012 9:46 am

D2X-XL's light map renderer isn't that bad imo, since it is based on a simple raycasting mechanism.
materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

Re: [IDEA]Offline Lightmap Creation

Postby materialdefender » Sun Sep 02, 2012 10:12 am

You're right, it's not. And I wouldn't even be able to write something like that without having to do much research.

But, and that's a pretty big but, at least for me ;) : the renderer I intend to use is a production grade raytracer with support for global illumination, true area lights and a thousand other things. That means correct soft shadows (area lights), and even more important, indirect lighting (global illumination), meaning computation of light that bounces back from illuminated surfaces. That is a *very* important thing for realistic looking lighting, believe me. When these renderers became common a few years ago, they changed everything. And for a reason.

Apart from that, due to ambient occlusion and some added (or multiplied, to be precise) fractal noise, the lightmaps can be used to give Descent's levels a slightly more used and 'grungy' look. They won't suddenly start looking like something done today, but it will help.

That doesn't mean what you accomplished was bad, quite the opposite! There is just no way to compete against what can be done with a modern production renderer.
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: [IDEA]Offline Lightmap Creation

Postby karx11erx » Sun Sep 02, 2012 4:14 pm

Yeah, perfect lighting fits perfectly into D2X-XL's perfect renderer. :P

;)
materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

Re: [IDEA]Offline Lightmap Creation

Postby materialdefender » Sun Sep 09, 2012 1:07 am

After finishing most of the 3dsmax importer I toyed around with a few levels. ...And in the end decided to broaden my approach a fair bit. I won't do precalculated lightmaps only, as originally planned, but also many new textures. The original psychedelic look is just too distracting (and most of the times not exactly beautiful too, I might add). The whole lighting effort would be wasted for the most part. While generally staying true to the basics (rocks will be rocks, space station will be space station and so on) I will go for a cooler, less saturated look and more uniform surfaces with less apparent texture tiling. And I will reuse various textures more often to keep the workload at a minimum. You won't miss anything though, many of the original textures are just outright appalling without nostalgia clouded eyes. Having less of them will be a win. And of course noone is forced to use the new textures.

I updated the original post with new pictures. So far these are not ingame shots! But with lightmaps at the same resolution that D2X-XL uses at its high setting, combined with a slightly different blending algorithm in the lightmap shader, it should be possible to come *very* close to these images in the end.

I also have an idea how to recalculate the robot lighting according to the lighmap lighting, so robots won't stay out lighting wise. At least if this works as planned.

Just in case anyone wonders when this will be available: This will take at least a few monzhs and I can't give any release date, sorry. It's not exactly a small undertaking. Actually I won't even promise that this thing will get finished at all. Real life might always strike. ;)
Last edited by materialdefender on Sun Sep 09, 2012 10:01 am, edited 1 time in total.
User avatar
Weyrman
D2X-XL Expert
D2X-XL Expert
Posts: 579
Joined: Tue Sep 25, 2007 7:47 pm
Location: Brisbane Australia
Contact:

Re: [IDEA]Offline Lightmap Creation

Postby Weyrman » Sun Sep 09, 2012 3:46 am

Very nice stuff, let me offer encouragement!

:laola: :laola: :laola: :clap: :clap: :clap: :clap: :clap: :rock: :rock: :clap: :clap: :clap: :clap: :clap: :laola: :laola: :laola:
-SYSTEM SPECS-
MBoard:"GigaByte Z68X-UD3H-B3" Motherboard
CPU: Intel i7 E2600 3.40GHz
RAM: 8GB DDR3 2133MHZ
HD: WDC 10EARX 1TB SATA
Video: GigaByte 1G ATI 4890
Monitor: Asus VS428 LCD 24"
Sound: Onboard - now with connected 5.1 sound system
OS: Windows 7 x64 Home Premium
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: [IDEA]Offline Lightmap Creation

Postby karx11erx » Sun Sep 09, 2012 8:39 am

This looks very cool.

How do you intend to handle dynamic (blinking / destructible) lights though?
materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

Re: [IDEA]Offline Lightmap Creation

Postby materialdefender » Sun Sep 09, 2012 10:21 am

I haven't decided how to handle destructible/flickering lights yet. The two feasible solutions are either ignoring these features (which would be a shame) or excluding those lights from the lightmap calculation and have D2X-XL handle them as 'normal' lights. That sounds like the most sensible solution to me, and my guess is that's the way you have done it, isn't it? That alone would be reason enough to do it this way since then no changes in the D2X-XL renderer would be required.

EDIT: The best way to do this might be combining both of the above mentioned approaches by baking non static lights at a reduced intensity (e.g. 1/3) into the lightmap and still adding 'normal' light in D2X-XL. This way you will have both: some nice global illumination and flickering/destruction. Only catch is that lights can't be turned off completely this way, they will always have at least the baked in intensity. But that might not even prove a disadvantage.

The other thing that has to be decided is how to handle doors and destructible walls in the lightmap calculation. Consider them open or close? That is an obvious choice for secret doors, but it might not be so obvious for some other door/wall types. I will experiment with that once I have a working in game solution.

The visually perfect lightmap based solution for both problems would be to have on/off lightmaps per non static light/door/wall and blend these dynamically. But I won't even think about actually doing this. Would be relatively complex to implement both in D2X-XL and on the content creation side. Apart from that it would be a first class memory hog and might degrade performance considerably. I don't think anyone has done something like this before, most likely for a good reason.
Sirius
Posts: 1990
Joined: Tue Sep 25, 2007 10:29 pm
Location: Bellevue, WA
Contact:

Re: [IDEA]Offline Lightmap Creation

Postby Sirius » Sun Sep 16, 2012 7:30 am

I believe some of the very new engines (CE3, UE4) can handle fully dynamic lighting of that nature, but they're probably not designed for as many lights as Descent throws around. And I'm pretty sure they don't use pre-baked lightmaps to do it...

The most vexing thing about handling non-static lights visually "correctly" is that door open/close states will interact, and suddenly you have a tree of states. That becomes untenable pretty fast. Oh, and doubly so if you bothered to re-calculate light for each frame of the door opening/closing animation - that would be seriously cool but is almost certainly not worth it. After all, even from your screenshots it becomes painfully obvious that the visuals are being handicapped by the low polygon count. Not that this lighting doesn't do something - it definitely does. These rooms look pretty real if you don't pay more attention to the rock.
materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

Re: [IDEA]Offline Lightmap Creation

Postby materialdefender » Wed Sep 19, 2012 9:03 am

I'm not sure about UE4, I think Epic indeed demoed some realtime GI recently. Although that would most likely be a screen space effect, I guess. And if it has similar visual artifacts like screen space ambient occlusion, I'm not so sure if it's a great idea at all. UE3 uses prerendered GI solutions (called "lightmass").

The door opening issue could be handled by blending the on/off lightmaps depending on the percentage that the door is open. That wouldn't be perfect, but almost certainly good enough in most cases. But such considerations are theoretical anyway, the whole idea just doesn't make sense. You would need an enormous amount of lightmaps (two for each switchable light/door) that would have to cover four or five level segments each in all directions at least to ensure light doesn't get cut off. Logically that shouldn't be too hard to handle, but it would be a memory hog of epic proportions.
hudfreegamer
Posts: 5
Joined: Mon Dec 31, 2012 2:53 pm

Re: [IDEA]Offline Lightmap Creation

Postby hudfreegamer » Thu Jan 17, 2013 11:20 pm

I really like this idea. Is it still in the works? Is it done? This is exactly what this game needs.

Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests