How to make a prop dynamic receive correct shadow as it moves?

Discussion in 'Mapping Questions & Discussion' started by Banni, Oct 11, 2008.

  1. Banni

    Banni L1: Registered

    Messages:
    24
    Positive Ratings:
    2
    Guys,
    I'm trying to do a simple 'train through a dark tunnel' feature (like the ones in Well). I've got the train moving happily around a loop (prop_dynamic parented to a func_tracktrain). The problem I'm having is the the prop (bomb_cart.mdl in this case) is always light as it appears in its initial position. What I want to happen is that it comes out of a dark tunnel, gets brighter as it passes the player standing on the platform, then as it disappears down the tunnel, it gets darker again. Looking closely at the trains in Well, when they are in the tunnels either side of the map, they are darker. Once they come out into the sunlight, they brighten up. Therefore it does seem to be possible to achieve the effect I want.
    Can anyone please suggest what I'm missing to make this work? Cheers
    EDIT: The screenshots show the train as it first appear in the dark tunnel, yet it is still brightly lit. The lighting stays constant all the way along the tunnel.
     
  2. Psyphil

    Psyphil L3: Member

    Messages:
    125
    Positive Ratings:
    30
    I believe I heard somewhere that the well train is 2 trains, one in the skybox and then with perfect timing it meets with one inside the map.
    but I'm not sure
     
  3. Banni

    Banni L1: Registered

    Messages:
    24
    Positive Ratings:
    2
    I think you're referring to this from the developer commentary notes:
    AFAICT the transition is purely so they can switch between a skybox (1/16th) model and the real model. The shed in Well just outside the playable area where you lose sight of the train briefly seems to be where this happens. Once the train comes out the the shed, there is still a visible transition of its lighting state. It's this transition I'm trying to reproduce. Perhaps I should look at a decompiled version of well...
     
  4. FaTony

    FaTony Banned

    Messages:
    902
    Positive Ratings:
    160
    Nah, u'll need either light_dynamic or several prop_dynamics with different lighting.
     
  5. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,745
    I'm not sure about this because the cart in goldrush and in hoodoo change shading as they move. I have a feeling it might be related to the VVIS settings you might be using, if not try using this and see if that works.
     
  6. FaTony

    FaTony Banned

    Messages:
    902
    Positive Ratings:
    160
    Umm, as I know, func_tracktrain brushes are lit as they are in hammer and it's static. Dunno about prop_dynamic.
     
  7. UKCS-Alias

    aa UKCS-Alias Mann vs Machine... or... Mapper vs Meta?

    Messages:
    1,264
    Positive Ratings:
    749
    Note that the cart in the the valve payload maps is a prop_physics with motion disabled in the start (parented to the tracktrain). If im right prop_physics objects recieve light better prop_dynamic so its worth a try.

    The train in well is indeed a prop_dynamic but i guess its way of recieving shadows is defined in the vtf files in a diffirent way then the cart.

    Anyway, just try it out and see if it works.
     
  8. Banni

    Banni L1: Registered

    Messages:
    24
    Positive Ratings:
    2
    Thanks for your comments. Now for some follow up:

    I changed the model from the bomb cart to the same train engine as used in Well. At first this appeared completely black as it went down the tunnel, rather than fully lit like the bomb cart. After tweaking things, I eventually fixed it (for the train model) by tweaking the lighting values (I'd initially set the falloff distances too low). Now the train (func_tracktrain + prop_dynamic) travels down the tunnel out of the darkness, gets brighter as it comes under the lights, and then gets darker again as it moves into the shadows. Perfect!

    If I change the prop_dynamic to use the bomb cart model (without changing anything else at all), then the cart stays fully lit at al times. It seems there might be something in the cart's material that behaves differently from the train's.
    That does fit with the post above somewhat, so I'll try experimenting tonight with the bomb cart as a prop_physics rather than a prop_dynamic, and see how it goes.

    For reference, all my lights are static (a mixture of light and light_spot entities).