Major City17 Update
Well after so many months I can gladly say we have something to show you guys, and something worth an update at that too!
This is also one of those giant Post-stretching-forum Updates, so press the “More” button to continue. Also we have some technical jargon below, for anyone who might be doing this to their project, or plan too.
What I am talking about is at the moment a few new thing’s we included into City17ep1. First off:
Dynamic lighting makes almost any game pretty, why we’ll never fully understand, whether it be those damn sexy shadows or just the fact they are dynamic which seems to be a cool word for engine’s now adays. With that is Dynamic Shadowing in Source! The greatest thing about this kind of lighting is it’s main benefits. All technical of course, but here’s a summary of why they rock more then normal computed static lighting:
- Aren’t static, therefore cast shadows at any length or angle depending on their brightness and angle. Because of this we can get much more realistic shadows out of them, rather then getting shadows to cast in a single direction all through a map, which was Source’s current problem for us in this case.
2. Lighting isn’t pre-built, therefore even though it’s rendered real-time, it’s not built into Texture Memory, which means less video memory will be used from your Video Card, giving the user better performance balanced out.
3. No need for thing’s like Lightmaps on surfaces that are being lit by the lighting, due to the light will always be calculated correctly based upon: Distance, Brightness, Quadratic Values, and Size of the light itself along with color.
Screenshots really don’t do this any justice at all, so time for a video!
The video contains annotations on some of the problems you might see, so worry not about those. Were very un-likely to use any omnidirectional Lighting anyways. Just point Lighting. It just seems that WordPress doesn’t like annotations or High quality version of videos, so head here to see it in all its glory.
Aside that we have some more work to do on most of the maps and include the new lighting into those as well, so look forward to more screens of actual good shadowing, and as well fixed!
Alright so we’ve been getting alot of mix up’s by this, and we’d like to clear some things up:
*Questions taken from comments on Moddb.
Q: Should make your code available so other mods can use it.
A: We will, once were done with it fully.
Q: There is already dynamic shadows in source ?? Did you just make them in the old engine or something ??
A: Yes there is, but the issue is that only one is allowed at a time in the OrangeBox engine. We added in code that allows multiple, along with that a max count of 132 shadows max.
Q: It’s a default part of OrangeBox… You can just take a lamp in Garry’s Mod and put it up behind an NPC and get the exact same results.
A: Yes it is, but Garry never really shared any of his other code, other then the max count. In order to see what you get in Garry’s mod, you also need to enable alot of other things based on LUA, of course were not doing that. Instead we went over performance code, parenting code, View model code, and more importantly we changed the way the entity works alot. Allowing it to have quadratic Lighting values, and ambient terms. After all that, it works far more realistic, that that of a Garry’s mod “Lamp”.
Q: so you are using the orange box version?
A: Yes, always will, unless of course Valve releases a New Engine sometime, but we doubt that.
Q: How is the performance aspect?
A: As balanced as lighting with Lightmaps, it seem that the only time it ever slows down is due to other rendering like: NPC’s, AI, or even physics. Basically its impact against performance is so minuscule compared to Lightmaps, that is just probably about 0.01 frame lower of a result. So the real issue is just if other rendering will slow you down before shadows do. Also because these lights are mostly static, their prediction data isn’t needed, and therefore don’t cost as much in that aspect.
Q: I read in a tutorial that normal lighting does not take up any (or a VERY small amount) texture memory.
A: It all depends on the light entity, and the Lightmap scale, the lower it is, the more memory is taken up. Also mostly normal lighting is still used, were not replacing all of the lighting in the game, but mainly things like fake lighting will still exist as the basic lighting. While lights that should, or would seem to cast shadows are dynamic.
Q: But what I don’t really get is how much this differs from the Orange Box flashlight? And why is this so much better than the OB version?
A: It differs alot, from changing the brightness, to the color, and even the Texture it projects. But also atop that, it can alter the size of the texture too, resulting in a bigger light. In fact we’ve turned the sun into a Dynamic light with extra code, and well, it looks damn sexy as hell. But better then the OB version, well it is the OB version, just extended, and modified to do almost anything normal lights can, which now even acting as an light_environment.
Q: Do maps need to be recompiled to take advantage of this or is it like a Q1 engine mod where you use external files to setup the light settings so stock maps will work? Is this for all light entities or just ones you specify (so lightmaps still work)?
A:Maps would need to be recompiled on the mod itself with these Light entity’s that we specified. As much as we’d like to turn a Normal light entity into a dynamic one, we couldn’t it be to complicated without touching the way the Lighting engine works in Source. This, is by far the simplest way to do it, without actually having to destroy Source’s Lighting system, which in total, would just require most of the Engine to be redone. Lightmaps of course still work, but won’t be needed if the Dynamic light is casting on a particular Face.
Last you would need to do most of the code yourself for your own mod in order for this to work right. The way we have it setup has alot of other things built in besides just the lighting. So it wouldn’t be as easy as giving anyone the Dll’s sadly.