Jump to content
The Dark Mod Forums

Lamps without shadows


sparhawk

Recommended Posts

I just read the thread from Vorob http://forums.thedarkmod.com/index.php?s=&am...st&p=180349

 

I think the lamps on the walls look really unrealistic and ugly without a shadow. Since there are the issues with the shadows, I think it would still look much better if we cerate a simple shadow texture as a decal and maybe a prefab for such lights, so that a mapper can put them on the wall. Of course the shadow wouldn't move, but it would still look MUCH better with a static (and performancewise easy) shadow, than none at all.

 

It would still look better if we had just a dark generic blob, that can be used in such cases as a shadow replacement. No details, just a shadowy blob. In older games this was used as well, because shadows were not realistically implementable on older machines, but it still adds depth to the image, as the shadow is an important tool of judging distances. The lamps always look like floating somwhere indefinitely.

Gerhard

Link to comment
Share on other sites

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

A shadow decal doesn't sound hard to implement at all. The material definition itself (blend modes and whatnot) could be copied straight from the scorched-impact decal which the fire arrow uses; just change the texture to something more like a soft shadow blob instead of a scorch mark. Take you maybe 10 minutes.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

A light texture could work too, and would probably be less work. It would just have to be assigned to the appropriate light and prefabbed.

 

This might be a good opportunity to experiment with the rarely-used "blend light"; I believe that it is possible to project a "shadow" without the performance penalty of a full-blown light, because the blend light only blends the shadow rather than actually illuminating anything. I've seen a post on D3W where somebody created a whole load of blend lights to project shadows with almost no performance impact.

Link to comment
Share on other sites

As far as i know blendLights are applied after all the actual lighting is done, so they don't really act like a "soft shadow", but blend on top of things in the scene.

 

Doom3 seems to only use them as a sort of fake fog where there's no need for the player-position to have effect on the "fog" ( see fogs.mtr of Doom3 ).

Link to comment
Share on other sites

As far as i know blendLights are applied after all the actual lighting is done, so they don't really act like a "soft shadow", but blend on top of things in the scene.

 

Indeed so, but if you blended a dark, projected shadow on top of the scene, wouldn't that give the impression of the light casting a shadow? I think that was what the guy on D3W was doing, although I admit I have done no experimentation with blend lights myself.

Link to comment
Share on other sites

Did some experiments of my own, and it seems that blend lights are actually quite powerful, because they can use any blend mode, not just "blend blend".

 

For example (in all these shots, the light is in the far right corner, and affects the rear and floor surfaces but not the left wall):

 

Brighten existing light in an area (blend gl_dst_color, gl_one)

brighten.jpg

 

Darken light in an area (blend filter) EDIT: actually this is blend blend, hence the bright area, but blend filter would be better for darkening an area.

darken.jpg

 

Project a shadow (blend filter) -- this is what we are talking about with the lamp shadow

shadow.jpg

 

Wash out colours in an area (blend blend)

washout.jpg

 

Apply a colour cast to an area (blend filter)

colourm.jpg

 

Basically they are like 3D volumetric decals; instead of affecting only what is below them, they affect everything within the light volume (and any triangles which extend outside, normal rules about light culling apply).

Link to comment
Share on other sites

This is quite cool, I must admit. What happens if you put a model in the middle of that room? Is the effect properly "depth-sorted" or does it get drawn on top of the scene?

 

(Also, regarding the blend filter lights to darken stuff: this has to be done with care, I guess, because the "CheckLighting" functions in the SDK cannot handle these lights. They are used by AI to check if something is in darkness or not, and if the darkened spots are very large, the player might assume it's actual shadow but AI won't perceive it as such.)

Link to comment
Share on other sites

This is quite cool, I must admit. What happens if you put a model in the middle of that room? Is the effect properly "depth-sorted" or does it get drawn on top of the scene?

 

The model is affected just the same as regular map geometry. In this shot the left part of the model is not affected because it extends outside the light volume; the floor being one large surface is affected as a whole.

 

modelk.jpg

 

why again are we not just doing what Baal suggested in the second post? Light textures are already used for street lamps.

 

I don't see the conflict: Baal suggested using a light texture, a blend light is another way of using a light texture to produce a shadow effect. It could be done with a regular light texture as well, but I'm not sure how you would achieve the necessary difference between the downward part of the light (with shadow) and the upward part (no shadow). I guess you could use two projected lights, one going up and the other down, with different textures.

Link to comment
Share on other sites

Was just thinking of performance reasons. Is using one of these an additional light? I'm not sure I understand what this is fully, but I'm guessing it's just another light.

 

From your third pic, it looks like this has the same limitation as textures, in that they appear to be directional, for example, a cylinder face-on from two sides, and side-on from the other four. (I might not be fully understanding limitations around that, either...)

Link to comment
Share on other sites

Was just thinking of performance reasons. Is using one of these an additional light? I'm not sure I understand what this is fully, but I'm guessing it's just another light.

 

I think it's more like another shader pass, rather than another light. The operation it is performing is similar to adding a decal over every surface; although this is not free, it is nowhere near as performance-intensive as a real interaction pass. I would do some performance tests but my current machine is so shitty I'm not sure I'd get any useful results.

 

From your third pic, it looks like this has the same limitation as textures, in that they appear to be directional, for example, a cylinder face-on from two sides, and side-on from the other four. That's a shame.

 

You're referring to the fact that the texture is projected through vertical space, like a stick of rock? Yes, it is similar to regular light textures in this regard, but note this is using an omnidirectional light volume. With a projected light I imagine the result would be what you expect.

 

Interesting, these blend lights. Which shader do they use? I guess it's not "interaction.vfp" but a more simple one.

 

I have no idea actually, I have never figured out where the shader code for other light types is kept (the ambientLight.vfp doesn't appear to be used, and fog/blendlights don't even have an obvious shader file).

Link to comment
Share on other sites

That's awesome, especially project a shadow image you show. This shows extraordinary potential. You could basically create one global light in paint which would cast all the large shadows for your map thus cutting back hugely on your lightcount in those large outdoor areas.

Link to comment
Share on other sites

Is there some way this could be used (maybe with jitter, or a few staggered overlaps?) to soften shadows? Hmm. I guess for some select items, but then it might conflict with other sharp ones. It's making me think of those spinning fan textures in D3, but I guess that's nothing new.

Link to comment
Share on other sites

That's awesome, especially project a shadow image you show. This shows extraordinary potential. You could basically create one global light in paint which would cast all the large shadows for your map thus cutting back hugely on your lightcount in those large outdoor areas.
So possibly copy the geometry from the editor to a paint program image to use as a template. On another layer draw in where the main non-extingushable shadows would fall. Keep that master so it can be updated. Assuming this goes through walls like ambient light? No, it can't. So my guess is we can only use one light per area. Could be used with individual extinguishables by targetting the blend light from the torch?
Link to comment
Share on other sites

Is there some way this could be used (maybe with jitter, or a few staggered overlaps?) to soften shadows? Hmm. I guess for some select items, but then it might conflict with other sharp ones. It's making me think of those spinning fan textures in D3, but I guess that's nothing new.

 

Yes, it could be used for that sort of thing. It is very similar to the rotating fan textures in this regard, but instead of having to add a shadow to the existing light texture, you can keep the regular light and use a blend light to only cast a shadow.

 

Assuming this goes through walls like ambient light? No, it can't.

 

Yes, it will. It affects everything within the light volume just like any other non-shadowcasting light. I'm not sure using a single blend light to produce all of your outdoor shadows would be the easiest approach, but you could certainly create a series of shadow textures (for example shadows of leaves and branches for a forest area) and project them using multiple blend lights.

 

Also, one could create a series of generic "blob shadow" textures and apply them with blend lights to certain objects, basically like shadow decals but easier to position and use.

 

I can see the colour casting effects being used in certain artistic situations too, like that Thief FM which had washed out colours, or maybe providing a "matrix-style" blue or green cast to certain map areas or even the whole map.

Link to comment
Share on other sites

Yes, it would be like the stick of rock again. Imagine the texture as being extruded through space to fill the entire light volume. Any surface which intersects this texture will be coloured according to the part of the texture it intersects, no matter how many other surfaces there may also be inside the volume.

Link to comment
Share on other sites

So what is the conclusion? I don't really want to add an extra workloadprior to the release, but I always thought that the lamps suffer a lot from not having any shadows. Adding a decal seemed best to me because it doesn't take so much performance. If this blend stage has the same effect its fine for me. :) You just have to keep in mind a long floor with such lamps in regular intervals, which is a very likely scenario. So this should be be able to be processed on a reasonable machine setup.

 

With this blend stage, can this be added as a prefab or so? This would be best, because it's hard for mappers to place all this stuff if the have to add each detail individually, and especally such lights are probably used a lot (same would go for torches I think as well).

Gerhard

Link to comment
Share on other sites

Would it not simply be easier to create a special light texture to create the fake shadows, like they do in D3? They work well enough, and don't add any more work load...aside from creating a small texture....they could be saved as a prefab, or simply given the same name as the light they're meant to be used with. Also, they don't cost anything extra since they're already part of the light. Seems like the most logical choice to me, rather than adding another system at this stage in development.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 3 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...