Lightmapping
Lightmapping
Don't know if anyone notice, but lightmapping has been put into the latest version of d2x. There still a few issues with it, but once those are resolved it should look something like this.
http://www.geocities.com/lehm_2000/d2x/scrn0003.jpg
Now you must have a higher end card for this feature to work. We're Talking Geforce 5+ or Radeon 9+. We're having a few performance issues. So if it runs slow on your system let us know. And I mean RUN, I know it takes a while to load the levels right now, I'm working on that. I should mention that the option is located in the render options menu. Remember this is just a preview, it will get better.
Oh yeah and thanks to Riot for testing it.
http://www.geocities.com/lehm_2000/d2x/scrn0003.jpg
Now you must have a higher end card for this feature to work. We're Talking Geforce 5+ or Radeon 9+. We're having a few performance issues. So if it runs slow on your system let us know. And I mean RUN, I know it takes a while to load the levels right now, I'm working on that. I should mention that the option is located in the render options menu. Remember this is just a preview, it will get better.
Oh yeah and thanks to Riot for testing it.
The only practical way to enable lightmapping with the way the texture stages are setup was to use pixel shaders. And those are only supported on higher end systems. Beleive me I tried to get it to work using normal blending but it just wouldn't work.fliptw wrote:what exactly are you doing that needs such high-end hardware?
how exactly are you guys calculating the light-maps, and are you planning to cache the calculated light-maps in future releases?
The method for calculating is currently brute force. Every pixel is calculated one at a time. That's why it's so slow, I'm working on a much more efficient way to do it.
Looks great so far other then being a bit sluggish on 800x600. I was running it on 1024x768 and 1152x864 sans-lightmapping. Level load delay wasn't "horrible". It was actually quite tolerable. I've seen worse...but it did load, which was good.
However the effects don't stay if you adjust resolutions while in-game on my end. You have to leave the level and change the settings and then restart a level. The whole level becomes dark with mixed effects happening on the textures. If you want screenshots I can provide them if they're needed. Same them happens when I ctrl+enter'd to minimize the screen. Just imagine the whole level going dark and someone came in and spray painted glow-in-the-dark paint on the walls
System:
P3 1.0ghz
512mb SDRAM
GFFX5200 256MB
Good work though
Martyr Prime: Lightmapped!
However the effects don't stay if you adjust resolutions while in-game on my end. You have to leave the level and change the settings and then restart a level. The whole level becomes dark with mixed effects happening on the textures. If you want screenshots I can provide them if they're needed. Same them happens when I ctrl+enter'd to minimize the screen. Just imagine the whole level going dark and someone came in and spray painted glow-in-the-dark paint on the walls
System:
P3 1.0ghz
512mb SDRAM
GFFX5200 256MB
Good work though
Martyr Prime: Lightmapped!
I have restructured Lehm's lightmapping code a little, as it was pretty experimental, and may have introduced a bug or two when doing so. There is the original Lehm code path in my code adaption available though, too, and I cannot see it producing better results than mine.
I also have to say that I don't really like the lightmapping rendering results yet, because they seem to take away contrast pretty much, letting everything look somewhat washed-out and dim.
Finally, very strangely it totally breaks my X800 XT PE, while running fine on a GF 5200 FX.
I also have to say that I don't really like the lightmapping rendering results yet, because they seem to take away contrast pretty much, letting everything look somewhat washed-out and dim.
Finally, very strangely it totally breaks my X800 XT PE, while running fine on a GF 5200 FX.
- Aus-RED-5
- DBB Friend
- Posts: 1604
- Joined: Fri Apr 23, 2004 7:27 am
- Location: Adelaide, South Australia
- Contact:
Well I tryed it out.
Running D2x-w32 on a P4 3.2 Ghz w/HT 800FBS, 1G Memory and FX5950 Ultra 256MB card! Screen res 1280x1024 Full screen and ran smooth with no probs! But like Diedel said.... "everything look somewhat washed-out and dim." Yes that it does but I still like it. Keep up the good work guys!
Thanks
Running D2x-w32 on a P4 3.2 Ghz w/HT 800FBS, 1G Memory and FX5950 Ultra 256MB card! Screen res 1280x1024 Full screen and ran smooth with no probs! But like Diedel said.... "everything look somewhat washed-out and dim." Yes that it does but I still like it. Keep up the good work guys!
Thanks
I have been able to fix the bug in my lightmapping code adaption. I have run into a few other problems though: Primarily dynamic lighting not working (flashing/exploding lights, flares).
I also found that for some strange reason the debug version of D2X-W32 (simply compiled w/o any code optimizations) on my workplace machine successfully acquires all necessary functions from the OpenGL library, while the release code does not. This is true for both MSVC 6 and MSVC .NET 2003. Weird.
I also found that for some strange reason the debug version of D2X-W32 (simply compiled w/o any code optimizations) on my workplace machine successfully acquires all necessary functions from the OpenGL library, while the release code does not. This is true for both MSVC 6 and MSVC .NET 2003. Weird.
Re: Lightmapping
Just for information purposes, GF4 Ti's also have pixel shaders. I tried it out on my Mad Dog GF4 Ti4200 with 64M memory. Worked like a champ. I got very similar results as some of the posted pics.Lehm wrote:We're Talking Geforce 5+ or Radeon 9+.
I know for a fact GF4 MX's do not have pixel shaders. You need a Ti. So thats just another card you can add to the compatability list.
http://missions.dyndns.org/ - Descent Mission DesignsRiot wrote:I concur.Jeff250 wrote:Was the light map toggle moved or removed from the render options menu?
Hey is anyone up for game?
edit: where can I get Martyr Prime?
Houses all the MP levels I've built over the years.
The lightmap render toggle was temporarily unavailable due to a bug which is fixed now.
Just made a clean install of Catalyst 5.5 on my home machine (remove old driver, reboot, install new driver, reboot). Did not cure my problem with the lightmapping code (low framerates, and that on a X800 XT PE).
Skya,
the current lightmapping method makes sense in how far it reaches: A light sources power does not depend on the size of the face it sits on, but simply on its brightness.
If you want it otherwise, convert your levels to D2X-W32 levels and add colored lights. As these work by lighting the vertices, big faces will get completely lit as well.
Edit: It's ofc a different story if the whole texture is a light ... I have changed lightmap range calculation to take the base side size into account. Try D2X-W32 v1.4.22 (and send me that level ).
Just made a clean install of Catalyst 5.5 on my home machine (remove old driver, reboot, install new driver, reboot). Did not cure my problem with the lightmapping code (low framerates, and that on a X800 XT PE).
Skya,
the current lightmapping method makes sense in how far it reaches: A light sources power does not depend on the size of the face it sits on, but simply on its brightness.
If you want it otherwise, convert your levels to D2X-W32 levels and add colored lights. As these work by lighting the vertices, big faces will get completely lit as well.
Edit: It's ofc a different story if the whole texture is a light ... I have changed lightmap range calculation to take the base side size into account. Try D2X-W32 v1.4.22 (and send me that level ).
Changing the lighting range based on surface size is part of my new code, you beat me too itDiedel wrote: Edit: It's ofc a different story if the whole texture is a light ... I have changed lightmap range calculation to take the base side size into account. Try D2X-W32 v1.4.22 (and send me that level ).
I'm just wondering why lightmapping on an old ass game like D2 takes my framerate from 60fps with AAx2, AFx2 down to 14-16fps in fairly small levels at 1024x768...
It's also causing one of the lava textures not to be rendered correctly and lightmapped correctly...
Hell's Gauntlet 2.0: No Lightmaps
Hell's Gauntlet 2.0: Lightmapped
Note: I'm aware the FPS display is higher on the lightmapped screenshot but it drops down to 20 or lower while flying around.
It's also causing one of the lava textures not to be rendered correctly and lightmapped correctly...
Hell's Gauntlet 2.0: No Lightmaps
Hell's Gauntlet 2.0: Lightmapped
Note: I'm aware the FPS display is higher on the lightmapped screenshot but it drops down to 20 or lower while flying around.
Re: Lightmapping
To quote myself.
What kind of system do you have? Not sure about that texture, any see things similar?Lehm wrote:We're having a few performance issues. So if it runs slow on your system let us know.
If you scroll up you'll notice I already posted my system specs in my first post. I'm also well aware of the performance hit, but I wasn't expecting something that drastic on something so old. That isn't your fault, I'll just have to wait until optimizations can be made.
Anyways...
If I remember correctly that particular lava texture doesn't generate natural light, so I might have backlit it with a light texture using the lava texture as an overlay.
In the first screenshot you'll notice everything is illuminated nicely. This was a commonly used trick for areas that needed light and didn't allow for expected texture alignments with the light as the overlay. Also it was used, in situations such as these, especially in D1, where certain textures didn't provide natural lighting on their own when they should have.
Anyways...
If I remember correctly that particular lava texture doesn't generate natural light, so I might have backlit it with a light texture using the lava texture as an overlay.
In the first screenshot you'll notice everything is illuminated nicely. This was a commonly used trick for areas that needed light and didn't allow for expected texture alignments with the light as the overlay. Also it was used, in situations such as these, especially in D1, where certain textures didn't provide natural lighting on their own when they should have.
Well, that issue is fixed...
Hell's Gauntlet v2.0: With Lightmap (1.4.24)
However when you alt+enter to minimize, the pixel shader goes back to doing what it did in the previous versions on that lava texture. This same thing also reverts flares back to not generating any light. Its a minor problem because the pixel shader would do what it is suppost to do either completely minimized when the level starts or completely maximized when the level starts.
Still, it should be able to compensate for the in-game adjustment and render everything as it would in either modes.
Hell's Gauntlet v2.0: With Lightmap (1.4.24)
However when you alt+enter to minimize, the pixel shader goes back to doing what it did in the previous versions on that lava texture. This same thing also reverts flares back to not generating any light. Its a minor problem because the pixel shader would do what it is suppost to do either completely minimized when the level starts or completely maximized when the level starts.
Still, it should be able to compensate for the in-game adjustment and render everything as it would in either modes.
That's just a wrong color assignment to these lights and will be fixed, thx for the hint. Now if you had named the level, or shown the light texture up close ... this way, I can only guess which light this is.
@all:
Lehm is currently writing an improved and faster lightmapping version.
Lightmapping is still in beta stage and subject to experiments and change.
@all:
Lehm is currently writing an improved and faster lightmapping version.
Lightmapping is still in beta stage and subject to experiments and change.