Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Lighting and Secret Project

Sign in to follow this  


Last entry I talked a little about my project DarkXL and about the full screen glow. This time I'm going to talk a little about the new dynamic lighting (one of the "extended" features in the upcoming build).

DarkXL adds optional dynamic lighting that affects things like powerups, various props and weapons fire. As you can see from the following screenshot (a wireframe view of DarkXL), the vertex density in the environment is fairly low.

This means that vertex lighting is right out. Outlaws used vertex lighting in the hardware version for the headlamp... unfortunately it quite often looked awful because of the low vertex density. Jedi Knight suffered from this problem a lot too, although most lights were static so it was easier to deal with. Because of this I implemented per-pixel lighting. I do 2 lights per pass in order to support shader model 2 (dynamic lighting isn't available on lower end cards, other then the headlamp/flash when you fire like in the original), and just zero out the color for the second light if only 1 light is to rendered in that pass.

Here are some screenshots with dynamic lighting highlighted:

The lighting uses a smoothstep for attenuation, like so:

attenuation = smoothstep(0.0f, 1.0f, 1.0f-saturate(d));
where d = scaled distance from the light source (scaled by 1/light_radius).

This allows light attenuation to end at exactly zero at the radius but still have a smooth non-linear falloff. By changing 0.0f to some other value, you can get an "inner radius", where the attenuation is 1.0 inside the inner radius and falls off towards the outter radius.

I've also started a "secret" project recently that I haven't talked about until now: DaggerXL - a Daggerfall port/remake similar to DarkXL. The project takes a back seat to DarkXL until atleast beta, but allows me to work on something else with my free time (maybe once a week) so I don't get burned out. And a Daggerfall remake has been something I've wanted to do for a long time. Like DarkXL, it will use the original game data and emulate the original game play. It will also add easy moddability like DarkXL. Where it will diverge somewhat is that extended features will include adding a lot of gameplay elements that were intended for the original and got canned. Of course there will be the "classic" mode for people that want a truly faithful experience. The enhancements will include things like being able to dock your ship in a town with docks, sailing your ship, proper shape changing spells, being able to store items in your house (in the furniture) and more. :) So far I've got the basic engine up and running, using code from DarkXL. Things like core rendering, player physics, scripting, control mapping and so on. I've got 3D objects rendering, although I'm not loading the proper textures yet. And I'm parsing and building dungeon blocks, although the positioning/orientations aren't right yet - it does load and cache all the models and render.

3D models with a default texture (not a Daggerfall texture):

So stay tuned for more progress on both these projects. I'm going to try to maintain a journal entry at least once a week. Next time I'll talk about the visibility system in DarkXL, which is suprisingly different then you'd expect from a modern engine due to things like overlapping sectors. Also I expect to get dungeon blocks working with DaggerXL, possibly with textures. We'll see how it goes. Any comments are welcome. :)
Sign in to follow this  

1 Comment

Recommended Comments

Thx for your reply in the screenshot section. I had read your FAQ, but I didn't really find a page about feature tracking and upscaling was announced for the near future, so I thought you could leak some images:).
That's really a feature I'm lookin forward for. I've implemented it for two-color textures, but distance fields for every-days textures, if that works out, then you're brilliant!

Like you said, the geometry is very low-poly. Have you considered adding lightmaps? could be quite easily made (ala quake) and with static lights and geometry would look quite well.

I'm lookin forward to your code release (in far future), I'd love to make it all raytraced, it just scream out to be raytraced :)

really good work, for a great game!

Daggerfall is a good next clone :), and there are so many other games waiting for you :)

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!