Jump to content


Photo

How come lights on chains can't swing?


  • Please log in to reply
9 replies to this topic

#1 kano

kano

    Member

  • Member
  • PipPip
  • 288 posts

Posted 03 June 2018 - 03:59 PM

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?



#2 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8705 posts

Posted 03 June 2018 - 04:11 PM

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.


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#3 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37125 posts

Posted 03 June 2018 - 04:11 PM

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.



#4 demagogue

demagogue

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 5361 posts

Posted 04 June 2018 - 01:06 AM

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.


Posted Image

#5 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 19865 posts

Posted 04 June 2018 - 01:54 AM

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.



#6 chakkman

chakkman

    Advanced Member

  • Member
  • PipPipPip
  • 899 posts

Posted 04 June 2018 - 12:38 PM

I always loved that too. Lights swinging on chains.



#7 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 777 posts

Posted 04 June 2018 - 12:53 PM

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.



#8 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8705 posts

Posted 04 June 2018 - 01:02 PM

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.


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#9 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37125 posts

Posted 04 June 2018 - 06:08 PM

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.



#10 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 777 posts

Posted 04 June 2018 - 09:08 PM

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.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users