Keep the reflection of a prop, but kill the prop?

Discussion in 'Mapping Questions & Discussion' started by Werewolf, May 28, 2015.

  1. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    729
    Positive Ratings:
    205
    So I want to try a little effect in a map, but my efforts so far have not worked.

    What I want to do is put the ghost prop next to a large reflective surface (in this case a window), and use a dedicated cubemap set to 256x256, to capture the image of the ghost prop. In game the prop would later be killed via an input so that when people enter the area they don't see the prop itself, only its reflection in the glass.

    The problem I'm having is that I never see the reflection of the ghost prop. I use a prop_dynamic which I simply kill the first time the door to the area is opened. This ensures that the prop is there when I build cubemaps.

    I have checked that the prop is not being accidentally killed before building cubemaps by noclipping into the room (to avoid triggering the kill command) then building them.

    Nothing I try seems to work, anyone got any suggestions as to how I might achieve this effect?
     
  2. Lampenpam

    aa Lampenpam

    Messages:
    1,018
    Positive Ratings:
    337
    That something quite unusual what you are trying to create.

    When building cubemaps all dynamic objects are disabled.
    If you want that prop on a cubemap, compile the map with a static prop. build cubemaps and save the cubemap texture somewhere. Then compile the map with the dynamic prop again and when yoiu build the cubemaps you have to replace the new cubemap texture (which dosn't show the prop) with the one you saved before.
    I'm not sure how you can replace cubemap textures but I heard there is a way with GCFScrape
     
    Last edited: May 28, 2015
  3. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    729
    Positive Ratings:
    205
    Its just to be a fun/creepy effect in that people will see something behind them but there won't be anything there.
     
  4. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,216
    I was going to suggest more or less the same thing, except instead of trying to hack the cubemap back in, just store it in /tf/materials/cubemaps/, and then make the glass a custom material with $envmap pointing to your custom cubemap. And when you recompile, just remove the prop entirely.

    Either way the drawback is that you will have to go through this entire process every time you make any significant change to the room the prop is in.
     
    • Thanks Thanks x 1
  5. Crash

    aa Crash func_nerd

    Messages:
    3,136
    Positive Ratings:
    4,716
    You might also be able to get away with making a fake area that looks the same, somewhere hidden in an inaccessible part of the map, including the prop you want to show up in the cubemap. Then place your cubemap there and tie it to what you want to reflect it in the main part of the map.
     
    • Thanks Thanks x 1
  6. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    832
    Yes you can replace a cubemap texture later on using VIDE or Pakrat. That's the cleanest method. You could probably get away with compiling the map with the prop_static using a Default or Fast compile, unless you were compiling the final map in HDR, in which case you could add the -both flag to VRAD for your fake compile. You could use visgroups to switch the fake and real prop entities in and out so you don't have to manually hide them each time you compile.

    Alternatively make a copy of the room and put it somewhere in the map. Swap the prop_dynamic for a prop_static. Configure the fake room's cubemap to point to the reflective brush faces in the real room. Keep the fake room a fair distance away from the map so that no other reflective textures in the map pick up the fake room's cubemap due to proximity. Put an ordinary cubemap in the real room for player weapon reflections. This method will save you having to compile the map twice and having to copy in cubemaps manually, but will increase the map's filesize a little bit, probably insignificantly.

    EDIT: Ninja'd by Crash.