Sharper Shadows

Sharper Shadows

Re: Sharper Shadows Posted by Niborius on Tue Mar 30th 2010 at 6:46pm
Niborius
1007 posts
Posted 2010-03-30 6:46pm
Niborius
member
1007 posts 1116 snarkmarks Registered: Mar 23rd 2009 Location: The Netherlands
Some shadows in my map are kinda blurry and I want them to be a bit sharper, especially in certain areas.
Is there a way to do this? And if yes, will it decrease the performance?

Edit: If it helps, I am trying to get this working for a Left 4 Dead 2 map.
Youtube Channel: https://www.youtube.com/c/Nibgames
Re: Sharper Shadows Posted by satchmo on Tue Mar 30th 2010 at 8:14pm
satchmo
2077 posts
Posted 2010-03-30 8:14pm
satchmo
member
2077 posts 1809 snarkmarks Registered: Nov 24th 2004 Occupation: pediatrician Location: Los Angeles, U.S.
You have to adjust the lightmap grid.

Open up the texture application toolbox and change the view in 3D to "lightmap". Using the texture tool, select the surface that you want to adjust the sharpness of the shadow, and change the grid density. The smaller the number, the sharper the shadow.

As a reference, 32 is the default grid density. To make it relatively sharper, change it to 4. To make the shadow really sharp, set it to 2.

One thing to keep in mind when you modify grid density is that if you have two surfaces adjacent to each other and they have different grid density, the shadow falling on them can make the transition between the two surfaces look very obvious and ugly.

Making the shadows sharp does make a performance hit, and it also makes the .BSP file size larger. This is especially true if you change the grid density of a very large surface. So keep this in mind, and use it wisely.

Incidentally, if you want to improve performance and the shadow blurriness doesn't matter in some places, you can make the number bigger. Change it to 64 or even 128.
Re: Sharper Shadows Posted by G4MER on Wed Mar 31st 2010 at 7:37am
G4MER
2460 posts
Posted 2010-03-31 7:37am
G4MER
floaty snark rage
member
2460 posts 360 snarkmarks Registered: Sep 6th 2003 Location: USA
As explained I think in this youtube vid.

[youtube]<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/Ne59X-e-R9Y&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"><param><embed src="http:/www.youtube.com/v/Ne59X-e-R9Y&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>[/youtube]
Re: Sharper Shadows Posted by Le Chief on Wed Mar 31st 2010 at 7:37am
Le Chief
2605 posts
Posted 2010-03-31 7:37am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
satchmo said:
As a reference, 32 is the default grid density.
Isn't 16 the default?
Aaron's Stuff
Re: Sharper Shadows Posted by Niborius on Wed Mar 31st 2010 at 1:22pm
Niborius
1007 posts
Posted 2010-03-31 1:22pm
Niborius
member
1007 posts 1116 snarkmarks Registered: Mar 23rd 2009 Location: The Netherlands
satchmo said:
You have to adjust the lightmap grid.

Open up the texture application toolbox and change the view in 3D to "lightmap". Using the texture tool, select the surface that you want to adjust the sharpness of the shadow, and change the grid density. The smaller the number, the sharper the shadow.

As a reference, 32 is the default grid density. To make it relatively sharper, change it to 4. To make the shadow really sharp, set it to 2.

One thing to keep in mind when you modify grid density is that if you have two surfaces adjacent to each other and they have different grid density, the shadow falling on them can make the transition between the two surfaces look very obvious and ugly.

Making the shadows sharp does make a performance hit, and it also makes the .BSP file size larger. This is especially true if you change the grid density of a very large surface. So keep this in mind, and use it wisely.

Incidentally, if you want to improve performance and the shadow blurriness doesn't matter in some places, you can make the number bigger. Change it to 64 or even 128.
Thanks man, this did the trick.
I have one question though: some floor textures in my map have a rotation amount of 45. When a light is casted on them, they give these ugly blocky shadows.

Screenshot:
[IMG]http://i42.tinypic.com/2hn7xqq.jpg[/IMG]

You can even still see this when I lowered the light grid thingy to 2: [IMG]http://i40.tinypic.com/htvadw.jpg[/IMG]

Btw, if you wonder, those screenshots were not taken at the same place.

@Aaron: You're right, it is.
Youtube Channel: https://www.youtube.com/c/Nibgames
Re: Sharper Shadows Posted by Crono on Thu Apr 1st 2010 at 2:07am
Crono
6628 posts
Posted 2010-04-01 2:07am
Crono
super admin
6628 posts 700 snarkmarks Registered: Dec 19th 2003 Location: Oregon, USA
A lot of the lighting in L4D2 appears to actually be dynamic. As far as I can tell, some of the shadow artifacts are due to shadow map resolution. I haven't, personally, seen any way to increase the resolution on them in L4D2. If you could, it would be controlled by the end-user.

Other than that, all static shadows would be controlled by the light map texture resolution of the surface the shadow is being projected onto, maybe there's some issue that's being overlooked in respect to this.

If it is a dynamic light problem and there's no user setting to alter the resolution of the shadow maps used, you're pretty much stuck with those blocky blurred shadows. I guess, if you did some experimenting and found out how it chooses what light sources have dynamic shadows and which ones don't you'd be able to better control it. But, even in L4D1 a lot of the shadows were pretty ugly.
Blame it on Microsoft, God does.
Re: Sharper Shadows Posted by Le Chief on Thu Apr 1st 2010 at 6:09am
Le Chief
2605 posts
Posted 2010-04-01 6:09am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
What sort of light is that nib? Normal light, spot light, dynamic light, environment light etc?

I've never noticed this problem in the "main" branch of the source engine (hl2/ep2) but this has something to do with the lightmap grid. When you rotate the texture you also are rotating the lightmap grid, the thing which helps determine lighting on brush based surfaces and it looks like it's resulting in poor shadows. :uncertain:
Aaron's Stuff
Re: Sharper Shadows Posted by Niborius on Thu Apr 1st 2010 at 10:13am
Niborius
1007 posts
Posted 2010-04-01 10:13am
Niborius
member
1007 posts 1116 snarkmarks Registered: Mar 23rd 2009 Location: The Netherlands
aaron_da_killa said:
What sort of light is that nib? Normal light, spot light, dynamic light, environment light etc?

I've never noticed this problem in the "main" branch of the source engine (hl2/ep2) but this has something to do with the lightmap grid. When you rotate the texture you also are rotating the lightmap grid, the thing which helps determine lighting on brush based surfaces and it looks like it's resulting in poor shadows. :uncertain:
This is an environment light.

The odd thing is, that the lightmap grid does show up normally on that floor in hammer editor (it isn't rotated 45 degrees, but the texture is). In-game, it shows the light as if it was made on a 45 degrees rotated lightmap.

Edit: The floor lightmap grid does not show up normal in hammer editor. Not sure why I thought it did, but I just checked and it's rotated 45 degrees just like the floor texture.
Youtube Channel: https://www.youtube.com/c/Nibgames