Jump to content
The Dark Mod Forums
Sign in to follow this  
kano

How come lights on chains can't swing?

Recommended Posts

One of my favorite things to do in Doom 3 was punch the light on the chain and watch the shadows dance around. How come the dangling candles/chandeliers in TDM are immovable?

Share this post


Link to post
Share on other sites

Many of the static light entities were created for performance reasons.

 

In particular, the 3-candle entities use 3 overlapping shadow-casting lights which is pretty performance intensive

so many mappers have customized it to use one light linked to all the candles.

 

Moving would be that much more intensive.

 

It's possible to do but you'd want to ensure that you do it in a room with less shadow-casting geometry and draw distance.

 

I'm not sure whether we have a moveable entity already and nobody is using it or if we never created one due to the above.

 

If Shadow Mapping or other optimizations continue to improve things for 2.07 and later, it may be worthwhile to revisit some

of these optimization choices.

Share this post


Link to post
Share on other sites

Making ragdolls is harder than making static models, and can also cause a bigger performance hit if the lights themselves move.

 

That said, I made at least one ragdoll light at one point...not sure if it has ever been used.

Share this post


Link to post
Share on other sites

If they player can't easily touch it, can't you just set up a static chain and attached lightsource and script-move the thing whole so it appears to sway? If you do it subtly enough I think it could sell the illusion and look pretty good. I also wonder if you could do it backwards by putting the light on a nurb curve and then attach a chain or whatever to it so it appears it's swaying on the chain (when it's really the light that's moving the chain along with it). But I believe all the directions for making a bona fide ragdoll version yourself you could get from the wiki and existing examples buried in the pk4s.

Share this post


Link to post
Share on other sites

That said, I made at least one ragdoll light at one point...not sure if it has ever been used.

The one you created for the tavern? the pivot points are hinges the light model and entity are bound to.

Share this post


Link to post
Share on other sites

In terms of performance, it is unlikely that a light source hanging on a chain is more costly than a static shadow-casting light source.

At least, I don't see how it could be more costly.

Shadow volumes are not reused between frames: if your light is shadow casting, than its cost should not increase due to movement.

Share this post


Link to post
Share on other sites

In terms of performance, it is unlikely that a light source hanging on a chain is more costly than a static shadow-casting light source.

At least, I don't see how it could be more costly.

Shadow volumes are not reused between frames: if your light is shadow casting, than its cost should not increase due to movement.

 

We have noted in testing that torches without moving light entities attached are less performance intensive than those with them.

 

As I understand it, the vertex cache derived from the silhouette calculation remains until the light source or shadow caster moves, and then (if so)

it gets recalculated.

 

I guess that means that as long as you don't disturb the moveable light then the penalty shouldn't be so bad.

 

That kinda excludes wind-blown lights or other moveable lights that may be self motivated somehow.

Share this post


Link to post
Share on other sites

The one you created for the tavern? the pivot points are hinges the light model and entity are bound to.

 

That prefab is just a regular model bound to a func_pundulum entity. The md5mesh one was a different entity. Come to think of it, that might have been created using a Doom3 md5mesh, which would explain why it isn't in use anymore.

Share this post


Link to post
Share on other sites

We have noted in testing that torches without moving light entities attached are less performance intensive than those with them.

As I understand it, the vertex cache derived from the silhouette calculation remains until the light source or shadow caster moves, and then (if so)

it gets recalculated.

Yes, this is true.

When both light source and shadow caster do not move, there is no need to recalculate shadow volumes and send them from CPU to GPU.

Moreover, if light source is marked as non-moveable by cvar, then dmap probably precomputes shadow volumes for static models and brushes.

 

On the other hand, I often see light sources which constantly move around slightly (e.g. fireplaces).

They should be as costly as light sources attached to physical things like chains.

Share this post


Link to post
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.

Loading...
Sign in to follow this  

×
×
  • Create New...