Weird shadows due to displacements?

flamez

L1: Registered
Mar 18, 2014
17
9
I'm still learning how to wrangle displacements into working properly, but one thing I've noticed is that there and some weird shadow patches where the displacements are. Below is a screenshot of my WiP that shows what I mean.

1qpaLo3.jpg


It seems like theres a pit there that is blocking all sunlight, but the displacement is only 1-2 HUs lower than the rest, I can't see that causing the massive blackhole patches across the landscape I've got now.
 

Exactol

Certified Hammer Hacker
aa
Jul 11, 2013
421
537
Is there a nodraw brush going across the displacement? Also could we get some shots from hammer?
 

flamez

L1: Registered
Mar 18, 2014
17
9
Thanks for the quick reply!
Yes, there are no draws in the area, nestled below the displacement brushes (if this is not the proper way to handle this, please tell me what is...). Below is the view within hammer:

oge7rhQ.jpg
 

Exactol

Certified Hammer Hacker
aa
Jul 11, 2013
421
537
Lower the nodraw a little bit, that is whats causing the weird shadows. As you can see, the nodraw mostly matches up with the odd shadow.
 

flamez

L1: Registered
Mar 18, 2014
17
9
That did the trick! I moved the nodraw down a few HUs, patched up the leaks that caused, and the ground shadows look great.
Thanks for all the help guys, and for the good post on Lightmap Scales.
 

Freyja

aa
Jul 31, 2009
2,994
5,813
I think? Lightmap scale does nothing on displacements anyway. Pretty sure they light per-vertex of the displacement, so making it higher power gives more detailed lighting.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
Displacements are definitely lit using lightmaps. Just look at the screenshot in the first post up there; you can see the individual luxels in that blotch.
 

wareya

L420: High Member
Jun 17, 2012
493
191
iirc from looking at badlands, a displacement can be perfectly flush with a nodraw and get the light instead of the nodraw blocking it. not sure tho.
 

Freyja

aa
Jul 31, 2009
2,994
5,813
It does appear that from reading the dev wiki apparently the density of the displacement (size and power) has an effect on the maximum lightmap scale. The wiki is a bit unclear but I think you can't have a luxel bigger than one "square" on the displacement, either that or it means there's a minimum scale you can set, it's apparently linked but is unclear how.

But thanks for the clarification steve, good to know
 
Last edited:

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Both are considered for displacements. In my experience you only get the shadowing if a vertex is obscured from the light source, which is why you can get away with nodraw sticking out of rounded corners when it is only piercing the edges between tris.
 

flamez

L1: Registered
Mar 18, 2014
17
9
Thanks for all the information everyone, yes the nodraw was sealing the map, but I wasn't aware that the nodraw would affect the shadowing. I had a feeling that it had something to do with lightmap (even though I have no idea what it really does when I enable Lightmap in 3D view) due to the blocky view of the shadows.

Thank you for all the help and information again, hopefully I'll have cp_andro up and running in a few weeks for you guys to critique and tear down :).
 

xzzy

aa
Jan 30, 2010
815
531
I'd try changing the nodraw for a skybox texture. (the skybox texture being almost the same as nodraw except it doesn't block light) for science!

Not sure that's true. The reason the nodraw brush was allowing those shadows to be created is not because it was blocking light, but because it was blocking visibility. It's a side effect of visibility that prevents vrad from lighting the displacement. This is semi-significant because there is also the block light texture which does in fact block light, but it does not block vis.

Skybox brushes block vis as well, which means in theory they can block light. The difference is that it also creates light so you might never notice what's going on.

I can think of a few ways to test it (colored lights between nested layers of skybox brushes would probably work) but it probably doesn't matter.. it'd just be a curious quirk of the engine.


edit - a check of the developer wiki says that skybox brushes can't cast shadows so it would probably work as desired for the OP. But moving the nodraw brush is probably the "correct" fix.
 
Last edited:

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
I wasn't aware that the nodraw would affect the shadowing. I had a feeling that it had something to do with lightmap (even though I have no idea what it really does when I enable Lightmap in 3D view)
Nodraw is completely opaque to all aspects of the engine, despite being "invisible" to humans.

About understanding lightmaps, try this: http://forums.tf2maps.net/showthread.php?t=1693
 
Last edited:

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
It does appear that from reading the dev wiki apparently the density of the displacement (size and power) has an effect on the maximum lightmap scale. The wiki is a bit unclear but I think you can't have a luxel bigger than one "square" on the displacement, either that or it means there's a minimum scale you can set, it's apparently linked but is unclear how.
For what it's worth, before it occurred to me that OP's image was enough proof that displacements are lightmapped, I went in and tried making a test/demo map with a displaced floor and high-res lightmap scale, only to discover that it was forcing me to use a minimum scale of 9 for some reason. I'd never encountered that before and I wondered if something had gone wrong with Hammer. So "minimum scale" is apparently right, although I have still no idea what the exact rules are.
 

xzzy

aa
Jan 30, 2010
815
531
For what it's worth, before it occurred to me that OP's image was enough proof that displacements are lightmapped, I went in and tried making a test/demo map with a displaced floor and high-res lightmap scale, only to discover that it was forcing me to use a minimum scale of 9 for some reason. I'd never encountered that before and I wondered if something had gone wrong with Hammer. So "minimum scale" is apparently right, although I have still no idea what the exact rules are.

Does the minimum change based on the displacement resolution? Because a scale of 9 just so happens to match the number of vertices on an edge for a "power of 3" displacement.
 

wareya

L420: High Member
Jun 17, 2012
493
191
Displacements don't get split according to visleafs like normal brushes do (valve abuses this property for geometry that goes through skybox brushes in 5gorge and badlands) so using skybox instead of nodraw should work