New prop_static feature?

Discussion in 'Mapping Questions & Discussion' started by Snowshoe, Sep 11, 2014.

  1. Snowshoe

    Snowshoe L2: Junior Member

    Messages:
    53
    Positive Ratings:
    60
    New feature: prop_static Lightmaps

    Note: If you use this, decompiling prop_static entities on your map will not work until BSPSource updates.
    [error] BspFileReader: Lump reading error in sprp, caused by java.io.IOException
    ...
    at info.ata4.bsplib.BspFileReader.loadStaticProps(BspFileReader.java:344)
    ...
    Note #2: Models that have multiple faces sharing the same space on the UV map will break with this. Just use regular vertex lighting for those. (pic)

    Apparently you can now have lightmaps on static_props now, previously you could only use vertex lighting (with -staticproplighting vrad option or light_spot entities) or origin-based lighting for the entire model.
    Essentially, you can now cast light and shadows on to props just like you would to brushes or displacements. You aren't limited to how high-poly the model is like vertex lighting, as the resolution of the lighting is changeable in the properties.

    [​IMG]

    You can access the new options in the properties of prop_static entities:
    [​IMG]

    Any old props before the FGD update will have a 0x0 resolution. By default, the lightmap image is 32x32. The higher the prop_static lightmap resolution, the more detailed the shadows casted onto the prop are. Obviously, the higher the lightmap resolution, the more the file size of your map goes up. You can also change the X and Y resolution independently, if you for some reason want to do that.

    If you are going to be casting prop shadows onto other props, it's a good idea to compile with -textureshadows and -staticproppolys on VRAD. Otherwise the props will just be casting blob or rectangle shadows.
     
    • Thanks Thanks x 16
    Last edited: Sep 16, 2014
  2. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,527
    What are you doing, posting this publicly. If Rexy sees this... oh dear... he will return to tf2m and make a map that is one giant model like he always wanted to but vertex lighting was too ugly for him.
     
    • Thanks Thanks x 4
  3. Rexy

    aa Rexy The Kwisatz Haderach

    Messages:
    1,795
    Positive Ratings:
    2,366
    [​IMG]
     
    • Thanks Thanks x 23
  4. Snowshoe

    Snowshoe L2: Junior Member

    Messages:
    53
    Positive Ratings:
    60
    Another screen showing off the new lightmaps on models:

    [​IMG]
     
    • Thanks Thanks x 11
  5. Fr0Z3nR

    aa Fr0Z3nR Creator of blackholes & memes. Destroyer of forums

    Messages:
    6,391
    Positive Ratings:
    4,906
    Welcome back.
     
  6. nightwatch

    aa nightwatch

    Messages:
    640
    Positive Ratings:
    446
    hrughhhhhhhhhhhhhhhhhhh
     
  7. henke37

    aa henke37

    Messages:
    1,860
    Positive Ratings:
    430
    So that's why it didn't work! This is a major improvement. Do you need any specific shader settings to use this?
     
  8. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,834
    Positive Ratings:
    4,753
    It does not appear to need any special shaders at all. The base is just a simple vertex lit generic, no special lines or anything.

    EDIT: It does, however, not like phong shading at all. So it doesn't seem to work on models with phong on their textures.
     
    Last edited: Sep 12, 2014
  9. Lampenpam

    aa Lampenpam

    Messages:
    1,018
    Positive Ratings:
    337
    This feature looks brilliant and I have so many questions.
    How much file size does this add up?
    When is it recommended to use this setting on a static prop?
    What's the best resolution setting for the light map?
    What's the outcome if X is bigger then Y?
     
  10. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,834
    Positive Ratings:
    4,753
    1) No more than brush lightmaps do, I imagine. Depends on the resolution.
    2) When the prop is large and doesn't have the vertex density for vertex lighting to work well on it
    3) It's directly pixels, appears to be overlayed over the top of the UV of the model (obviously). The default of 32x32 is just a 32x32 pixel image put over your model...pretty blurry lightmaps. I recommend at least 256x256 if you want half decent defined shadows. This is with a res of 1024x1024 (3 models here)
    4) Probably just stretches, though it's hard to tell.

    Definitely works on old models, unless valve recompiled these without our knowledge.

    Make sure you don't have shared UV space on your model...
     
    • Thanks Thanks x 2
    Last edited: Sep 12, 2014
  11. 111112oo

    111112oo L1: Registered

    Messages:
    23
    Positive Ratings:
    0
    I think that the light mapped props glitch out for players with lower graphics settings atm.
     
  12. takabuschik

    aa takabuschik

    Messages:
    660
    Positive Ratings:
    308
    Does it also affect the shadow the model generates?
    because as far as I know, lightmaps are for shadows done on the model, not by the model, but from what Aly posted it seemed the other way around. (Which means- much easier fix for the stupid fences shadows)
     
  13. Snowshoe

    Snowshoe L2: Junior Member

    Messages:
    53
    Positive Ratings:
    60
    The shadows on the wall in Aly's screenshots are actually props. From rd_asteroid I believe. You can cast detailed shadows on prop models themselves now, instead of simple floors or walls. Lighting is also more detailed on props with the new lightmaps feature, because images are used instead of the model's vertices.

    Props still cast the same old shadows on regular brushes/displacements.
     
  14. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,834
    Positive Ratings:
    4,753
    Yeah, everything in my screenshot is a prop. Except the floor, obviously.
     
  15. Lampenpam

    aa Lampenpam

    Messages:
    1,018
    Positive Ratings:
    337
    256x256? Sounds like that would give you the same results as when you have lightgrid size of 1 on brushes: high filesize and less optimisation.
     
  16. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,834
    Positive Ratings:
    4,753
    Well yeah, I'm saying that assuming you're doing this on selected props you need sharper shadows on, not every prop in your entire map.
     
  17. Snowshoe

    Snowshoe L2: Junior Member

    Messages:
    53
    Positive Ratings:
    60
    Practically, you'd probably use this feature to supplement regular vertex lighting. It only sounds useful (to me) for large models and models that have a low polycount. Allows you to achieve smooth non-jagged lighting on simple meshes and realistic lighting (by realistic, I mean the same level of detail as brushes) on large props.

    Not sure exactly what resolution Valve uses on rd_asteroid, but you can always use the default 32x32. Your average 512x512 compressed VTF with no alpha only uses a couple hundred kilobytes. I'm not sure if lightmaps are compressed or not, though.
     
    Last edited: Sep 12, 2014
  18. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,527
  19. Fantasma

    aa Fantasma

    Messages:
    884
    Positive Ratings:
    977
  20. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,741
    Visual compariosn:
    [​IMG]

    Artifacting aside, here I think I like the vertex one or 128 best, it is fair to note here that the vertex density is actually pretty high for how simple the shapes are. There is some lightbleed with the lightmaps below 512, so the UVs would have needed more padding. I wonder if there's a way of setting up two UV channels now, or if Source 2 has that.

    It is important to note that the banding seen on the left roof models is not from the gif compression.
    Here is a section of that roof as png with the 1024 lightmap:
    [​IMG]
     
    • Thanks Thanks x 3