New prop_static feature?

Snowshoe

L2: Junior Member
May 16, 2012
53
125
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.

2014-09-12_00008.jpg


You can access the new options in the properties of prop_static entities:
YP38QGS.png


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.
 
Last edited:

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,776
7,674
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.
 

henke37

aa
Sep 23, 2011
2,075
515
So that's why it didn't work! This is a major improvement. Do you need any specific shader settings to use this?
 

Freyja

aa
Jul 31, 2009
3,011
5,839
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:
Mar 23, 2013
1,013
347
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?
 

Freyja

aa
Jul 31, 2009
3,011
5,839
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...
 
Last edited:

111112oo

L1: Registered
Dec 13, 2013
23
0
I think that the light mapped props glitch out for players with lower graphics settings atm.
 

Snowshoe

L2: Junior Member
May 16, 2012
53
125
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)

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.
 
Mar 23, 2013
1,013
347
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...

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.
 

Freyja

aa
Jul 31, 2009
3,011
5,839
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.
 

Snowshoe

L2: Junior Member
May 16, 2012
53
125
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.

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:

YM

LVL100 YM
aa
Dec 5, 2007
7,158
6,079
Visual compariosn:
lightmap-roof.gif


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:
snowplow-lightmap-png.png