correct shadows

correct shadows

Re: correct shadows Posted by spka on Thu Mar 16th 2006 at 8:36pm
spka
21 posts
Posted 2006-03-16 8:36pm
spka
member
21 posts 2 snarkmarks Registered: Mar 15th 2006
Hi everyone...

I was wondering today. I made a incomplete roof from rails more like a frame. I tried to get shadows from it but it isn't casting them on the walls/floor. I already rote the sharplighting tutorial but it isn't working for me is guess. I used the blocklight texture for the rails and places it under them.
What did i do wrong?
Link to image: User posted image
Re: correct shadows Posted by ReNo on Thu Mar 16th 2006 at 9:06pm
ReNo
5457 posts
Posted 2006-03-16 9:06pm
ReNo
member
5457 posts 1991 snarkmarks Registered: Aug 22nd 2001 Occupation: Level Designer Location: Scotland
Those are very small cross beams, so I doubt you'll be able to get very good or accurate shadows from them. In order to get small and sharp shadows, you need to increase the lightmap resolution on the surface the shadows will appear on. So here you would do that on the floor inside the garage. You can do that by selecting the texture using the face edit tool (texture application thing), and entering a smaller value in the "lightmap scale" box (smaller values = higher resolution).

THAT SAID, I really don't recommend you do that here. You have a huge open piece of ground and the floor of the garage is that piece of ground. If you increase the lightmap resolution in there, then you will be increasing the lightmap resolution over the whole piece of ground. When increasing the lightmap resolution on surfaces, you don't want to do it too often or on surfaces that are too large, or else the lightmaps will take ages to generate during the map compile process, and will use a lot of texture memory to store in game. It also creates more subdivision on surfaces, resulting in lots more polygons!

An alternative would be to create an overlay of the shadow and apply it that way, but it would be hard to get looking good and correct.

In short, I'd say it's not worth your while trying to get accurate shadows from objects that small.
[img]http://card.mygamercard.net/sig/Default/reno84.png[/img]
Designer @ Haiku Interactive | ReNo-vation.net
Re: correct shadows Posted by fishy on Thu Mar 16th 2006 at 9:06pm
fishy
2623 posts
Posted 2006-03-16 9:06pm
fishy
member
2623 posts 1476 snarkmarks Registered: Sep 7th 2003 Location: glasgow
looking at the egdes of the shadows that are present, they're all very soft and fuzzy. bearing that in mind, i wouldn't expect to see any shadow from anything as thin as those beams. try making wider light blocking brushes.

this is a case where less could be more, so maybe only having blocklights for the top and ends pieces, instead of for the whole framework, would look better.
i eat paint
Re: correct shadows Posted by spka on Fri Mar 17th 2006 at 12:21am
spka
21 posts
Posted 2006-03-17 12:21am
spka
member
21 posts 2 snarkmarks Registered: Mar 15th 2006
Thnx a lot for the replies. True bout the small frame and the final result.
Didn't know yet bout the lightmaps yet so thnx i will give it a shot tho.

Another question bout the lights. I got a door and the frame of the door seems to keep let tru light. How to fix that? Really wanna block all light coming from outside, only if i open the door it should cast light inside.

Greetz spka
Re: correct shadows Posted by spka on Fri Mar 17th 2006 at 9:10am
spka
21 posts
Posted 2006-03-17 9:10am
spka
member
21 posts 2 snarkmarks Registered: Mar 15th 2006
See yourself if its worth the effect.Took a while to compile tho. Thnx spka

http://img69.imageshack.us/img69/6025/frame23qo.jpg
Re: correct shadows Posted by ReNo on Fri Mar 17th 2006 at 4:15pm
ReNo
5457 posts
Posted 2006-03-17 4:15pm
ReNo
member
5457 posts 1991 snarkmarks Registered: Aug 22nd 2001 Occupation: Level Designer Location: Scotland
In response to your new question - lighting in the source engine is static and precalculated. For that reason, you can't really get light changing based on moving objects. The best you can get is the dynamic shadows projected onto the world by dynamic props (such as doors), but they aren't particularly impressive.

What lightmap resolution did you use for that screenshot? Looks very very high to me - too high to use with any frequency or over large areas. View your map with "mat_wireframe 3" in game to see the difference in the polycount between different lightmap scales.
[img]http://card.mygamercard.net/sig/Default/reno84.png[/img]
Designer @ Haiku Interactive | ReNo-vation.net
Re: correct shadows Posted by spka on Fri Mar 17th 2006 at 6:55pm
spka
21 posts
Posted 2006-03-17 6:55pm
spka
member
21 posts 2 snarkmarks Registered: Mar 15th 2006
Hey Reno, k thnx bout the info. Sux tho that the door isn't blocking the outside light very well maybe i can fix it on some way. And the lightmap i used was 2 btw.
I will post some more screenies soon. Start looking nicer by day tho.
Greetz spka
Re: correct shadows Posted by ReNo on Fri Mar 17th 2006 at 7:14pm
ReNo
5457 posts
Posted 2006-03-17 7:14pm
ReNo
member
5457 posts 1991 snarkmarks Registered: Aug 22nd 2001 Occupation: Level Designer Location: Scotland
Yeah, 2 is a too low a scale to use in pretty much any circumstances to be honest, as the number of samples that need to be taken per surface using such a low value is huge. The larger the surface the worse the problem becomes. I'd really never suggest going below 4, and try not to go that low very often or on large surfaces.
[img]http://card.mygamercard.net/sig/Default/reno84.png[/img]
Designer @ Haiku Interactive | ReNo-vation.net
Re: correct shadows Posted by spka on Fri Mar 17th 2006 at 10:36pm
spka
21 posts
Posted 2006-03-17 10:36pm
spka
member
21 posts 2 snarkmarks Registered: Mar 15th 2006
K i'll keep that in mind mister Reno. Cheers!

Laterz spkaLaterz spka topmargin=2 leftmargin=2>
Re: correct shadows Posted by CLs on Sun Mar 19th 2006 at 8:39pm
CLs
66 posts
Posted 2006-03-19 8:39pm
CLs
member
66 posts 7 snarkmarks Registered: Mar 17th 2005 Occupation: Student Location: Canada
Yeah I had the same problem as I wanted sharp, well defined shadows so I set the light map scale down to one shadows looked nice, but instead of getting a healthy 40fps, it slowed to a deathly 8 fps :sad: . My question is why does it split up the brush into a grid like mess killing the frame rate, I assummed it would just take longer to compile...

CLs
CLs
Re: correct shadows Posted by ReNo on Sun Mar 19th 2006 at 9:28pm
ReNo
5457 posts
Posted 2006-03-19 9:28pm
ReNo
member
5457 posts 1991 snarkmarks Registered: Aug 22nd 2001 Occupation: Level Designer Location: Scotland
Well a lightmap is basically just like a texture that is built by the compiler. It is a 2D image made up of what are called "luxels" - the lightmap's equivelant of pixels (as a side note, in a game texture each pixel is known as a "texel", seeing as in game a single pixel of a texture doesn't equal one pixel on your monitor) Each of these luxels has lighting information in it - colour, brightness, that sort of thing. During the game these lightmaps are laid onto the polygons of the world, just as the textures are, in order to show the shadows and lighting.

When you increase the resolution of your lightmaps, then the luxels become smaller and more tightly packed. Each of these luxels needs to be calculated by the compiler, and as such using high resolution lightmaps makes compiles take a whole lot longer. Also, all of that lightmap data needs to be stored in video memory just like textures. If you use too many high resolution lightmaps, then you can quickly fill up your video memory and it will hurt performance.

As a final problem, it seems that in the source engine, there is a maximum size for lightmaps, given in a number of luxels (eg. 128x128 luxels, but I don't know what the ACTUAL size is, thats just an example). If you use a low resolution lightmap then this lightmap could cover a large area - for example, with a lightmap scale in hammer of 8, then in my example of 128x128 luxel lightmaps, each lightmap could cover a 1024x1024 unit surface. However, if you use a lower lightmap scale (ie. a higher lightmap resolution), such as 2, then the maximum area a 128x128 luxel lightmap could cover would be 256x256 units. Each time that a surface needs to start using a new lightmap it is broken up into new polygons and therefore subdividing the surface, as you found CLs.
[img]http://card.mygamercard.net/sig/Default/reno84.png[/img]
Designer @ Haiku Interactive | ReNo-vation.net